/* Updated version: 1.0.5 */
:root{
  --ink:#0e1b3d; --muted:#5c6b8a; --bg:#fafbff; --card:#fff; --line:#e9ecf8;
  --pri:#5C7CFA; --pri-600:#4a6ef2; --ring:#6c8bff; --ok:#60CF8A;
}

/* Hide AI Coach and Saved tabs from dashboard */
.dashboard-tabs .tab-link[data-tab="tab-ai"],
.dashboard-tabs .tab-link[data-tab="tab-saved"] {
    display: none !important;
}

/* === HEADER & BRANDING ENHANCEMENTS === */

/* Header container with improved spacing and visual weight */
.dashboard-header {
    padding: 40px 0 36px;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    margin-bottom: 48px;
    background: linear-gradient(135deg, rgba(76, 99, 210, 0.01) 0%, rgba(118, 75, 162, 0.01) 100%);
}

/* Site branding with enhanced visual effects */
.site-branding {
    display: flex;
    align-items: center;
    gap: 28px;
    justify-content: center;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

/* Logo with improved proportions and subtle hover animation */
.site-logo {
    max-height: 65px;
    width: auto;
    height: auto;
    max-width: 100%;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.site-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.18));
}

/* Site title with improved typography and gradient underline */
.site-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.2;
    position: relative;
    padding-bottom: 8px;
    letter-spacing: -0.01em;
}

.site-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #4c63d2 0%, #667eea 50%, #764ba2 100%);
    border-radius: 2px;
    opacity: 0.7;
    animation: sparkle 4s ease-in-out infinite;
    box-shadow: 0 1px 3px rgba(76, 99, 210, 0.2);
}

/* Animated spark/flare effect */
@keyframes sparkle {
    0%, 100% {
        opacity: 0.6;
        transform: scaleX(1);
    }
    50% {
        opacity: 1;
        transform: scaleX(1.1);
    }
}

/* Add a subtle discovery-themed icon animation */
.site-branding::before {
    content: '✨';
    position: absolute;
    right: -45px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.3));
}

@keyframes float {
    0%, 100% {
        transform: translateY(-50%) rotate(0deg);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-60%) rotate(10deg);
        opacity: 0.9;
    }
}

/* === GREETING SECTION ENHANCEMENTS === */

/* Hero greeting container with improved spacing */
.quiz-dashboard-hero-greeting {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

/* Enhanced greeting title with better typography */
.greeting-title {
    font-size: 2.1rem;
    line-height: 1.3;
    color: #1a202c;
    margin: 0 0 20px 0;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Make the name part bold using a span */
.greeting-title .name-emphasis {
    font-weight: 800;
    color: #4c63d2;
    background: linear-gradient(135deg, #4c63d2 0%, #667eea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

/* Enhanced subtitle styling with better hierarchy */
.greeting-subtitle {
    font-size: 1.2rem;
    color: #64748b;
    font-style: italic;
    line-height: 1.6;
    margin: 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

/* === MAIN CONTAINER (WELCOME) === */
.sosd-wrap{max-width:1040px;margin:32px auto;padding:0 24px;background:transparent}
.hero{background:var(--card);border:1px solid var(--line);border-radius:16px;box-shadow:0 8px 24px rgba(20,30,70,.08);padding:28px;margin-bottom:48px}
.hero__text h1{color:var(--ink);font-size:32px;line-height:38px;margin:0 0 8px;font-weight:500}
.hero__text p{color:var(--muted);font-size:16px;line-height:24px;margin:0 0 16px}
.hero__ctas{display:flex;gap:10px;flex-wrap:wrap}
.hero__ctas .btn{white-space:nowrap}
@media (max-width:520px){
  .hero__ctas{flex-direction:column}
  .hero__ctas .btn{width:100%; justify-content:center}
}
.cta-bottom{justify-content:center;margin:16px 0 0}
.btn{display:inline-flex;align-items:center;gap:8px;border-radius:12px;padding:10px 14px;text-decoration:none;transition:.2s;font-weight:500}
.btn--primary{background:var(--pri);color:#fff}
.btn--primary:hover{background:var(--pri-600); color:#fff}
.btn--ghost{border:1px solid var(--line);color:var(--ink);background:#fff}

.intro-blurb{max-width:820px;margin:0 auto 24px;padding:0 4px}
.intro-blurb p{color:var(--muted);font-size:16px;line-height:24px;margin:0 0 12px}
.intro-heading{font-size:24px;line-height:32px;color:var(--ink);margin:8px 0 8px;font-weight:600;text-align:center;position:relative}
.intro-heading::after{content:"";display:block;height:3px;width:200px;margin:8px auto 0;background:linear-gradient(90deg,#4c63d2 0%,#667eea 50%,#764ba2 100%);border-radius:2px;box-shadow:0 1px 3px rgba(76,99,210,.2)}

/* Main column card + subcards (logged-out welcome) */
.sosd-column-card{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 8px 24px rgba(20,30,70,.08);padding:28px;margin-bottom:48px}
.sosd-subcard{background:#fff;border:1px solid #e9ecf8;border-radius:12px;padding:18px;margin:16px 0}
.sosd-subcard .step{border-bottom:none;padding:0}
.sosd-subcard .step__icon svg{max-height:64px}
.sosd-subcard .lab-card{box-shadow:none;border:1px solid var(--line)}
.sosd-subcard .exp-card{border-color:#e9ecf8}
.flow{display:flex;flex-direction:column;gap:48px}
.step{display:grid;grid-template-columns:80px 1fr;align-items:flex-start;gap:16px;padding:0 0 24px;border-bottom:1px solid #eef0f6}
.step:last-child{border-bottom:none}
.step__icon{display:flex;align-items:center;justify-content:center;min-height:72px;min-width:72px}
.step__icon svg{display:block;max-height:72px;width:64px;height:auto}
.step__body h2{color:var(--ink);font-size:20px;line-height:28px;margin:0 0 4px;font-weight:600}
.step__body .sub{color:var(--muted);margin:0 0 16px}
/* Small step label */
.step-kicker{font-size:12px;line-height:18px;color:#6366f1;background:#eef2ff;border:1px solid #c7d2fe;display:inline-block;border-radius:999px;padding:2px 8px;margin:0 0 6px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}

.cards{display:grid;gap:12px}
.card{display:flex;align-items:center;justify-content:space-between;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:16px 18px;transition:.15s;box-shadow:0 1px 0 rgba(20,30,70,.02)}
.sosd-wrap .card{min-height:72px}
.card:hover{box-shadow:0 8px 24px rgba(20,30,70,.08);outline:1px solid var(--line)}
.card__left{display:flex;gap:12px;align-items:center}
.card__icon{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#eef2ff;color:#4f46e5;font-weight:700;font-size:14px;border:1px solid #c7d2fe}
.card__title{font-weight:600;color:var(--ink)}
.card__sub{color:var(--muted);font-size:14px;line-height:20px}
.badge{font-size:13px;line-height:18px;background:#f3f5ff;border:1px solid var(--line);padding:4px 8px;border-radius:999px;color:var(--muted);font-weight:500}
.lab-queue{display:grid;gap:8px;margin:8px 0 12px}
.lab-queue .row{display:flex;justify-content:space-between;background:#fff;border:1px dashed var(--line);border-radius:10px;padding:10px 12px}
@media (max-width:720px){
  .step{grid-template-columns:1fr; text-align:left}
  .step__icon{justify-self:center; margin-bottom:8px; min-height:56px; min-width:56px}
  .step__icon svg{max-height:56px; width:56px; height:auto}
  .step__body{ text-align:center }
  .step__body .step-kicker{ margin-left:auto; margin-right:auto }
}

.mc-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 2px 6px rgba(16,24,40,0.06); padding: 24px 28px; }

.mc-card .mc-card-title {
    margin: 0 0 6px 0;
    font-size: 1.4rem;
    color: #1f2937;
}

.mc-card .mc-card-subtitle {
    margin: 0 0 12px 0;
    color: #64748b;
}

.mc-step-label {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #6366f1;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    padding: 2px 8px;
    border-radius: 9999px;
    margin-bottom: 8px;
}

/* Funnel inside a card should fill width */
.mc-card .mc-funnel-container { max-width: 100%; margin: 0; padding: 0; }
.mc-card .mc-funnel { gap: 6px; }

/* Inline flow graphic tweaks */
.mc-flow { display:flex; align-items:center; gap:24px; justify-content:center; }
.mc-flow-step { display:flex; align-items:center; gap:14px; }
.mc-flow-label { font-weight:600; color:#1f2937; }
.mc-flow svg { width: 110px; height: 130px; }
.mc-flow .arrow { width: 36px; height: 36px; }
@media (max-width: 700px) {
  .mc-flow { flex-direction:column; }
  .mc-flow svg{ width:88px; height:104px; }
}

/* Tablet responsiveness */
@media (max-width: 1024px) {
    .dashboard-header {
        padding: 36px 0 32px;
        margin-bottom: 40px;
    }
    
    .site-branding {
        padding: 0 24px;
        gap: 24px;
    }
    
    .site-title { font-size: 1.9rem; }
    
    .greeting-title {
        font-size: 1.9rem;
    }
    
    .greeting-subtitle {
        font-size: 1.1rem;
    }
}

/* Mobile responsiveness for header */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 28px 0 24px;
        margin-bottom: 36px;
    }
    
    .site-branding {
        flex-direction: column;
        gap: 20px;
        padding: 0 20px;
    }
    
    .site-branding::before {
        display: none; /* Hide sparkle on mobile for cleaner look */
    }
    
    .site-logo {
        max-height: 55px;
    }
    
    .site-title { font-size: 1.7rem; text-align: center; }
    
    .quiz-dashboard-hero-greeting {
        margin-bottom: 2.5rem;
        padding: 0 20px;
    }
    
    .greeting-title {
        font-size: 1.7rem;
        margin-bottom: 16px;
    }
    
    .greeting-subtitle {
        font-size: 1rem;
        max-width: 500px;
    }
}

/* === DASHBOARD TABS STYLING === */
/* Dashboard tab navigation container */
.dashboard-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 24px 24px 36px 24px;
    margin: 0 auto;
    max-width: 1200px;
    flex-wrap: wrap;
    overflow: visible;
}

/* Individual tab button styling */
.dashboard-tabs .tab-link {
    background: #f8fafc;
    color: #64748b;
    border: 2px solid #e2e8f0;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    min-height: 48px;
}

/* Active tab styling */
.dashboard-tabs .tab-link.active {
    background: linear-gradient(135deg, #4c63d2 0%, #667eea 100%);
    color: white;
    border-color: #4c63d2;
    box-shadow: 0 4px 12px rgba(76, 99, 210, 0.3);
    transform: translateY(-2px);
}

/* Tab hover effect */
.dashboard-tabs .tab-link:hover:not(.active) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Tab focus state for accessibility */
.dashboard-tabs .tab-link:focus {
    outline: 2px solid #4c63d2;
    outline-offset: 2px;
}

/* Responsive adjustments for tabs */
@media (max-width: 768px) {
    .dashboard-tabs {
        gap: 8px;
        padding: 16px 20px 24px 20px;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        position: static !important;
        top: auto !important;
        z-index: auto !important;
    }
    
    .dashboard-tabs .tab-link {
        padding: 10px 16px;
        font-size: 0.9rem;
        white-space: nowrap;
        min-width: fit-content;
    }
}

@media (max-width: 480px) {
    .dashboard-tabs .tab-link {
        padding: 8px 12px;
        font-size: 0.85rem;
        gap: 6px;
    }
}

/* === TAB CONTENT ISOLATION === */
/* Ensure proper tab content display/hiding */
.tab-content {
    display: none;
    position: relative;
    z-index: 1;
    padding-top: 32px;
}

/* Special case: Lab Mode and Self-Discovery Profile tabs don't need extra padding */
#tab-lab.tab-content,
#tab-composite.tab-content {
    padding-top: 0;
}

.tab-content.active {
    display: block;
}

/* Ensure AI Coach content is completely hidden when not active */
#tab-ai:not(.active) {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
}

/* Specifically hide AI filters when not in AI Coach tab */
#tab-ai:not(.active) .ai-filters,
#tab-ai:not(.active) .ai-banner,
#tab-ai:not(.active) .ai-results-grid {
    display: none !important;
    visibility: hidden !important;
}

/* Ensure Lab Mode content is properly isolated */
#tab-lab.active ~ #tab-ai .ai-filters {
    display: none !important;
}

/* Lab Mode should have full container control when active */
body:has(#tab-lab.active) #tab-ai {
    display: none !important;
}

/* Fallback for browsers that don't support :has() */
.tab-lab-active #tab-ai {
    display: none !important;
}

/* Enhanced Profile-Only Mode Styles */
/* Only hide tabs in enhanced mode if Lab Mode isn't available */
.mc-enhanced-profile-only .dashboard-tabs {
    display: none !important;
}

/* Override: Show tabs when Lab Mode is available, even in enhanced mode */
.mc-enhanced-profile-only .dashboard-tabs:has([data-tab="tab-lab"]) {
    display: flex !important;
}

/* Fallback for browsers that don't support :has() */
@supports not (selector(:has(*))) {
    .mc-enhanced-profile-only.has-lab-mode .dashboard-tabs {
        display: flex !important;
    }
}

.mc-enhanced-profile-only .tab-content-wrapper {
    border-top: none !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Hide dashboard overview sections in enhanced mode */
.mc-enhanced-profile-only .quiz-dashboard-hero {
    display: none !important;
}

.mc-enhanced-profile-only .quiz-dashboard-section-title,
.mc-enhanced-profile-only .quiz-dashboard-lower-grid,
.mc-enhanced-profile-only .quiz-dashboard-resources {
    display: none !important;
}

/* AI Coach Preview Section */
.mc-ai-coach-preview {
    background: 
        linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.15) 100%),
        linear-gradient(135deg, #4c63d2 0%, #5a4fcf 100%);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    color: white;
    box-shadow: 0 4px 20px rgba(76, 99, 210, 0.4);
    position: relative;
}

.mc-ai-preview-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mc-ai-preview-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

/* Alternative: CSS-based icon instead of emoji
.mc-ai-preview-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    position: relative;
}

.mc-ai-preview-icon::before {
    content: "⚡";
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.3));
}
*/

.mc-ai-preview-text {
    flex: 1;
}

.mc-ai-preview-text h3 {
    margin: 0 0 8px 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mc-ai-preview-text p {
    margin: 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.mc-ai-preview-arrow {
    font-size: 1.5rem;
    opacity: 0.7;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

/* Alternative: Floating AI Coach Hint (uncomment to use instead of full preview) */
/*
.mc-ai-coach-preview {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #667eea;
    color: white;
    padding: 12px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
*/

/* Mobile adjustments for preview */
@media (max-width: 768px) {
    .mc-ai-preview-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .mc-ai-preview-arrow {
        order: 3;
    }
}

/* Try Your AI Coach Button */
#mc-try-coach-btn {
    margin: 2rem auto 0;
    display: block;
    font-size: 1.2rem;
    padding: 12px 24px;
    background-color: #007cba;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#mc-try-coach-btn:hover {
    background-color: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#mc-try-coach-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Fade-in animation for newly revealed tabs */
.fade-in {
    animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
        transform: translateY(10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from { 
        opacity: 1;
        transform: translateY(0);
    }
    to { 
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #mc-try-coach-btn {
        font-size: 1rem;
        padding: 10px 20px;
        margin: 1.5rem auto 0;
    }
}
