/*
 * Modern Glassmorphic Psychology Theme stylesheet
 * Colors: Primary: #2563EB, Secondary: #9333EA, Accent: #06B6D4
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #2563EB;
    --primary-rgb: 37, 99, 235;
    --secondary-color: #9333EA;
    --secondary-rgb: 147, 51, 234;
    --accent-color: #06B6D4;
    --accent-rgb: 6, 182, 212;
    
    /* Light Theme Variables */
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(255, 255, 255, 0.45);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --body-bg: #f8fafc;
    --glass-blur: 16px;
    --shadow-color: rgba(37, 99, 235, 0.08);
    --navbar-bg: rgba(255, 255, 255, 0.7);
    --border-subtle: rgba(226, 232, 240, 0.8);
    --btn-text-color: #ffffff;
}

body.dark-theme {
    /* Dark Theme Variables */
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    --card-bg: rgba(15, 23, 42, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --body-bg: #030712;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --navbar-bg: rgba(15, 23, 42, 0.7);
    --border-subtle: rgba(255, 255, 255, 0.05);
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--body-bg);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 1.25rem;
    box-shadow: 0 10px 30px -5px var(--shadow-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, background 0.4s ease, border-color 0.4s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px -5px rgba(var(--primary-rgb), 0.15);
}

/* Glass Header and Footer */
.glass-nav {
    background: var(--navbar-bg) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    transition: background 0.4s ease, border-color 0.4s ease;
}

/* Gradient Text and Backgrounds */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
}

.bg-gradient-accent {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%) !important;
}

/* Interactive Elements & Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    border: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -6px rgba(var(--primary-rgb), 0.5);
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #7e22ce 100%);
    border: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -6px rgba(var(--secondary-rgb), 0.5);
    background: linear-gradient(135deg, #7e22ce 0%, #6b21a8 100%);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Custom Navigation Hover Effect */
.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 80%;
}

/* Micro-animations */
.hover-scale {
    transition: transform 0.2s ease;
}
.hover-scale:hover {
    transform: scale(1.03);
}

.likert-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 1.5rem auto;
    padding: 0 16px;
    position: relative;
}

.likert-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    z-index: 1;
}

.likert-radio {
    appearance: none;
    -webkit-appearance: none;
    border-radius: 50%;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    border: 2px solid var(--text-secondary);
    background-color: var(--card-bg);
}

/* Size scaling based on agreement level (middle is neutral, outer are strong) */
.likert-option[data-weight="3"] .likert-radio { width: 32px; height: 32px; border-color: #ef4444; }
.likert-option[data-weight="2"] .likert-radio { width: 26px; height: 26px; border-color: #f97316; }
.likert-option[data-weight="1"] .likert-radio { width: 22px; height: 22px; border-color: #fbbf24; }
.likert-option[data-weight="0"] .likert-radio { width: 18px; height: 18px; border-color: var(--text-secondary); }
.likert-option[data-weight="-1"] .likert-radio { width: 22px; height: 22px; border-color: #34d399; }
.likert-option[data-weight="-2"] .likert-radio { width: 26px; height: 26px; border-color: #10b981; }
.likert-option[data-weight="-3"] .likert-radio { width: 32px; height: 32px; border-color: #059669; }

.likert-radio:checked {
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.25);
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.likert-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 500;
    max-width: 80px;
    text-align: center;
    line-height: 1.2;
    white-space: normal;
}

/* Custom Progress Bar */
.progress {
    height: 10px;
    background-color: var(--border-subtle);
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 5px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* IQ Test Custom Question Grid */
.iq-grid-item {
    border: 2px dashed var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: rgba(255, 255, 255, 0.02);
}

.iq-grid-item:hover, .iq-grid-item.selected {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
    transform: scale(1.02);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--body-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Theme Switcher Widget */
.theme-switch-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-switch-btn:hover {
    transform: rotate(15deg);
    background-color: rgba(var(--primary-rgb), 0.1);
}

/* Responsive Overrides */
@media (max-width: 991px) {
    .likert-mobile-labels {
        display: none !important; /* Hide header labels since rows have inline text */
    }
    
    .likert-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 0 8px;
    }
    
    .likert-option {
        flex-direction: row;
        align-items: center;
        width: 100%;
        padding: 10px 14px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--card-border);
        transition: all 0.2s ease;
    }
    
    .likert-option:hover {
        background: rgba(var(--primary-rgb), 0.05);
    }
    
    .likert-label {
        display: inline-block !important; /* Show inline labels on mobile */
        font-size: 0.85rem;
        margin-top: 0;
        margin-left: 12px;
        color: var(--text-primary);
        font-weight: 500;
        text-align: left;
        max-width: none;
    }
}

@media (min-width: 992px) {
    .likert-mobile-labels {
        display: none !important;
    }
}

/* Mobile-friendly Utilities */
.max-w-600 {
    max-width: 600px;
}

@media (max-width: 576px) {
    .glass-card {
        border-radius: 1rem;
        padding: 1.25rem !important;
    }
    
    .display-4 {
        font-size: 2.25rem !important;
        line-height: 1.2;
    }
    
    .display-5 {
        font-size: 1.85rem !important;
    }
    
    .display-6 {
        font-size: 1.6rem !important;
    }
    
    /* Ensure charts have enough space on mobile */
    canvas {
        max-width: 100% !important;
    }
}
