/**
 * 🎨 Settings Modal Styles
 * =========================
 * 
 * Modern, responsive settings modal with theme support
 * Includes animations, transitions, and accessibility features
 * 
 * @author Greyfood AI Team
 * @version 1.0.0
 * @date 2025-11-24
 */

/* ============================================================================
   BACKDROP
   ============================================================================ */

.settings-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.settings-modal-backdrop.show {
    opacity: 1;
}

/* ============================================================================
   MODAL CONTAINER
   ============================================================================ */

.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.settings-modal.show {
    opacity: 1;
    transform: scale(1);
}

/* ============================================================================
   MODAL CONTENT
   ============================================================================ */

.settings-modal-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 2px solid rgba(212, 175, 55, 0.3);
}

/* Dark theme support */
body.dark-theme .settings-modal-container {
    background: rgba(30, 30, 30, 0.98);
    border: 2px solid rgba(212, 175, 55, 0.5);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
}

/* ============================================================================
   MODAL HEADER
   ============================================================================ */

.settings-modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

body.dark-theme .settings-modal-header {
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

.settings-modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #d4af37 0%, #f7dc6f 50%, #d4af37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.settings-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.settings-modal-close:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
    transform: rotate(90deg);
}

body.dark-theme .settings-modal-close {
    color: #ccc;
}

body.dark-theme .settings-modal-close:hover {
    background: rgba(212, 175, 55, 0.2);
    color: #f7dc6f;
}

/* ============================================================================
   TABS
   ============================================================================ */

.settings-modal-tabs {
    display: flex;
    border-bottom: 2px solid rgba(212, 175, 55, 0.2);
    padding: 0 30px;
    gap: 10px;
    flex-shrink: 0;
}

body.dark-theme .settings-modal-tabs {
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

.settings-tab {
    background: none;
    border: none;
    padding: 15px 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-tab:hover {
    color: #d4af37;
    background: rgba(212, 175, 55, 0.05);
}

.settings-tab.active {
    color: #d4af37;
    border-bottom-color: #d4af37;
}

body.dark-theme .settings-tab {
    color: #aaa;
}

body.dark-theme .settings-tab:hover {
    color: #f7dc6f;
    background: rgba(212, 175, 55, 0.1);
}

body.dark-theme .settings-tab.active {
    color: #f7dc6f;
    border-bottom-color: #f7dc6f;
}

/* ============================================================================
   CONTENT AREA
   ============================================================================ */

.settings-modal-content {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Custom scrollbar */
.settings-modal-content::-webkit-scrollbar {
    width: 8px;
}

.settings-modal-content::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.05);
    border-radius: 10px;
}

.settings-modal-content::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 10px;
}

.settings-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

.settings-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.settings-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   THEME OPTIONS
   ============================================================================ */

.theme-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 2px solid rgba(212, 175, 55, 0.2);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: rgba(255, 255, 255, 0.5);
}

.theme-option:hover {
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(212, 175, 55, 0.05);
    transform: translateX(5px);
}

.theme-option.active {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

body.dark-theme .theme-option {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(212, 175, 55, 0.3);
}

body.dark-theme .theme-option:hover {
    border-color: rgba(212, 175, 55, 0.6);
    background: rgba(212, 175, 55, 0.08);
}

body.dark-theme .theme-option.active {
    border-color: #f7dc6f;
    background: rgba(212, 175, 55, 0.15);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.theme-option-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.theme-option-content {
    flex: 1;
}

.theme-option-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #333;
}

body.dark-theme .theme-option-name {
    color: #f0f0f0;
}

.theme-option-description {
    font-size: 14px;
    color: #666;
    margin: 0;
}

body.dark-theme .theme-option-description {
    color: #aaa;
}

.theme-option-check {
    font-size: 24px;
    color: #d4af37;
    font-weight: bold;
    flex-shrink: 0;
}

body.dark-theme .theme-option-check {
    color: #f7dc6f;
}

/* ============================================================================
   LANGUAGE OPTIONS
   ============================================================================ */

.language-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 2px solid rgba(212, 175, 55, 0.2);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: rgba(255, 255, 255, 0.5);
}

.language-option:hover {
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(212, 175, 55, 0.05);
    transform: translateX(5px);
}

.language-option.active {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

body.dark-theme .language-option {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(212, 175, 55, 0.3);
}

body.dark-theme .language-option:hover {
    border-color: rgba(212, 175, 55, 0.6);
    background: rgba(212, 175, 55, 0.08);
}

body.dark-theme .language-option.active {
    border-color: #f7dc6f;
    background: rgba(212, 175, 55, 0.15);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.language-option-flag {
    font-size: 48px;
    flex-shrink: 0;
}

.language-option-content {
    flex: 1;
}

.language-option-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #333;
}

body.dark-theme .language-option-name {
    color: #f0f0f0;
}

.language-option-code {
    font-size: 13px;
    color: #666;
    margin: 0;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

body.dark-theme .language-option-code {
    color: #aaa;
}

.language-option-check {
    font-size: 24px;
    color: #d4af37;
    font-weight: bold;
    flex-shrink: 0;
}

body.dark-theme .language-option-check {
    color: #f7dc6f;
}

/* ============================================================================
   MODAL FOOTER
   ============================================================================ */

.settings-modal-footer {
    padding: 20px 30px;
    border-top: 2px solid rgba(212, 175, 55, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

body.dark-theme .settings-modal-footer {
    border-top: 2px solid rgba(212, 175, 55, 0.3);
}

.settings-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-btn-secondary {
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
    border: 2px solid rgba(212, 175, 55, 0.3);
}

.settings-btn-secondary:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

body.dark-theme .settings-btn-secondary {
    background: rgba(212, 175, 55, 0.15);
    color: #f7dc6f;
    border: 2px solid rgba(212, 175, 55, 0.4);
}

body.dark-theme .settings-btn-secondary:hover {
    background: rgba(212, 175, 55, 0.25);
    border-color: rgba(212, 175, 55, 0.6);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .settings-modal {
        padding: 10px;
    }

    .settings-modal-container {
        max-width: 100%;
        border-radius: 15px;
    }

    .settings-modal-header {
        padding: 20px;
    }

    .settings-modal-title {
        font-size: 20px;
    }

    .settings-modal-tabs {
        padding: 0 20px;
    }

    .settings-tab {
        padding: 12px 15px;
        font-size: 14px;
    }

    .settings-modal-content {
        padding: 20px;
    }

    .theme-option,
    .language-option {
        padding: 15px;
        gap: 15px;
    }

    .theme-option-icon,
    .language-option-flag {
        font-size: 36px;
    }

    .theme-option-name,
    .language-option-name {
        font-size: 16px;
    }

    .settings-modal-footer {
        padding: 15px 20px;
    }

    .settings-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .settings-modal-title {
        font-size: 18px;
    }

    .settings-tab {
        padding: 10px 12px;
        font-size: 13px;
        gap: 5px;
    }

    .theme-option,
    .language-option {
        padding: 12px;
        gap: 12px;
    }

    .theme-option-icon,
    .language-option-flag {
        font-size: 32px;
    }

    .theme-option-name,
    .language-option-name {
        font-size: 15px;
    }

    .theme-option-description,
    .language-option-code {
        font-size: 12px;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* Focus states for keyboard navigation */
.settings-tab:focus,
.theme-option:focus,
.language-option:focus,
.settings-btn:focus {
    outline: 3px solid rgba(212, 175, 55, 0.5);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .settings-modal,
    .settings-modal-backdrop,
    .settings-tab-content,
    .theme-option,
    .language-option,
    .settings-btn {
        transition: none;
        animation: none;
    }
}
