/* ============================================
   HIM - Dashboard Styles & Dynamic Tab Navigator
   ============================================ */

.welcome-banner {
    display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary), var(--color-warning, #F59E0B));
    background-size: 300% 300%;
    animation: gradientWave 8s ease infinite;
    border-radius: var(--border-radius-lg, 24px); padding: 28px 36px;
    color: white; margin-bottom: 24px;
    box-shadow: var(--shadow-glow, 0 12px 36px rgba(255, 112, 150, 0.3));
    position: relative; overflow: hidden;
}
.welcome-banner::after {
    content: "";
    position: absolute; right: -40px; top: -40px; width: 180px; height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
}
.welcome-text h1 { color: white; font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.welcome-text p { opacity: 0.95; font-size: 15px; }
.welcome-date {
    text-align: center; background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    padding: 10px 18px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.3);
}
.welcome-date .day {
    display: block; font-family: var(--font-heading, sans-serif);
    font-size: 36px; font-weight: 900; line-height: 1; color: white;
}
.welcome-date .month { font-size: 13px; font-weight: 700; opacity: 0.95; color: white; }

/* ============================================
   Flagship Tab Deck & Page Navigator
   ============================================ */
.tab-deck-section {
    background: var(--bg-card, rgba(255, 255, 255, 0.95));
    border: 1.5px solid var(--border-light, rgba(255, 112, 150, 0.2));
    border-radius: var(--border-radius-lg, 24px);
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.06));
    backdrop-filter: blur(16px);
}

.tab-deck-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-deck-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 112, 150, 0.15), rgba(177, 156, 217, 0.2));
    color: var(--color-primary, #FF7096);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    border: 1px solid var(--border-light, rgba(255, 112, 150, 0.25));
}

.tab-deck-title-area h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary, #1e293b);
    margin-bottom: 4px;
}

.tab-deck-title-area p {
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    margin: 0;
}

.tab-deck-search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 280px;
}

.tab-deck-search i {
    position: absolute;
    left: 14px;
    color: var(--text-muted, #94a3b8);
    font-size: 14px;
    pointer-events: none;
}

.tab-deck-search input {
    width: 100%;
    padding: 10px 38px 10px 38px;
    border-radius: 14px;
    border: 1.5px solid var(--border-light, rgba(255, 112, 150, 0.2));
    background: var(--bg-body, #f8fafc);
    color: var(--text-primary, #1e293b);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
}

.tab-deck-search input:focus {
    border-color: var(--color-primary, #FF7096);
    box-shadow: 0 0 0 3px rgba(255, 112, 150, 0.15);
    background: var(--bg-card, #ffffff);
}

.tab-deck-search-clear {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
}
.tab-deck-search-clear:hover { color: var(--color-primary, #FF7096); }

/* Spotlight Hero Duo: Voice & Chat */
.tab-deck-spotlight-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.spotlight-card {
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.spotlight-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* Voice Spotlight */
.spotlight-voice {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.15));
    border: 2px solid rgba(16, 185, 129, 0.35);
}

/* Chat Spotlight */
.spotlight-chat {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.12), rgba(139, 92, 246, 0.15));
    border: 2px solid rgba(236, 72, 153, 0.35);
}

.spotlight-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    width: fit-content;
    margin-bottom: 14px;
}

.live-pulse-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.ai-sparkle-badge {
    background: rgba(236, 72, 153, 0.2);
    color: #BE185D;
    border: 1px solid rgba(236, 72, 153, 0.4);
}

.live-dot-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    display: inline-block;
    animation: livePulsate 1.5s infinite;
}

@keyframes livePulsate {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.2); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.spotlight-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.spotlight-icon-wrap {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.spotlight-text h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary, #1e293b);
    margin-bottom: 4px;
}

.spotlight-text p {
    font-size: 13px;
    color: var(--text-secondary, #475569);
    line-height: 1.5;
    margin: 0;
}

/* Dynamic Animated Sound Wave Bars */
.soundwave-container {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 28px;
    margin-bottom: 16px;
    padding: 0 4px;
}

.soundwave-bar {
    width: 6px;
    border-radius: 4px;
    background: #10B981;
    animation: waveBounce 1.2s ease-in-out infinite alternate;
}

.soundwave-bar.bar-1 { height: 8px; animation-delay: 0.1s; }
.soundwave-bar.bar-2 { height: 16px; animation-delay: 0.3s; }
.soundwave-bar.bar-3 { height: 26px; animation-delay: 0.15s; }
.soundwave-bar.bar-4 { height: 12px; animation-delay: 0.45s; }
.soundwave-bar.bar-5 { height: 22px; animation-delay: 0.25s; }
.soundwave-bar.bar-6 { height: 18px; animation-delay: 0.5s; }
.soundwave-bar.bar-7 { height: 10px; animation-delay: 0.2s; }
.soundwave-bar.bar-8 { height: 20px; animation-delay: 0.35s; }

@keyframes waveBounce {
    0% { height: 6px; opacity: 0.4; }
    100% { height: 26px; opacity: 1; }
}

/* Chat Preview Bubbles */
.chat-preview-bubbles {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.chat-mini-bubble {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    max-width: 90%;
}

.bubble-him {
    background: rgba(236, 72, 153, 0.15);
    color: var(--text-primary, #1e293b);
    font-weight: 600;
    align-self: flex-start;
    border: 1px solid rgba(236, 72, 153, 0.25);
}

.bubble-him i { color: #EC4899; margin-right: 4px; }

.bubble-user {
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-secondary, #475569);
    align-self: flex-end;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.spotlight-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.spotlight-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    color: white;
    transition: all 0.2s ease;
}

.btn-voice-glow {
    background: linear-gradient(135deg, #10B981, #059669);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.btn-voice-glow:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    transform: scale(1.02);
}

.btn-chat-glow {
    background: linear-gradient(135deg, #EC4899, #8B5CF6);
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
}
.btn-chat-glow:hover {
    background: linear-gradient(135deg, #DB2777, #7C3AED);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
    transform: scale(1.02);
}

.spotlight-hint {
    font-size: 11px;
    color: var(--text-muted, #64748b);
    font-weight: 600;
}

/* Tab Pill Switcher Bar */
.tab-pill-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 1.5px solid var(--border-light, rgba(255, 112, 150, 0.15));
    scrollbar-width: thin;
}

.tab-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 20px;
    border: 1.5px solid var(--border-light, rgba(255, 112, 150, 0.2));
    background: var(--bg-card, #ffffff);
    color: var(--text-secondary, #64748b);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-pill-btn:hover {
    background: var(--color-primary-light, #FFF0F5);
    color: var(--color-primary, #FF7096);
    border-color: var(--color-primary, #FF7096);
    transform: translateY(-1px);
}

.tab-pill-btn.active {
    background: var(--color-primary, #FF7096);
    color: white;
    border-color: var(--color-primary, #FF7096);
    box-shadow: 0 4px 14px rgba(255, 112, 150, 0.35);
}
.tab-pill-btn.active i { color: white; }

/* Dynamic Cards Grid */
.tab-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.tab-feature-card {
    background: var(--bg-card, #ffffff);
    border: 1.5px solid var(--border-light, rgba(255, 112, 150, 0.15));
    border-radius: 18px;
    padding: 18px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.tab-feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary, #FF7096);
    box-shadow: 0 10px 24px rgba(255, 112, 150, 0.18);
}

.tab-feature-card.flagship-item {
    border-width: 2px;
    border-color: rgba(255, 112, 150, 0.4);
    background: linear-gradient(180deg, var(--bg-card, #ffffff), rgba(255, 112, 150, 0.04));
}

.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.feat-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.feat-badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 12px;
}

.badge-live { background: rgba(16, 185, 129, 0.15); color: #047857; }
.badge-ai { background: rgba(236, 72, 153, 0.15); color: #BE185D; }
.badge-hot { background: rgba(245, 158, 11, 0.15); color: #B45309; }
.badge-new { background: rgba(99, 102, 241, 0.15); color: #4338CA; }

.card-body-area h4 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary, #1e293b);
    margin-bottom: 6px;
}

.card-body-area p {
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    line-height: 1.45;
    margin: 0 0 12px 0;
}

.card-footer-row {
    padding-top: 8px;
    border-top: 1px solid var(--border-light, rgba(255, 112, 150, 0.1));
}

.card-go-text {
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.2s ease;
}

.tab-feature-card:hover .card-go-text {
    transform: translateX(4px);
}

.tab-deck-empty {
    text-align: center;
    padding: 36px 20px;
    color: var(--text-muted, #94a3b8);
}
.tab-deck-empty i { font-size: 36px; margin-bottom: 12px; }

/* ============================================
   Stats Grid
   ============================================ */
.stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card, rgba(255, 255, 255, 0.95));
    border-radius: var(--border-radius-lg, 20px);
    padding: 20px;
    border: 1.5px solid var(--border-light, rgba(255, 112, 150, 0.15));
    display: flex; align-items: center; gap: 14px;
    transition: var(--transition-fast, 0.2s);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm, 0 4px 12px rgba(0, 0, 0, 0.04));
    cursor: pointer;
}
.stat-card:hover { box-shadow: var(--shadow-glow, 0 8px 24px rgba(255, 112, 150, 0.2)); transform: translateY(-4px); }
.stat-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.stat-info h3 { font-size: 18px; font-weight: 800; margin-bottom: 2px; color: var(--text-primary, #1e293b); }
.stat-info p { font-size: 12px; color: var(--text-secondary, #64748b); line-height: 1.35; margin: 0; }
.stat-info small { color: var(--text-muted, #94a3b8); font-weight: 600; }
.phase-card { border-left: 4px solid var(--phase-color); }

/* ============================================
   Dashboard Grid & High-Contrast Action Buttons
   ============================================ */
.dashboard-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.deck-card {
    background: var(--bg-card, rgba(255, 255, 255, 0.95));
    border: 1.5px solid var(--border-light, rgba(255, 112, 150, 0.15));
    border-radius: var(--border-radius-lg, 20px);
    padding: 24px;
    box-shadow: var(--shadow-sm, 0 4px 12px rgba(0, 0, 0, 0.04));
}
.card-title {
    font-size: 17px; font-weight: 800; margin-bottom: 16px;
    color: var(--text-primary, #1e293b);
    padding-bottom: 12px; border-bottom: 1px solid var(--border-light, rgba(255, 112, 150, 0.15));
    display: flex; align-items: center;
}

/* Quick Actions - HIGH CONTRAST & THEME PROOF */
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.action-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 16px 12px; border-radius: var(--border-radius-lg, 24px); aspect-ratio: 1 / 1;
    font-weight: 800; font-size: 14px; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    position: relative; overflow: hidden; text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); text-align: center;
}
.action-btn:hover { transform: translateY(-4px) scale(1.04); }
.action-btn:active { transform: translateY(2px) scale(0.93); transition: transform 0.1s; }
.action-btn i { font-size: 28px; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.action-btn:hover i { transform: scale(1.2) rotate(6deg); }

/* Theme-proof Action Colors */
.action-voice {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.18));
    border: 2px solid #10B981;
    color: #047857;
}
.action-voice i { color: #059669; }
.action-voice:hover {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white; border-color: #059669;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}
.action-voice:hover i { color: white; }

.action-chat {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(139, 92, 246, 0.18));
    border: 2px solid #EC4899;
    color: #BE185D;
}
.action-chat i { color: #EC4899; }
.action-chat:hover {
    background: linear-gradient(135deg, #EC4899, #8B5CF6);
    color: white; border-color: #EC4899;
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.4);
}
.action-chat:hover i { color: white; }

.action-period {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(251, 113, 133, 0.18));
    border: 2px solid #EF4444;
    color: #B91C1C;
}
.action-period i { color: #EF4444; }
.action-period:hover {
    background: linear-gradient(135deg, #EF4444, #F43F5E);
    color: white; border-color: #EF4444;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}
.action-period:hover i { color: white; }

.action-mood {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(249, 115, 22, 0.18));
    border: 2px solid #F59E0B;
    color: #B45309;
}
.action-mood i { color: #D97706; }
.action-mood:hover {
    background: linear-gradient(135deg, #F59E0B, #F97316);
    color: white; border-color: #F59E0B;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}
.action-mood:hover i { color: white; }

.action-badge-pulse, .action-badge-ai {
    position: absolute; top: 6px; right: 8px;
    font-size: 9px; font-weight: 900;
    padding: 2px 6px; border-radius: 8px;
}
.action-badge-pulse { background: #10B981; color: white; }
.action-badge-ai { background: #EC4899; color: white; }

/* Mood Chips - High Contrast & Theme Proof */
.mood-selector {
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center;
}
.mood-chip-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: 30px;
    border: 2px solid var(--border-light, rgba(255, 112, 150, 0.25));
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #1e293b);
    font-size: 14px; font-weight: 700;
    cursor: pointer; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}
.mood-chip-btn:hover {
    background: var(--color-primary, #FF7096);
    color: white; border-color: var(--color-primary, #FF7096);
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 8px 16px rgba(255, 112, 150, 0.35);
}
.mood-chip-btn:active {
    transform: translateY(2px) scale(0.92);
    transition: transform 0.1s;
}
.mood-chip-emoji { font-size: 16px; }
.mood-chip-label { font-weight: 700; }

.mood-logged {
    text-align: center; padding: 14px;
    background: rgba(255, 112, 150, 0.06);
    border-radius: 16px; border: 1px dashed var(--border-light, rgba(255, 112, 150, 0.3));
}
.mood-logged p { margin: 0 0 10px 0; font-size: 15px; color: var(--text-primary, #1e293b); }

/* Responsive Breakpoints */
@media (max-width: 1200px) {
    .tab-cards-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1023px) {
    .tab-deck-spotlight-grid { grid-template-columns: 1fr; }
    .tab-cards-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .tab-deck-section { padding: 18px; }
    .tab-deck-header { flex-direction: column; align-items: stretch; }
    .tab-deck-search { min-width: 100%; }
    .tab-cards-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .welcome-banner { flex-direction: column; text-align: center; gap: 14px; padding: 22px; }
    .welcome-text h1 { font-size: 22px; }
}
