/* JSON Generator Wrapper */
.json-generator-wrapper {
    margin-bottom: 2rem;
}

.generator-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

/* Section Titles */
.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 1.5rem 0;
}

/* Preset Section */
.preset-section {
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e5e7eb;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.preset-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.preset-card:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.preset-card:active {
    transform: translateY(0);
}

.preset-card.active {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.preset-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.preset-label {
    text-align: center;
}

/* Options Section */
.options-section {
    padding: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.option-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.label-text {
    color: #4b5563;
}

.label-value {
    color: #3b82f6;
    font-weight: 600;
    font-size: 0.9375rem;
}

.range-input {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    transition: all 0.2s ease;
}

.range-input::-webkit-slider-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.range-input::-moz-range-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.select-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    font-size: 0.9375rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.select-input:hover {
    border-color: #d1d5db;
}

.select-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.checkbox-label {
    font-size: 0.9375rem;
    color: #374151;
    font-weight: 500;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 140px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #ffffff;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.btn-icon {
    font-size: 1.125rem;
    line-height: 1;
}

/* Output Section */
.output-section {
    padding: 2rem;
    background: #fafafa;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.output-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon-only {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.125rem;
}

.btn-icon-only:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-2px);
}

.btn-icon-only:active {
    transform: translateY(0);
}

.copy-status {
    min-height: 24px;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #10b981;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.copy-status.show {
    opacity: 1;
}

.json-editor-wrapper {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.editor {
    height: 450px;
    width: 100%;
}

/* ACE Editor Theme Override */
.ace-github {
    background: #ffffff !important;
}

.ace-github .ace_gutter {
    background: #f9fafb !important;
    border-right: 1px solid #e5e7eb;
}

.ace-github .ace_gutter-active-line {
    background: #f3f4f6 !important;
}

.ace-github .ace_cursor {
    color: #3b82f6 !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .preset-section,
    .options-section,
    .output-section {
        padding: 1.5rem;
    }

    .preset-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .preset-card {
        padding: 1rem 0.75rem;
    }

    .preset-icon {
        font-size: 1.5rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 1rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        min-width: unset;
    }

    .output-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .output-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .editor {
        height: 350px;
    }

    .section-title {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .preset-grid {
        grid-template-columns: 1fr;
    }

    .preset-section,
    .options-section,
    .output-section {
        padding: 1.25rem;
    }

    .editor {
        height: 300px;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .generator-card {
        background: #1f2937;
        border-color: #374151;
    }

    .section-title {
        color: #f9fafb;
    }

    .preset-section {
        background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
        border-color: #374151;
    }

    .preset-card {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }

    .preset-card:hover {
        background: #1e3a8a;
        border-color: #3b82f6;
    }

    .options-section {
        border-color: #374151;
    }

    .option-label,
    .label-text {
        color: #d1d5db;
    }

    .select-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }

    .checkbox-group {
        background: #111827;
    }

    .checkbox-label {
        color: #d1d5db;
    }

    .btn-secondary {
        background: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }

    .output-section {
        background: #111827;
    }

    .json-editor-wrapper {
        border-color: #4b5563;
        background: #1f2937;
    }

    .ace-github {
        background: #1f2937 !important;
    }

    .ace-github .ace_gutter {
        background: #111827 !important;
        border-color: #374151;
    }
}
