/**
 * Core Brand Tokens & Base Stylesheet
 * Brand: AFTAB SAQIB | Game-Based Assessments
 * Tagline: Think. Decide. Adapt. | Domain: assess.aftabsaqib.com
 */

:root {
    /* Brand Color Palette */
    --color-primary-navy:   #09182D;
    --color-secondary-navy: #17365D;
    --color-accent-blue:    #3185C8;
    --color-accent-hover:   #256CA6;
    --color-light-bg:       #F1F5F9;
    --color-surface-white:  #FFFFFF;
    --color-text-main:      #1E293B;
    --color-text-muted:     #64748B;
    --color-border-subtle:  #E2E8F0;
    --color-border-focus:   #3185C8;

    /* Semantic Status Colors */
    --color-success:        #10B981;
    --color-success-bg:     #ECFDF5;
    --color-warning:        #F59E0B;
    --color-warning-bg:     #FFFBEB;
    --color-danger:         #EF4444;
    --color-danger-bg:      #FEF2F2;
    --color-info:           #3B82F6;
    --color-info-bg:        #EFF6FF;

    /* Typography */
    --font-heading:         'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body:            'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Layout & Elevation */
    --shadow-sm:            0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-md:            0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg:            0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    --radius-sm:            6px;
    --radius-md:            10px;
    --radius-lg:            14px;
    --radius-full:          9999px;
    --transition-fast:      150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal:    250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-main);
    background-color: var(--color-light-bg);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-primary-navy);
    line-height: 1.25;
}

h1 { font-size: 2.25rem; letter-spacing: -0.025em; }
h2 { font-size: 1.75rem; letter-spacing: -0.02em; }
h3 { font-size: 1.35rem; letter-spacing: -0.015em; }
h4 { font-size: 1.15rem; }

p {
    margin-bottom: 1rem;
    color: var(--color-text-main);
}

p.lead {
    font-size: 1.125rem;
    color: var(--color-text-muted);
}

/* Brand Wordmark Component */
.brand-wordmark {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    line-height: 1.15;
}

.brand-wordmark .wordmark-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: 0.08em;
    color: var(--color-primary-navy);
    text-transform: uppercase;
}

.brand-wordmark .wordmark-product {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--color-accent-blue);
    text-transform: uppercase;
}

.brand-wordmark .wordmark-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--color-secondary-navy);
    color: var(--color-surface-white);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    margin-top: 2px;
}

/* Application Header */
.app-header {
    background-color: var(--color-surface-white);
    border-bottom: 1px solid var(--color-border-subtle);
    padding: 0.45rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-tagline {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-tagline .tagline-text {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--color-secondary-navy);
    text-transform: uppercase;
}

.header-tagline .domain-badge {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-decoration: none;
    border: 1px solid var(--color-border-subtle);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.header-tagline .domain-badge:hover {
    color: var(--color-accent-blue);
    border-color: var(--color-accent-blue);
}

/* Main Content Area */
.app-main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Application Footer */
.app-footer {
    background-color: var(--color-surface-white);
    border-top: 1px solid var(--color-border-subtle);
    padding: 1.25rem 0;
    margin-top: auto;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-brand {
    font-weight: 700;
    color: var(--color-primary-navy);
}

.footer-tagline {
    font-style: italic;
}

.footer-link {
    color: var(--color-accent-blue);
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.65rem 1.35rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    background-color: var(--color-accent-blue);
    color: var(--color-surface-white);
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    box-shadow: 0 2px 8px rgba(49, 133, 200, 0.35);
}

.btn-navy {
    background-color: var(--color-secondary-navy);
    color: var(--color-surface-white);
}

.btn-navy:hover {
    background-color: var(--color-primary-navy);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-secondary-navy);
    border-color: var(--color-border-subtle);
}

.btn-outline:hover {
    border-color: var(--color-secondary-navy);
    background-color: rgba(23, 54, 93, 0.04);
}

.btn-lg {
    font-size: 1.05rem;
    padding: 0.85rem 1.85rem;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Cards */
.card {
    background-color: var(--color-surface-white);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-secondary-navy);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    background-color: var(--color-surface-white);
    color: var(--color-text-main);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(49, 133, 200, 0.18);
}

/* Flash Alerts */
.flash-messages-container {
    margin-bottom: 1.5rem;
}

.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.alert-error {
    background-color: var(--color-danger-bg);
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.alert-success {
    background-color: var(--color-success-bg);
    color: #065F46;
    border: 1px solid #6EE7B7;
}

.alert-warning {
    background-color: var(--color-warning-bg);
    color: #92400E;
    border: 1px solid #FCD34D;
}

.alert-info {
    background-color: var(--color-info-bg);
    color: #1E40AF;
    border: 1px solid #93C5FD;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-draft { background-color: #E2E8F0; color: #475569; }
.badge-active { background-color: #D1FAE5; color: #065F46; }
.badge-paused { background-color: #FEF3C7; color: #92400E; }
.badge-closed { background-color: #F1F5F9; color: #64748B; }
.badge-invited { background-color: #DBEAFE; color: #1E40AF; }
.badge-in_progress { background-color: #FEF3C7; color: #92400E; }
.badge-completed { background-color: #D1FAE5; color: #065F46; }

/* Responsive Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Global Smooth Scrolling & Modern Sleek Scrollbars */
html {
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F1F5F9;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

body.theme-dark ::-webkit-scrollbar-track {
    background: #09182D;
}

body.theme-dark ::-webkit-scrollbar-thumb {
    background: #1E3A5F;
    border-radius: 4px;
}

body.theme-dark ::-webkit-scrollbar-thumb:hover {
    background: #3185C8;
}

@media (max-width: 768px) {
    .header-container { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
    .header-tagline { width: 100%; justify-content: space-between; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .footer-container { flex-direction: column; text-align: center; }
}

/* Unified Assessment Journey Stepper */
.step-indicator-unified {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 1.25rem;
    gap: 0.35rem;
    width: 100%;
}
.step-indicator-unified::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 2px;
    background-color: var(--color-border-subtle);
    z-index: 1;
    transform: translateY(-50%);
}
.step-indicator-unified.step-theme-dark::before {
    background-color: #1E3A5F;
}
.step-indicator-unified .step-item {
    position: relative;
    z-index: 2;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    transition: var(--transition-fast);
}
.step-indicator-unified.step-theme-light .step-item.pending {
    background: #FFFFFF;
    border: 1.5px solid var(--color-border-subtle);
    color: var(--color-text-muted);
}
.step-indicator-unified.step-theme-light .step-item.active {
    background: #FFFFFF;
    border: 2px solid var(--color-accent-blue);
    color: var(--color-primary-navy);
    box-shadow: 0 0 0 3px rgba(49, 133, 200, 0.15);
}
.step-indicator-unified.step-theme-light .step-item.completed {
    background: #FFFFFF;
    border: 1.5px solid var(--color-success);
    color: var(--color-success);
}
.step-indicator-unified.step-theme-dark .step-item.pending {
    background: #09182D;
    border: 1.5px solid #1E3A5F;
    color: #64748B;
}
.step-indicator-unified.step-theme-dark .step-item.active {
    background: #0E223D;
    border: 2px solid #38BDF8;
    color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}
.step-indicator-unified.step-theme-dark .step-item.completed {
    background: #09182D;
    border: 1.5px solid #10B981;
    color: #10B981;
}
.step-indicator-unified .step-num {
    font-weight: 700;
    font-size: 0.72rem;
}
@media (max-width: 768px) {
    .step-indicator-unified .step-lbl {
        display: none;
    }
}

/* Zero-Scroll Viewport Architecture */
.game-shell-viewport {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    box-sizing: border-box;
}

body.theme-dark {
    min-height: 100vh;
}
