/* ============================================
   MENTTA - Theme System
   Dark/Light mode with CSS variables
   ============================================ */

/* ============================================
   CSS Variables - Light Mode (Default)
   ============================================ */
:root {
    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    --bg-input: #ffffff;

    /* Text */
    --text-primary: #111111;
    --text-secondary: #666666;
    --text-tertiary: #888888;
    --text-inverse: #ffffff;

    /* Borders */
    --border-color: rgba(0, 0, 0, 0.06);
    --border-focus: #111111;

    /* Accent Colors (Monochrome Luxury Palette) */
    --accent-primary: #111111;
    --accent-secondary: #666666;
    --accent-hover: #333333;
    --accent-light: #f5f5f5;

    /* Status Colors (Muted) */
    --success: #4a6b4a;
    --success-light: #f0f5f0;
    --warning: #b39b7d;
    --warning-light: #fdfbf7;
    --danger: #cf4a4a;
    --danger-light: #fcf5f5;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(45, 58, 45, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(45, 58, 45, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(45, 58, 45, 0.1);

    /* Backdrop */
    --backdrop-color: rgba(45, 58, 45, 0.3);

    /* Easing */
    --ease-lux: cubic-bezier(0.16, 1, 0.3, 1);

    /* ============================================
       DESIGN SYSTEM - Consistency Scale
       ============================================ */

    /* Border Radius Scale */
    --radius-sm: 0.5rem;
    /* 8px - small buttons, tags */
    --radius-md: 1rem;
    /* 16px - inputs, buttons, cards */
    --radius-lg: 1.5rem;
    /* 24px - large cards, modals */
    --radius-xl: 2rem;
    /* 32px - hero sections, panels */
    --radius-full: 9999px;
    /* pills, avatars */

    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Premium Shadows */
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 40px rgba(0, 0, 0, 0.08);
    --shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 30px rgba(255, 255, 255, 0.15);

    /* ============================================
       MOBILE-FIRST RESPONSIVE SYSTEM
       ============================================ */

    /* Unified Breakpoints Reference:
       - xs: 0-374px (small phones)
       - sm: 375-479px (standard phones)
       - md: 480-767px (large phones, phablets)
       - lg: 768-1023px (tablets)
       - xl: 1024-1279px (small desktops)
       - 2xl: 1280px+ (large desktops)
    */

    /* Mobile-First Base Spacing */
    --mobile-padding-x: 1rem;
    --mobile-padding-y: 0.75rem;
    --mobile-section-gap: 1.5rem;
    --mobile-card-padding: 1.25rem;

    /* Touch Target Minimums (WCAG 2.5.5) */
    --touch-target-min: 44px;
    --touch-target-comfortable: 48px;

    /* Mobile Typography Scale */
    --mobile-text-xs: 0.75rem;
    /* 12px */
    --mobile-text-sm: 0.8125rem;
    /* 13px */
    --mobile-text-base: 0.875rem;
    /* 14px */
    --mobile-text-lg: 1rem;
    /* 16px */
    --mobile-text-xl: 1.125rem;
    /* 18px */
    --mobile-text-2xl: 1.5rem;
    /* 24px */
    --mobile-text-3xl: 1.875rem;
    /* 30px */
    --mobile-text-4xl: 2.25rem;
    /* 36px */
}

/* ============================================
   CSS Variables - Dark Mode
   ============================================ */
[data-theme="dark"] {
    /* Backgrounds */
    --bg-primary: #050505;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-input: #1a1a1a;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-tertiary: #666666;
    --text-inverse: #000000;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-focus: #ffffff;

    /* Accent Colors */
    --accent-primary: #ffffff;
    --accent-secondary: #e5e5e5;
    --accent-hover: #cccccc;
    --accent-light: rgba(255, 255, 255, 0.1);

    /* Status Colors */
    --success: #8b9d8b;
    --success-light: rgba(139, 157, 139, 0.2);
    --warning: #ccb096;
    --warning-light: rgba(204, 176, 150, 0.2);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.2);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7);

    /* Backdrop */
    --backdrop-color: rgba(0, 0, 0, 0.9);
}

/* ============================================
   Base Theme Application
   ============================================ */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s var(--ease-lux), color 0.3s var(--ease-lux);
    opacity: 0;
    /* Prepared for Initial Reveal */
}

body.loaded {
    animation: luxuriousFadeIn 1s var(--ease-lux) forwards;
}

@keyframes luxuriousFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.initial-reveal-container {
    opacity: 0;
    transform: translateY(30px);
}

.initial-reveal-container.active {
    animation: elasticFloatUp 1.2s var(--ease-lux) forwards;
}

@keyframes elasticFloatUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Navigation Flow: Cross-Dissolve with Scale */
.page-transitionING {
    transition: transform 0.6s var(--ease-lux), opacity 0.6s var(--ease-lux);
    pointer-events: none;
}

.page-exit {
    opacity: 0;
    transform: scale(0.95);
}

.page-enter {
    opacity: 0;
    transform: scale(1.05);
}

.page-enter-active {
    opacity: 1;
    transform: scale(1);
}

/* Modal Kinetics: Depth Zoom */
.modal-overlay {
    backdrop-filter: blur(0px);
    transition: backdrop-filter 0.6s var(--ease-lux), opacity 0.6s var(--ease-lux);
}

.modal-overlay.active {
    backdrop-filter: blur(20px);
}

.modal-content {
    transform: scale(0.4);
    opacity: 0;
    transition: transform 0.8s var(--ease-lux), opacity 0.6s var(--ease-lux);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* Micro-interactions: Shadow Bloom */
.btn-bloom,
.center-card,
.menu-trigger {
    transition: all 0.4s var(--ease-lux);
}

.btn-bloom:active,
.center-card:active {
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.1) !important;
    transform: scale(0.98);
}

/* ============================================
   Sidebar Menu Styles
   ============================================ */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    z-index: 998;
}

.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background-color: var(--bg-secondary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 20px 0 80px rgba(0, 0, 0, 0.08);
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
}

.sidebar-menu.active {
    transform: translateX(0);
}

@media (min-width: 640px) {
    .sidebar-menu {
        width: 320px;
    }
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.sidebar-user-info h3 {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}

.sidebar-user-info p {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin: 0.25rem 0 0 0;
}

.sidebar-user-info .mood-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.sidebar-close:hover {
    color: var(--text-primary);
}

/* Sidebar Content */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.sidebar-section {
    padding: 0 0.5rem;
    margin-bottom: 0.5rem;
}

.sidebar-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    padding: 0.75rem 0.75rem 0.5rem;
    font-weight: 600;
}

/* Menu Buttons */
.menu-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.125rem;
    border: 1px solid rgba(45, 58, 45, 0.05);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: 1rem;
    transition: all 0.3s ease;
    margin-bottom: 0.625rem;
    box-shadow: 0 2px 4px rgba(45, 58, 45, 0.02);
}

.menu-btn:hover {
    background-color: var(--bg-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 58, 45, 0.08);
    border-color: var(--border-color);
}

.menu-btn-icon {
    font-size: 1.125rem;
    width: 1.5rem;
    text-align: center;
}

.menu-btn-crisis {
    color: var(--danger);
    background-color: var(--danger-light);
}

.menu-btn-crisis:hover {
    background-color: rgba(239, 68, 68, 0.25);
}

.menu-btn-resources {
    color: var(--success);
}

/* Chat History List */
.chat-history-list {
    max-height: 200px;
    overflow-y: auto;
}

.chat-history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}

.chat-history-item:hover {
    background-color: var(--bg-tertiary);
}

.chat-history-item-date {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

.chat-history-item-title {
    font-size: 0.875rem;
    color: #2d3a2d;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.chat-history-item:hover .chat-history-item-title {
    color: #111;
}

.chat-history-item:hover .chat-history-item-date {
    color: #444;
}

.chat-history-item-mood {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
}

.chat-history-item-mood.positive {
    background-color: var(--success);
}

.chat-history-item-mood.neutral {
    background-color: var(--warning);
}

.chat-history-item-mood.negative {
    background-color: var(--danger);
}

/* Notifications Section */
.notifications-section {
    padding: 0 0.5rem;
    margin-bottom: 0.5rem;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    background-color: var(--accent-light);
    margin-bottom: 0.375rem;
}

.notification-item.read {
    background-color: transparent;
}

.notification-item-content {
    flex: 1;
}

.notification-item-title {
    font-size: 0.8125rem;
    color: var(--text-primary);
    font-weight: 500;
}

.notification-item-time {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-footer .menu-btn {
    color: var(--text-secondary);
}

.sidebar-version {
    text-align: center;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
}

/* ============================================
   Hamburger Button with Badge
   ============================================ */
.hamburger-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.hamburger-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.hamburger-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: white;
    background-color: var(--danger);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-badge.hidden {
    display: none;
}

/* ============================================
   Toggle Switch (iOS Style)
   ============================================ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 3rem;
    height: 1.75rem;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--border-color);
    transition: background-color 0.3s ease;
    border-radius: 9999px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 1.25rem;
    width: 1.25rem;
    left: 0.25rem;
    bottom: 0.25rem;
    background-color: white;
    transition: transform 0.3s ease;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--accent-primary);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(1.25rem);
}

/* ============================================
   Modal Styles
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--backdrop-color);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: 1rem;
    max-width: 28rem;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.25s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Crisis Modal Specific Styles
   ============================================ */
.crisis-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--bg-tertiary);
}

.crisis-option:hover {
    border-color: var(--accent-primary);
    background-color: var(--accent-light);
}

.crisis-option-icon {
    font-size: 1.5rem;
}

.crisis-option-content h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.crisis-option-content p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0 0;
}

.crisis-call-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--danger);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.crisis-call-btn:hover {
    background-color: #DC2626;
}

/* ============================================
   Resources Modal Specific Styles
   ============================================ */
.resource-card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.resource-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-tertiary);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.resource-card-header:hover {
    background-color: var(--border-color);
}

.resource-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.resource-card-icon {
    font-size: 1.25rem;
}

.resource-card-chevron {
    color: var(--text-tertiary);
    transition: transform 0.3s ease;
}

.resource-card.expanded .resource-card-chevron {
    transform: rotate(180deg);
}

.resource-card-content {
    display: none;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.resource-card.expanded .resource-card-content {
    display: block;
}

.resource-card-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0 0 0.75rem 0;
}

.resource-card-content ol,
.resource-card-content ul {
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.8;
    padding-left: 1.25rem;
    margin: 0 0 1rem 0;
}

.resource-card-content li {
    margin-bottom: 0.25rem;
}

.resource-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background-color: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.resource-btn:hover {
    background-color: var(--accent-hover);
}

.resource-btn-secondary {
    background-color: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.resource-btn-secondary:hover {
    background-color: var(--accent-light);
}

/* Crisis Lines in Resources */
.crisis-lines-list {
    margin-top: 0.75rem;
}

.crisis-line-country {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1rem 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.crisis-line-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.crisis-line-item:last-child {
    border-bottom: none;
}

.crisis-line-name {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.crisis-line-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Supportive Phrases */
.supportive-phrase {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    text-align: center;
    margin-bottom: 1rem;
}

.supportive-phrase p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    font-style: italic;
    margin: 0;
}

/* ============================================
   Analysis Paused Banner
   ============================================ */
.analysis-paused-banner {
    background-color: var(--warning-light);
    border-bottom: 1px solid var(--warning);
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 0.8125rem;
    color: #92400E;
    display: none;
}

.analysis-paused-banner.active {
    display: block;
}

[data-theme="dark"] .analysis-paused-banner {
    color: var(--warning);
}

.analysis-paused-banner button {
    background: none;
    border: none;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

/* ============================================
   Map Placeholder Modal
   ============================================ */
.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.map-placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.map-placeholder h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.map-placeholder p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   Scrollbar Styling (applies everywhere)
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-tertiary);
}

/* ============================================
   UX-008: Botón de Pánico Mejorado
   ============================================ */
.panic-button {
    animation: panicPulse 2s ease-in-out infinite;
}

@keyframes panicPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }
}

.panic-button-fullscreen {
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 40px) !important;
    max-width: 400px !important;
    padding: 1rem 2rem !important;
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    z-index: 999 !important;
}

/* ============================================
   UX-001: Herramientas Interactivas
   ============================================ */
.grounding-item.completed {
    border-color: var(--success) !important;
    background: var(--success-light) !important;
}

#breathing-circle {
    transition: transform 0.5s ease-in-out, background 0.5s ease-in-out;
}

.resource-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.resource-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.resource-btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.resource-btn-secondary:hover {
    background: var(--bg-secondary);
}

/* ============================================
   Language Switcher
   ============================================ */
.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.lang-btn {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.lang-btn:hover {
    color: var(--text-secondary);
}

.lang-btn.active {
    color: var(--text-primary);
    background: var(--accent-light);
}

.lang-separator {
    color: var(--border-color);
    font-weight: 300;
}

/* Language switcher in header */
.header-lang-switcher {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 20;
}

/* ============================================
   Improved Button States
   ============================================ */
button:disabled,
.btn:disabled,
[type="submit"]:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

button:disabled:hover,
.btn:disabled:hover,
[type="submit"]:disabled:hover {
    opacity: 0.5 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ============================================
   Accessibility Improvements
   ============================================ */
.modal-overlay[aria-hidden="false"] {
    display: flex;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Skip link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    padding: 8px;
    background: var(--accent-primary);
    color: white;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* ============================================
   DESIGN SYSTEM - Reusable Components
   Use these classes for cross-page consistency
   ============================================ */

/* Premium Card Component */
.mentta-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-xl);
    transition: all 0.4s var(--ease-lux);
}

.mentta-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    border-color: rgba(45, 58, 45, 0.1);
}

.mentta-card--elevated {
    box-shadow: var(--shadow-elevated);
}

/* Primary Button */
.mentta-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--accent-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-md);
    padding: 0.875rem 1.75rem;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s var(--ease-lux);
    text-decoration: none;
}

.mentta-btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

/* Secondary Button */
.mentta-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s var(--ease-lux);
    text-decoration: none;
}

.mentta-btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Ghost Button */
.mentta-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s var(--ease-lux);
}

.mentta-btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Section Headers */
.mentta-section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.mentta-section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
    display: block;
}

.mentta-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

.mentta-section-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Input Field */
.mentta-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.mentta-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(45, 58, 45, 0.1);
}

.mentta-input::placeholder {
    color: var(--text-tertiary);
}

/* Badge/Tag */
.mentta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--accent-light);
    color: var(--accent-primary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mentta-badge--success {
    background: var(--success-light);
    color: var(--success);
}

.mentta-badge--warning {
    background: var(--warning-light);
    color: #8b6914;
}

.mentta-badge--danger {
    background: var(--danger-light);
    color: var(--danger);
}

/* Glass Effect */
.mentta-glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .mentta-glass {
    background: rgba(45, 58, 45, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   MOBILE-FIRST RESPONSIVE UTILITIES
   These classes provide mobile-optimized defaults
   that can be overridden at larger breakpoints
   ============================================ */

/* Touch-Friendly Buttons */
.touch-target {
    min-height: var(--touch-target-min);
    min-width: var(--touch-target-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.touch-target-comfortable {
    min-height: var(--touch-target-comfortable);
    min-width: var(--touch-target-comfortable);
}

/* Mobile Form Inputs */
.mobile-input {
    width: 100%;
    min-height: var(--touch-target-comfortable);
    padding: 0.875rem 1rem;
    font-size: 16px;
    /* Prevents iOS zoom on focus */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.mobile-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(45, 58, 45, 0.1);
}

.mobile-input::placeholder {
    color: var(--text-tertiary);
}

/* Mobile Button Base */
.mobile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--touch-target-comfortable);
    padding: 0.875rem 1.5rem;
    font-size: var(--mobile-text-base);
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease-lux);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-btn:active {
    transform: scale(0.98);
}

/* Mobile Layout Utilities */
.mobile-container {
    width: 100%;
    padding-left: var(--mobile-padding-x);
    padding-right: var(--mobile-padding-x);
}

.mobile-section {
    padding-top: var(--mobile-section-gap);
    padding-bottom: var(--mobile-section-gap);
}

.mobile-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.mobile-hide {
    display: none;
}

/* Safe Area Insets for Notched Devices */
@supports (padding-top: env(safe-area-inset-top)) {
    .safe-area-top {
        padding-top: env(safe-area-inset-top);
    }

    .safe-area-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .safe-area-all {
        padding-top: env(safe-area-inset-top);
        padding-right: env(safe-area-inset-right);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
    }
}

/* ============================================
   RESPONSIVE MEDIA QUERIES
   Mobile-first approach: base styles are mobile,
   then progressively enhance for larger screens
   ============================================ */

/* Small Phones (375px+) */
@media (min-width: 375px) {
    :root {
        --mobile-padding-x: 1.25rem;
    }
}

/* Large Phones (480px+) */
@media (min-width: 480px) {
    :root {
        --mobile-padding-x: 1.5rem;
        --mobile-card-padding: 1.5rem;
    }

    .mobile-hide-sm {
        display: none;
    }

    .mobile-show-sm {
        display: block;
    }
}

/* Tablets (768px+) */
@media (min-width: 768px) {
    :root {
        --mobile-padding-x: 2rem;
        --mobile-section-gap: 2rem;
        --mobile-card-padding: 2rem;
    }

    .mobile-container {
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
    }

    .mobile-hide {
        display: block;
    }

    .tablet-hide {
        display: none;
    }

    .mobile-stack {
        flex-direction: row;
        flex-wrap: wrap;
    }

    /* Tablet Grid */
    .tablet-grid-2 {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }
}

/* Small Desktops (1024px+) */
@media (min-width: 1024px) {
    :root {
        --mobile-padding-x: 2.5rem;
        --mobile-section-gap: 3rem;
    }

    .mobile-container {
        max-width: 960px;
    }

    .desktop-grid-3 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-xl);
    }

    .desktop-grid-4 {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-xl);
    }
}

/* Large Desktops (1280px+) */
@media (min-width: 1280px) {
    .mobile-container {
        max-width: 1200px;
    }
}

/* ============================================
   MOBILE ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Prevent text selection on interactive elements */
.no-select {
    -webkit-user-select: none;
    user-select: none;
}

/* Smooth scrolling for mobile */
.smooth-scroll {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep functionality */
.scrollbar-hide {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Mobile Typography Responsive */
@media (max-width: 480px) {
    .mentta-section-title {
        font-size: var(--mobile-text-3xl);
    }

    .mentta-section-subtitle {
        font-size: var(--mobile-text-base);
    }

    .mentta-btn-primary,
    .mentta-btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Prevent horizontal overflow on mobile */
html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}