/* =============================================================================
   MODE CARDS CSS — Premium Glassmorphism 2026
   ============================================================================= */

/* Collapse/expand container */
.mode-cards-wrapper.collapsed {
    display: none;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: scaleY(0);
    transform-origin: top;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}


.mode-cards-wrapper.expanded {
    display: block;
    opacity: 1;
    max-height: 2000px;
    overflow: visible;
    transform: scaleY(1);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10;
    margin-bottom: 16px;
}

/* ===== Toggle Button — Frosted Glass ===== */
/* ===================================================================
   LIGHT MODE (Default)
   =================================================================== */
.mode-cards-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(240, 245, 255, 0.3));
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #374151;
    /* Dark gray */
    font-weight: 600;
    font-size: 0.95rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mode-cards-toggle:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(230, 240, 255, 0.5));
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

.mode-cards-toggle.expanded {
    background: linear-gradient(135deg, rgba(235, 245, 255, 0.6), rgba(220, 230, 255, 0.4));
    border-color: rgba(100, 150, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.mode-cards-toggle.collapsed {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(245, 248, 255, 0.25));
}

.toggle-text {
    flex: 1;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
}

.toggle-icon {
    width: 14px;
    height: 14px;
    transition: transform 0.25s ease;
    opacity: 0.5;
}

.mode-cards-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

.mode-cards-wrapper {
    transition: all 0.3s ease;
}

/* ===== Model Cards — Frosted Glass ===== */
.mode-group-cards>div,
.mode-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(240, 244, 255, 0.6));
    border: 1px solid rgba(200, 210, 230, 0.5);
    border-radius: 14px;
    backdrop-filter: blur(14px) saturate(1.3);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    padding: 12px 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    cursor: pointer;
}

.mode-group-cards>div:hover,
.mode-card:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(245, 250, 255, 0.9));
    border-color: rgba(100, 150, 255, 0.4);
    box-shadow: 0 12px 24px rgba(100, 110, 130, 0.15), 0 4px 8px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

/* Selected card — soft glow ring */
.mode-group-cards>div.selected,
.mode-group-cards>div[data-selected="true"],
[data-mode].selected,
.mode-card.selected {
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.9), rgba(219, 234, 254, 0.8));
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5), 0 8px 16px rgba(59, 130, 246, 0.15);
    transform: scale(1.02);
}

/* Card title — high contrast */
.mode-group-cards>div h4,
.mode-card h4 {
    font-size: 1.05rem;
    margin-bottom: 6px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.01em;
}

/* Mode tags — frosted pills, readable */
.mode-group-cards>div .flex.flex-wrap span,
.mode-card .flex.flex-wrap span {
    font-size: 0.6rem;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(180, 190, 210, 0.35);
    color: #1e293b;
    backdrop-filter: blur(4px);
    font-weight: 600;
}


/* Info icon */
.mode-group-cards>div>span:last-child,
.mode-card>span:last-child {
    width: 18px;
    height: 18px;
    font-size: 9px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Group header */
.mode-group h4 {
    font-size: 0.7rem;
    opacity: 0.55;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.mode-group {
    margin-bottom: 14px;
}

/* ===================================================================
   DARK MODE — Deep frosted glass with color reflections
   =================================================================== */
/* ===================================================================
   DARK MODE — Deep frosted glass with color reflections
   =================================================================== */
.dark .mode-cards-toggle,
[data-theme="dark"] .mode-cards-toggle {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
    border-color: rgba(51, 65, 85, 0.8);
    color: #f8fafc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.dark .mode-cards-toggle:hover,
[data-theme="dark"] .mode-cards-toggle:hover {
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.8), rgba(30, 41, 59, 0.9));
    border-color: rgba(71, 85, 105, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dark .mode-cards-toggle.expanded,
[data-theme="dark"] .mode-cards-toggle.expanded {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
    border-color: rgba(99, 102, 241, 0.5);
    /* Indigo tint */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.dark .mode-group-cards>div,
[data-theme="dark"] .mode-group-cards>div,
.dark .mode-card,
[data-theme="dark"] .mode-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.6)) !important;
    border-color: rgba(71, 85, 105, 0.6) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

.dark .mode-group-cards>div h4,
[data-theme="dark"] .mode-group-cards>div h4,
.dark .mode-card h4,
[data-theme="dark"] .mode-card h4 {
    color: #f1f5f9 !important;
    /* Slate 50 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.dark .mode-group-cards>div:hover,
[data-theme="dark"] .mode-group-cards>div:hover,
.dark .mode-card:hover,
[data-theme="dark"] .mode-card:hover {
    background: linear-gradient(145deg, rgba(51, 65, 85, 0.8), rgba(30, 41, 59, 0.7)) !important;
    border-color: rgba(99, 102, 241, 0.5) !important;
    /* Indigo highlight */
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    transform: translateY(-2px) !important;
}

.dark .mode-group-cards>div.selected,
.dark .mode-group-cards>div[data-selected="true"],
.dark [data-mode].selected,
[data-theme="dark"] .mode-group-cards>div.selected,
[data-theme="dark"] .mode-group-cards>div[data-selected="true"],
[data-theme="dark"] [data-mode].selected,
.dark .mode-card.selected,
[data-theme="dark"] .mode-card.selected {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.8)) !important;
    border-color: rgba(99, 102, 241, 0.7) !important;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4), 0 4px 16px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.dark .mode-group-cards>div .flex.flex-wrap span,
[data-theme="dark"] .mode-group-cards>div .flex.flex-wrap span,
.dark .mode-card .flex.flex-wrap span,
[data-theme="dark"] .mode-card .flex.flex-wrap span {
    background: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(51, 65, 85, 0.5) !important;
    color: #e2e8f0 !important;
}

.dark .mode-group-cards>div>span:last-child,
[data-theme="dark"] .mode-group-cards>div>span:last-child,
.dark .mode-card>span:last-child,
[data-theme="dark"] .mode-card>span:last-child {
    background: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(51, 65, 85, 0.5) !important;
    color: #94a3b8;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .mode-cards-toggle {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 10px;
    }

    .toggle-text {
        font-size: 11px;
    }

    .mode-group-cards>div {
        padding: 10px 12px !important;
        border-radius: 12px !important;
    }

    .mode-group-cards>div h4 {
        font-size: 0.78rem !important;
    }
}

@media (min-width: 1024px) {
    .mode-cards-toggle {
        padding: 9px 16px;
        font-size: 14px;
    }

    .toggle-text {
        font-size: 13px;
    }
}