/* JSON Sorter Interface */
.sorter-interface {
    margin-bottom: 3rem;
}

.sorter-container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.sorter-controls {
    padding: 1.25rem 1.5rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.controls-section {
    margin-bottom: 1.25rem;
}

.controls-heading {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.control-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.radio-option:hover {
    background-color: #f3f4f6;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #3b82f6;
    background-color: #3b82f6;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: #ffffff;
    border-radius: 50%;
}

.radio-label {
    font-size: 0.9375rem;
    color: #374151;
    user-select: none;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(236px, 1fr));
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.625rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.checkbox-option:hover {
    background-color: #f3f4f6;
}

.checkbox-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom {
    border-color: #3b82f6;
    background-color: #3b82f6;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 5px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
}

.checkbox-label {
    font-size: 0.9375rem;
    color: #374151;
    user-select: none;
}

.actions-section {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

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

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

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

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

/* Editor Sections */
.sorter-editors {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 1024px) {
    .sorter-editors {
        grid-template-columns: 1fr 1fr;
    }
}

.editor-section {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    min-height: 500px;
}

.editor-input {
    border-right: 1px solid #e5e7eb;
}

.editor-output {
    border-left: 1px solid #e5e7eb;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.editor-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.editor-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.editor-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
    background: #e5e7eb;
    color: #6b7280;
}

.editor-badge.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.editor-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.editor-count {
    font-size: 0.8125rem;
    color: #6b7280;
}

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

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.editor-container {
    flex: 1;
    min-height: 450px;
    border: none;
}

.editor-footer {
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

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

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

/* Info Section */
.sorter-info {
    margin-bottom: 3rem;
}

.info-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.info-card {
    padding: 1.75rem;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.info-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.info-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 12px;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.info-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.75rem 0;
}

.info-text {
    font-size: 0.9375rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .sorter-controls {
        padding: 1rem;
    }

    .controls-section {
        margin-bottom: 1rem;
    }

    .controls-heading {
        font-size: 0.9375rem;
        margin-bottom: 0.875rem;
    }

    .controls-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .actions-section {
        width: 100%;
        margin-top: 0.875rem;
        padding-top: 0.875rem;
    }

    .btn-primary,
    .btn-secondary {
        flex: 1;
        justify-content: center;
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }

    .editor-section {
        min-height: 400px;
    }

    .editor-input {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .editor-output {
        border-left: none;
    }

    .editor-header {
        padding: 1rem;
    }

    .editor-footer {
        padding: 0.875rem 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .info-container {
        grid-template-columns: 1fr;
    }

    .info-card {
        padding: 1.5rem;
    }
}

/* ACE Editor Customization */
.ace_editor {
    border-radius: 0;
}

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

.ace_gutter-active-line {
    background: #f3f4f6;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #3b82f6;
    z-index: 1050;
    max-width: 320px;
    animation: slideIn 0.3s ease;
}

.notification.success {
    border-left-color: #10b981;
}

.notification.error {
    border-left-color: #ef4444;
}

.notification.info {
    border-left-color: #3b82f6;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
