/* ========================================
   Training Feedback System v2.0.0
   Professional Design System
   ======================================== */

/* ========================================
   CSS Custom Properties - Theme System
   ======================================== */
:root {
    /* Primary Palette */
    --primary-50: #f0f0ff;
    --primary-100: #e0e0ff;
    --primary-200: #c7c7ff;
    --primary-300: #a5a5ff;
    --primary-400: #8b7cff;
    --primary-500: #7c5cfc;
    --primary-600: #6d3ef2;
    --primary-700: #5e30de;
    --primary-800: #4d28b5;
    --primary-900: #412493;

    /* Accent */
    --accent-400: #f472b6;
    --accent-500: #ec4899;
    --accent-600: #db2777;

    /* Surfaces */
    --bg-base: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.72);
    --bg-glass-strong: rgba(255, 255, 255, 0.88);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;

    /* Borders */
    --border-default: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-focus: var(--primary-500);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 40px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(124, 92, 252, 0.08);
    --shadow-card-hover: 0 20px 40px -5px rgba(124, 92, 252, 0.12), 0 8px 16px -4px rgba(124, 92, 252, 0.06);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #7c5cfc 0%, #6d3ef2 100%);
    --gradient-primary-hover: linear-gradient(135deg, #8b7cff 0%, #7c5cfc 100%);
    --gradient-surface: linear-gradient(180deg, #f1f5f9 0%, #e8edf5 100%);
    --gradient-card: linear-gradient(135deg, rgba(124, 92, 252, 0.03) 0%, rgba(236, 72, 153, 0.02) 100%);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;

    /* Blur */
    --blur-glass: 16px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Chart colors */
    --chart-1: rgba(124, 92, 252, 0.8);
    --chart-2: rgba(236, 72, 153, 0.8);
    --chart-3: rgba(59, 130, 246, 0.8);
    --chart-4: rgba(16, 185, 129, 0.8);
    --chart-5: rgba(251, 146, 60, 0.8);

    /* Layout */
    --content-max-width: 920px;
    --navbar-max-width: 1100px;
}

/* ========================================
   Dark Theme
   ======================================== */
.dark {
    --bg-base: #0b0f1a;
    --bg-surface: #131825;
    --bg-surface-hover: #1a2035;
    --bg-elevated: #1e2538;
    --bg-glass: rgba(19, 24, 37, 0.8);
    --bg-glass-strong: rgba(19, 24, 37, 0.92);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-inverse: #0f172a;

    --border-default: #1e293b;
    --border-hover: #334155;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 40px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(124, 92, 252, 0.15);
    --shadow-card-hover: 0 20px 40px -5px rgba(124, 92, 252, 0.2), 0 8px 16px -4px rgba(124, 92, 252, 0.1);

    --gradient-surface: linear-gradient(180deg, #0b0f1a 0%, #0f1320 100%);
    --gradient-card: linear-gradient(135deg, rgba(124, 92, 252, 0.06) 0%, rgba(236, 72, 153, 0.04) 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans Thai', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gradient-surface);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background var(--transition-slow), color var(--transition-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ========================================
   Layout Containers
   ======================================== */
.navbar-inner {
    max-width: var(--navbar-max-width);
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.main-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 28px 16px 40px;
}

.content-area {
    margin-top: 0;
}

.footer-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 32px 20px;
    text-align: center;
}

@media (min-width: 640px) {
    .navbar-inner {
        padding: 14px 28px;
    }

    .main-content {
        padding: 36px 24px 48px;
    }
}

@media (min-width: 1024px) {
    .main-content {
        padding: 40px 32px 60px;
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(124, 92, 252, 0.4);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(124, 92, 252, 0);
    }
}

@keyframes slideToast {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideToastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes progressShrink {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

@keyframes iconRotate {
    from {
        transform: rotate(0deg) scale(0.5);
        opacity: 0;
    }

    to {
        transform: rotate(360deg) scale(1);
        opacity: 1;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-out both;
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-fadeInDown {
    animation: fadeInDown 0.5s ease-out both;
}

.animate-slideInRight {
    animation: slideInRight 0.5s ease-out both;
}

.animate-slideInLeft {
    animation: slideInLeft 0.5s ease-out both;
}

.animate-scaleIn {
    animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-bounceIn {
    animation: bounceIn 0.6s ease-out both;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Staggered delays */
.delay-1 {
    animation-delay: 50ms;
}

.delay-2 {
    animation-delay: 100ms;
}

.delay-3 {
    animation-delay: 150ms;
}

.delay-4 {
    animation-delay: 200ms;
}

.delay-5 {
    animation-delay: 250ms;
}

.delay-6 {
    animation-delay: 300ms;
}

.delay-7 {
    animation-delay: 350ms;
}

/* ========================================
   Navbar
   ======================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border-bottom: 1px solid var(--border-default);
    transition: box-shadow var(--transition-normal), background var(--transition-normal);
}

.navbar.scrolled {
    box-shadow: var(--shadow-lg);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.navbar-logo {
    font-size: 1.75rem;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .navbar-logo {
        font-size: 2rem;
    }
}

.navbar-title {
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    line-height: 1.3;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .navbar-title {
        font-size: 1.25rem;
    }
}

.navbar-subtitle {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    display: none;
}

@media (min-width: 640px) {
    .navbar-subtitle {
        display: block;
    }
}

.navbar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .navbar-controls {
        gap: 12px;
    }
}

/* ========================================
   Theme Toggle
   ======================================== */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-400);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle .icon {
    font-size: 18px;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.theme-toggle .icon-enter {
    animation: iconRotate 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ========================================
   Tab Navigation
   ======================================== */
.tab-wrapper {
    margin-bottom: 24px;
}

@media (min-width: 640px) {
    .tab-wrapper {
        margin-bottom: 32px;
    }
}

.tab-nav {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    padding: 5px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-default);
    display: flex;
    gap: 3px;
    transition: background var(--transition-normal), border-color var(--transition-normal);
}

.tab-button {
    flex: 1;
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .tab-button {
        padding: 12px 24px;
        font-size: 14px;
        gap: 8px;
    }
}

.tab-icon {
    font-size: 16px;
}

.tab-label-full {
    display: none;
}

.tab-label-short {
    display: inline;
}

@media (min-width: 640px) {
    .tab-label-full {
        display: inline;
    }

    .tab-label-short {
        display: none;
    }
}

.tab-button:hover:not(.tab-active) {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}

.tab-button.tab-active {
    color: var(--text-inverse);
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px rgba(124, 92, 252, 0.3);
}

.dark .tab-button.tab-active {
    box-shadow: 0 4px 16px rgba(124, 92, 252, 0.4);
}

.tab-active::after {
    display: none;
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    padding: 20px;
}

@media (min-width: 640px) {
    .card {
        padding: 28px;
    }
}

@media (min-width: 768px) {
    .card {
        padding: 36px;
    }
}

.card-hover {
    transition: all var(--transition-normal);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--primary-200);
}

.dark .card-hover:hover {
    border-color: rgba(124, 92, 252, 0.3);
}

/* ========================================
   Stat Cards
   ======================================== */
.stat-card {
    border-radius: var(--radius-xl);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.9;
    animation: float 3s ease-in-out infinite;
}

.stat-value {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
}

@media (min-width: 640px) {
    .stat-card {
        padding: 24px;
    }

    .stat-icon {
        font-size: 2.5rem;
    }

    .stat-value {
        font-size: 2.25rem;
    }
}

/* ========================================
   Section Cards (Form groups)
   ======================================== */
.section-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 20px;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.section-card:hover {
    border-color: var(--primary-200);
    box-shadow: var(--shadow-glow);
}

.dark .section-card:hover {
    border-color: rgba(124, 92, 252, 0.3);
}

@media (min-width: 640px) {
    .section-card {
        padding: 28px;
    }
}

.section-title {
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-default);
    text-align: center;
}

@media (min-width: 640px) {
    .section-title {
        font-size: 1.15rem;
    }
}

/* ========================================
   Form Inputs
   ======================================== */
.form-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
}

@media (min-width: 640px) {
    .form-input {
        padding: 12px 16px;
        font-size: 15px;
    }
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input:hover {
    border-color: var(--border-hover);
}

.form-input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.12);
}

.dark .form-input:focus {
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.2);
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

@media (min-width: 640px) {
    .form-label {
        font-size: 14px;
        margin-bottom: 8px;
    }
}

/* ========================================
   Form Progress Bar
   ======================================== */
.form-progress {
    width: 100%;
    height: 6px;
    background: var(--border-default);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.form-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-progress-text {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 6px;
    text-align: right;
    font-weight: 500;
}

/* ========================================
   Rating Radio Buttons
   ======================================== */
.rating-radio {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-default);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    background: var(--bg-surface);
}

@media (min-width: 640px) {
    .rating-radio {
        width: 28px;
        height: 28px;
    }
}

.rating-radio:hover {
    border-color: var(--primary-400);
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(124, 92, 252, 0.08);
}

.rating-radio:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.15);
}

.rating-radio:checked {
    border-color: var(--primary-500);
    background: var(--gradient-primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.15);
    animation: bounceIn 0.3s ease-out;
}

.rating-radio:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

@media (min-width: 640px) {
    .rating-radio:checked::after {
        font-size: 14px;
    }
}

.rating-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: color var(--transition-fast);
    min-width: 1rem;
    text-align: center;
}

@media (min-width: 640px) {
    .rating-label {
        font-size: 14px;
    }
}

.rating-label:hover,
label:hover .rating-label {
    color: var(--primary-500);
}

/* ========================================
   Question Card
   ======================================== */
.question-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--border-default);
    transition: all var(--transition-fast);
}

.question-card:hover {
    border-color: var(--primary-200);
    box-shadow: var(--shadow-sm);
}

.dark .question-card:hover {
    border-color: rgba(124, 92, 252, 0.2);
}

@media (min-width: 640px) {
    .question-card {
        padding: 20px;
    }
}

/* ========================================
   Buttons
   ======================================== */
.btn-primary {
    position: relative;
    overflow: hidden;
    background: var(--gradient-primary);
    color: white;
    font-weight: 700;
    padding: 14px 36px;
    border-radius: var(--radius-xl);
    border: none;
    cursor: pointer;
    font-size: 15px;
    box-shadow: 0 4px 14px rgba(124, 92, 252, 0.3);
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--gradient-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 92, 252, 0.4);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::before {
    width: 400px;
    height: 400px;
}

@media (min-width: 640px) {
    .btn-primary {
        padding: 16px 44px;
        font-size: 16px;
    }
}

.btn-secondary {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary:active {
    transform: translateY(0);
}

@media (min-width: 640px) {
    .btn-secondary {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Action buttons (view/delete) */
.btn-action {
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-view {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.btn-view:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

/* ========================================
   Auto-save Button
   ======================================== */
.autosave-btn {
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}

.autosave-btn:hover {
    border-color: var(--primary-400);
    box-shadow: var(--shadow-md);
}

.autosave-btn.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-color: transparent;
}

@media (min-width: 640px) {
    .autosave-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* ========================================
   Data Table
   ======================================== */
.table-responsive {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    overflow: hidden;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead {
    background: var(--gradient-primary);
}

.data-table thead th {
    color: white;
    font-weight: 600;
    font-size: 12px;
    padding: 14px 12px;
    text-align: left;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .data-table thead th {
        font-size: 13px;
        padding: 16px;
    }
}

.data-table tbody tr {
    transition: background var(--transition-fast);
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.data-table tbody tr:hover {
    background: var(--bg-surface-hover);
}

.data-table tbody td {
    padding: 12px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-default);
}

@media (min-width: 640px) {
    .data-table tbody td {
        padding: 14px 16px;
        font-size: 14px;
    }
}

/* Row stagger */
.data-table tbody tr:nth-child(1) {
    animation-delay: 0ms;
}

.data-table tbody tr:nth-child(2) {
    animation-delay: 40ms;
}

.data-table tbody tr:nth-child(3) {
    animation-delay: 80ms;
}

.data-table tbody tr:nth-child(4) {
    animation-delay: 120ms;
}

.data-table tbody tr:nth-child(5) {
    animation-delay: 160ms;
}

.data-table tbody tr:nth-child(6) {
    animation-delay: 200ms;
}

.data-table tbody tr:nth-child(7) {
    animation-delay: 240ms;
}

.data-table tbody tr:nth-child(8) {
    animation-delay: 280ms;
}

/* ========================================
   Score Badges
   ======================================== */
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: -0.01em;
    min-width: 3.2rem;
}

.score-excellent {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.dark .score-excellent {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.score-good {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

.dark .score-good {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.score-average {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.dark .score-average {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.score-poor {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.dark .score-poor {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.7;
    animation: float 3s ease-in-out infinite;
}

.empty-state-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* ========================================
   Toast Notifications
   ======================================== */
#toastContainer {
    position: fixed;
    top: 80px;
    right: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    width: calc(100% - 32px);
}

@media (min-width: 640px) {
    #toastContainer {
        right: 24px;
        width: auto;
        min-width: 320px;
    }
}

.toast {
    border-radius: var(--radius-lg);
    color: white;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: slideToast 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.toast-exit {
    animation: slideToastOut 0.3s ease-in both;
}

.toast-body {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
}

.toast-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.35);
    animation: progressShrink 3s linear forwards;
}

/* ========================================
   Modal
   ======================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease both;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (min-width: 640px) {
    .modal-content {
        padding: 32px;
    }
}

.modal-section {
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-default);
}

/* ========================================
   Chart Card & Title
   ======================================== */
.chart-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.chart-card:hover {
    box-shadow: var(--shadow-lg);
}

@media (min-width: 640px) {
    .chart-card {
        padding: 28px;
    }
}

.chart-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-default);
    text-align: center;
}

@media (min-width: 640px) {
    .chart-title {
        font-size: 1.1rem;
    }
}

/* ========================================
   Scroll-to-Top Button
   ======================================== */
.scroll-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 90;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(124, 92, 252, 0.4);
    transform: scale(0) translateY(20px);
    opacity: 0;
    transition: all var(--transition-normal);
}

.scroll-top-btn.visible {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.scroll-top-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 92, 252, 0.5);
}

.scroll-top-btn:active {
    transform: scale(0.95);
}

/* ========================================
   Footer
   ======================================== */
.app-footer {
    border-top: 1px solid var(--border-default);
    background: var(--bg-surface);
    margin-top: 20px;
}

.footer-version {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-bottom: 4px;
}

.footer-dev {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.footer-dev a {
    color: var(--primary-500);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.footer-dev a:hover {
    color: var(--primary-400);
    text-decoration: underline;
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 8px;
}

/* ========================================
   Autosave Indicator
   ======================================== */
.autosave-indicator {
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    z-index: 60;
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    animation: slideInRight 0.3s ease;
}

.autosave-indicator.show {
    display: flex;
}

/* ========================================
   Utility
   ======================================== */
.hidden {
    display: none !important;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Transition helper for theme switch */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
    transition-duration: 500ms !important;
}

/* ========================================
   Spinner
   ======================================== */
.spinner {
    border: 3px solid var(--border-default);
    border-top: 3px solid var(--primary-500);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}