/* =================================
   MINIMALIST DARK CALL CENTER DASHBOARD
   Modern Design with Animations & Glass Effects
   ================================= */

/* Import Modern Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600;700;800;900&display=swap');

/* CSS Variables - Dark Theme Primary */
:root {
    /* Core Colors */
    --primary-bg: #0a0a0a;
    --secondary-bg: #111111;
    --surface-bg: #1a1a1a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.08);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #a0a0a0;
    --text-dim: #666666;

    /* Accent Color */
    --accent-primary: #00ff88;
    --accent-secondary: #6c63ff;
    --accent-danger: #ff4757;
    --accent-warning: #ffa502;
    --accent-success: #2ed573;

    /* Borders & Dividers */
    --border-color: rgba(255, 255, 255, 0.15);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --divider-color: rgba(255, 255, 255, 0.1);

    /* Shadows & Glows */
    --shadow-small: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-large: 0 16px 64px rgba(0, 0, 0, 0.5);
    --glow-accent: 0 0 20px rgba(0, 255, 136, 0.3);
    --glow-hover: 0 0 30px rgba(0, 255, 136, 0.4);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(108, 99, 255, 0.2) 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    --gradient-button: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    --gradient-danger: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
    --gradient-surface: linear-gradient(145deg, var(--surface-bg) 0%, rgba(255, 255, 255, 0.02) 100%);

    /* Sizes & Spacing */
    --radius-small: 8px;
    --radius-medium: 16px;
    --radius-large: 24px;
    --radius-xl: 32px;

    /* Animations */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography Scale */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    --font-size-6xl: 3.75rem;
}

/* Light Theme Variables */
[data-theme="light"] {
    --primary-bg: #f8fafc;
    --secondary-bg: #ffffff;
    --surface-bg: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.9);

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    --border-color: rgba(0, 0, 0, 0.15);
    --border-subtle: rgba(0, 0, 0, 0.08);
    --divider-color: rgba(0, 0, 0, 0.1);

    --shadow-small: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 32px rgba(0, 0, 0, 0.15);
    --shadow-large: 0 16px 64px rgba(0, 0, 0, 0.2);
    --glow-accent: 0 0 20px rgba(0, 255, 136, 0.2);
    --glow-hover: 0 0 30px rgba(0, 255, 136, 0.3);

    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(0, 0, 0, 0.02) 100%);
    --gradient-surface: linear-gradient(145deg, var(--surface-bg) 0%, rgba(0, 0, 0, 0.01) 100%);
}

/* =================================
   RESET & BASE STYLES
   ================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
    font-size: var(--font-size-base);
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    min-height: 100vh;
}

/* Background Decorative Elements */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 25% 25%, rgba(0, 255, 136, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(108, 99, 255, 0.05) 0%, transparent 50%);
    z-index: -2;
    animation: rotate 20s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Geometric Background Elements */
body::after {
    content: '';
    position: fixed;
    top: 10%;
    left: 80%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

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

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

/* =================================
   LOGIN PAGE STYLES
   ================================= */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
}

/* Login Background Elements */
.login-page::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 15%;
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, rgba(0, 255, 136, 0.1), rgba(108, 99, 255, 0.1));
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: 20%;
    right: 15%;
    width: 150px;
    height: 150px;
    background: linear-gradient(-45deg, rgba(108, 99, 255, 0.08), rgba(0, 255, 136, 0.08));
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: float 10s ease-in-out infinite reverse;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-form {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-large);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-large);
    position: relative;
    overflow: hidden;
}

/* Glass effect overlay */
.login-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--accent-primary) 50%, transparent 100%);
    opacity: 0.5;
}

.login-form h1 {
    font-size: var(--font-size-4xl);
    font-weight: 300;
    text-align: center;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.025em;
}

.form-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-medium);
    font-size: var(--font-size-base);
    font-family: inherit;
    color: var(--text-primary);
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: var(--text-muted);
    font-weight: 300;
}

/* Login Button */
#loginBtn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--gradient-button);
    border: none;
    border-radius: var(--radius-medium);
    font-size: var(--font-size-base);
    font-weight: 600;
    color: #000000;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-small);
}

#loginBtn:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-hover), var(--shadow-medium);
}

#loginBtn:active {
    transform: translateY(0);
}

#loginBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#loginBtn:hover::before {
    left: 100%;
}

.error-message {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: var(--radius-small);
    color: var(--accent-danger);
    font-size: var(--font-size-sm);
    text-align: center;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

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

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* =================================
   DASHBOARD LAYOUT
   ================================= */

.dashboard-container {
    min-height: 100vh;
    background: var(--primary-bg);
    position: relative;
    overflow: hidden;
}

/* Dashboard Header */
.dashboard-header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header h1 {
    font-size: var(--font-size-3xl);
    font-weight: 200;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.theme-toggle {
    position: relative;
}

.theme-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    padding: 0.75rem;
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
}

.theme-btn:hover {
    background: var(--surface-bg);
    transform: scale(1.05);
    box-shadow: var(--shadow-small);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#userName {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    backdrop-filter: blur(10px);
}

.logout-btn:hover {
    border-color: var(--accent-danger);
    color: var(--accent-danger);
    background: rgba(255, 71, 87, 0.1);
    transform: translateY(-1px);
}

/* User Selection */
.user-selection {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.user-selection .form-group {
    margin-bottom: 0;
}

.user-selection label {
    font-size: var(--font-size-lg);
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.user-selection select {
    width: 100%;
    max-width: 400px;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    font-size: var(--font-size-base);
    font-family: inherit;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
}

.user-selection select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

/* Admin Controls */
.admin-controls {
    margin-top: 1.5rem;
}

.collect-btn {
    background: var(--gradient-button);
    border: none;
    border-radius: var(--radius-medium);
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: #000000;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-small);
}

.collect-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-hover), var(--shadow-medium);
}

/* =================================
   MAIN DASHBOARD CONTENT
   ================================= */

.dashboard-main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

/* Sections */
.metrics-section,
.charts-section,
.trends-section,
.insights-section,
.binary-section,
.aggregate-section {
    margin-bottom: 4rem;
}

/* Ensure aggregate summary inserted above main has same centered width and horizontal padding */
.aggregate-section {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

.metrics-section h2,
.charts-section h2,
.trends-section h2,
.insights-section h2,
.binary-section h2,
.aggregate-section h2 {
    font-size: var(--font-size-3xl);
    font-weight: 200;
    margin-bottom: 2rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    position: relative;
}

.metrics-section h2::after,
.charts-section h2::after,
.trends-section h2::after,
.insights-section h2::after,
.binary-section h2::after,
.aggregate-section h2::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--gradient-button);
    border-radius: 2px;
}

/* =================================
   METRICS GRID
   ================================= */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-large);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
    animation: fadeInUp 0.6s ease-out var(--stagger-delay, 0s) both;
    min-height: 140px;
}

.metric-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-large);
    border-color: var(--accent-primary);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-button);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.metric-card:hover::before {
    transform: scaleX(1);
}

.metric-card h3 {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.metric-value {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    display: inline;
}

.metric-change {
    font-size: var(--font-size-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.metric-change.positive {
    color: var(--accent-success);
}

.metric-change.negative {
    color: var(--accent-danger);
}

/* =================================
   CHARTS & VISUALIZATIONS
   ================================= */

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.chart-container {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-large);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    min-height: 400px;
}

/* Center single-criteria chart even before first render */
#criteriaSingleChart {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

#criteriaSingleChart .js-plotly-plot,
#criteriaSingleChart .plotly {
    margin: 0 auto !important;
}

.chart-container:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.chart-container h3 {
    font-size: var(--font-size-xl);
    font-weight: 300;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Plotly Chart Styling */
.plotly-graph-div {
    border-radius: var(--radius-medium);
    overflow: hidden;
}

/* Custom Select Styling */
select {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: 0.5rem 2rem 0.5rem 1rem;
    font-size: var(--font-size-sm);
    font-family: inherit;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23a0a0a0' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.25rem;
}

/* Improve contrast for dark theme native dropdown lists */
select,
option {
    color: var(--text-primary);
    background-color: var(--surface-bg);
}

select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

/* =================================
   BINARY GRID & DATA DISPLAY
   ================================= */

.binary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.binary-item {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.binary-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.binary-item h4 {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.binary-value {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.binary-value.yes {
    color: var(--accent-success);
}

.binary-value.no {
    color: var(--accent-danger);
}

/* =================================
   TRENDS & INSIGHTS
   ================================= */

.trends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.trend-item {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    padding: 1.5rem;
    transition: all var(--transition-normal);
}

.trend-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.insights-list {
    display: grid;
    gap: 1.5rem;
}

.insight-item {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    padding: 1.5rem;
    border-left: 4px solid var(--accent-primary);
    transition: all var(--transition-normal);
}

.insight-item:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-medium);
}

/* =================================
   LOADING & STATES
   ================================= */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn var(--transition-normal);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    margin-top: 1rem;
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    font-weight: 300;
}

/* =================================
   ADMIN SPECIFIC STYLES
   ================================= */

#adminUserSelection,
#adminDashboardMain {
    animation: fadeInUp 0.6s ease-out;
}

#adminMetricsGrid .metric-card,
.admin-controls .collect-btn {
    --stagger-delay: calc(var(--index, 0) * 0.1s);
}

.aggregate-container {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

/* =================================
   RESPONSIVE DESIGN
   ================================= */

/* Tablet Styles */
@media (max-width: 1024px) {
    .dashboard-header {
        padding: 1rem 1.5rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .dashboard-header h1 {
        font-size: var(--font-size-2xl);
    }

    .dashboard-main {
        padding: 1.5rem;
    }

    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .login-form {
        padding: 2rem 1.5rem;
    }

    .login-form h1 {
        font-size: var(--font-size-3xl);
    }

    .dashboard-header {
        padding: 1rem;
    }

    .dashboard-main {
        padding: 1rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .metric-card {
        padding: 1.5rem;
    }

    .chart-container {
        padding: 1.5rem;
        min-height: 300px;
    }

    .user-selection {
        padding: 1rem;
    }

    .header-controls {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .login-container {
        padding: 1rem;
    }

    .login-form {
        padding: 1.5rem 1rem;
    }

    .dashboard-header h1 {
        font-size: var(--font-size-xl);
    }

    .metrics-section h2,
    .charts-section h2,
    .trends-section h2,
    .insights-section h2,
    .binary-section h2,
    .aggregate-section h2 {
        font-size: var(--font-size-2xl);
    }

    .metric-value {
        font-size: var(--font-size-3xl);
    }
}

/* =================================
   ANIMATION UTILITIES
   ================================= */

/* Stagger animation delays for grid items */
.metric-card:nth-child(1) {
    --stagger-delay: 0s;
}

.metric-card:nth-child(2) {
    --stagger-delay: 0.1s;
}

.metric-card:nth-child(3) {
    --stagger-delay: 0.2s;
}

.metric-card:nth-child(4) {
    --stagger-delay: 0.3s;
}

.metric-card:nth-child(5) {
    --stagger-delay: 0.4s;
}

.metric-card:nth-child(6) {
    --stagger-delay: 0.5s;
}

/* Hover effects for interactive elements */
.interactive-hover {
    transition: all var(--transition-normal);
}

.interactive-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Focus visible for accessibility */
.focus-visible:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    body::before,
    body::after,
    .login-page::before,
    .login-page::after {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.3);
        --border-subtle: rgba(255, 255, 255, 0.2);
        --text-muted: #cccccc;
    }
}

/* Print styles */
@media print {

    body::before,
    body::after,
    .login-page::before,
    .login-page::after {
        display: none;
    }

    .dashboard-header {
        position: static;
        background: white;
        color: black;
    }

    .metric-card,
    .chart-container {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Best Employee Block Styles - Exact Match to Image */
.best-employee-section {
    margin: 2rem 0 1.5rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

.best-employee-title {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.best-employee-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--gradient-button);
}

.best-employee-block {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    position: relative;
}

.best-employee-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.best-employee-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #4a4a4a;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-weight: 600;
    font-size: var(--font-size-xl);
    margin-bottom: 1rem;
    border: 2px solid #3a3a3a;
}

.best-employee-name {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.3;
}

.best-employee-right {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.best-employee-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
}

/* Removed custom best-employee-metric styles; reuse .metric-card */

/* hover handled by .metric-card */

/* top border handled by .metric-card::before */

/* Small emoji in the top-left corner (without colored box) */
.best-employee-section .metric-icon {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    font-size: 0.85rem;
    line-height: 1;
    opacity: 0.9;
}

.best-employee-section .metric-value {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    display: inline;
}

.best-employee-section .metric-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.best-employee-section .metric-card.single {
    grid-column: 1;
}

/* Hide the selector as it's not in the image */
.best-employee-selector {
    display: none;
}

/* Light theme adjustments */
[data-theme="light"] .best-employee-block {
    background: var(--gradient-card);
    box-shadow: var(--shadow-medium);
}

/* Light theme uses default .metric-card styles */

[data-theme="light"] .best-employee-avatar {
    background: var(--surface-bg);
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* Stagger animation delays for best employee metrics */
.best-employee-metrics .metric-card:nth-child(1) {
    --stagger-delay: 0s;
}

.best-employee-metrics .metric-card:nth-child(2) {
    --stagger-delay: 0.1s;
}

.best-employee-metrics .metric-card:nth-child(3) {
    --stagger-delay: 0.2s;
}

.best-employee-metrics .metric-card:nth-child(4) {
    --stagger-delay: 0.3s;
}

.best-employee-metrics .metric-card:nth-child(5) {
    --stagger-delay: 0.4s;
}

.best-employee-metrics .metric-card:nth-child(6) {
    --stagger-delay: 0.5s;
}

.best-employee-metrics .metric-card:nth-child(7) {
    --stagger-delay: 0.6s;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .best-employee-metrics {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .best-employee-block {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .best-employee-left {
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .best-employee-metrics {
        grid-template-columns: 1fr;
    }
}

/* =================================
   ENHANCED FILTER PANEL STYLES
   ================================= */

.enhanced-filter-panel {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-large);
    padding: 1.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(20px);
}

.filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.filter-reset-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-weight: 500;
}

.filter-reset-btn:hover {
    background: var(--surface-bg);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.filter-controls-row {
    display: grid;
    grid-template-columns: 2fr 2fr 2fr 1fr;
    gap: 1.5rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.filter-select:hover {
    border-color: var(--accent-primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.script-filter-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.script-filter-btn:hover {
    border-color: var(--accent-primary);
    background: var(--card-bg);
}

.script-count-badge {
    background: var(--accent-primary);
    color: #000;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-small);
    font-size: var(--font-size-xs);
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

.filter-stats-display {
    padding: 0.75rem 1rem;
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-text {
    font-weight: 500;
}

.stats-highlight {
    color: var(--accent-primary);
    font-weight: 700;
}

.refresh-btn-new {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--gradient-button);
    border: none;
    border-radius: var(--radius-small);
    color: #000;
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.refresh-btn-new:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.filter-info-bar {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: var(--radius-small);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.info-icon {
    font-size: var(--font-size-lg);
}

/* Script Filter Modal */
.script-filter-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.script-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(8px);
}

.script-modal-content {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-large);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-large);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

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

.script-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.script-modal-header h3 {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
}

.script-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: var(--font-size-2xl);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: all var(--transition-fast);
}

.script-modal-close:hover {
    color: var(--accent-danger);
    transform: scale(1.1);
}

.script-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.script-quick-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.script-action-btn {
    padding: 0.5rem 1rem;
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.script-action-btn:hover {
    background: var(--card-bg);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.script-categories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.script-category {
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    padding: 1rem;
}

.script-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    cursor: pointer;
    user-select: none;
}

.script-category-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.script-category-count {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.script-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.script-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-small);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.script-checkbox-item:hover {
    background: var(--glass-bg);
    border-color: var(--accent-primary);
}

.script-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.script-checkbox-label {
    flex: 1;
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    cursor: pointer;
    user-select: none;
}

.script-call-count {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    background: var(--surface-bg);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-small);
}

.script-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.script-cancel-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.script-cancel-btn:hover {
    background: var(--surface-bg);
}

.script-apply-btn {
    padding: 0.75rem 1.5rem;
    background: var(--gradient-button);
    border: none;
    border-radius: var(--radius-small);
    color: #000;
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.script-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .filter-controls-row {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .filter-group:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .filter-controls-row {
        grid-template-columns: 1fr;
    }

    .filter-panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .script-modal-content {
        width: 95%;
        max-height: 90vh;
    }
}

/* =================================
   FEEDBACK RECOMMENDATIONS STYLES
   ================================= */

.recommendations-filter {
    background: transparent;
    border: none;
    padding: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.recommendations-filter .filter-group {
    margin-bottom: 0;
}

.recommendations-filter .filter-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.recommendations-filter .filter-select {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-weight: 500;
}

.recommendations-filter .filter-select:hover {
    border-color: var(--accent-primary);
    background: var(--glass-bg);
}

.recommendations-filter .filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

/* Special styling for recommendations dropdown */
.recommendations-dropdown {
    background: transparent !important;
    border: 1px solid var(--border-color) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.recommendations-dropdown:hover {
    background: var(--glass-bg) !important;
    border-color: var(--accent-primary) !important;
}

.recommendations-dropdown:focus {
    background: var(--glass-bg) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1) !important;
}

/* =================================
   ENHANCED CHARTS STYLES
   ================================= */

.enhanced-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

/* =================================
   UNIFIED CHART SELECTOR STYLES
   ================================= */

.chart-selector-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.chart-selector {
    display: flex;
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-large);
    padding: 0.5rem;
    gap: 0.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.chart-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-medium);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.chart-tab:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
    transform: translateY(-1px);
}

.chart-tab.active {
    background: var(--gradient-button);
    color: #000;
    font-weight: 600;
    box-shadow: var(--shadow-small);
}

.chart-tab.active:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.unified-chart-container {
    position: relative;
    min-height: 500px;
}

.chart-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

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

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

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

.chart-card {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-large);
    padding: 0;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    animation: fadeInUp 0.6s ease-out var(--stagger-delay, 0s) both;
}

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

.chart-card-wide {
    grid-column: span 2;
}

.chart-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-bg);
}

.chart-card-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-badge {
    background: var(--accent-primary);
    color: #000;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-small);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.criteria-select-wrapper {
    width: 100%;
}

.criteria-select-inline {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-small);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-weight: 500;
}

.criteria-select-inline:hover {
    border-color: var(--accent-primary);
    background: var(--glass-bg);
}

.criteria-select-inline:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.chart-card-body {
    padding: 2rem;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Special sizing for specific chart types */
.chart-card:has(#criteriaRadarChart) .chart-card-body {
    min-height: 650px;
    height: 650px;
    padding: 0.5rem;
}

.chart-card:has(#criteriaComparisonChart) .chart-card-body {
    min-height: 550px;
    height: 550px;
}

.chart-card:has(#criteriaTrendChart) .chart-card-body {
    min-height: 420px;
    height: 420px;
}

.chart-card:has(#criteriaDonutChart) .chart-card-body {
    min-height: 450px;
}

.chart-card-body canvas {
    width: 100% !important;
    height: auto !important;
}

#criteriaRadarChart {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
}

#criteriaDonutChart {
    max-width: 300px;
    max-height: 300px;
    margin: 0 auto;
}

#criteriaComparisonChart {
    width: 100% !important;
    height: 100% !important;
}

#criteriaTrendChart {
    width: 100% !important;
    height: 100% !important;
}

.chart-legend-custom {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-label {
    font-weight: 500;
}

.legend-value {
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.chart-info-text {
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    margin-top: 1rem;
    font-style: italic;
}

/* Stagger animation for chart cards */
.chart-card:nth-child(1) {
    --stagger-delay: 0s;
}

.chart-card:nth-child(2) {
    --stagger-delay: 0.1s;
}

.chart-card:nth-child(3) {
    --stagger-delay: 0.2s;
}

.chart-card:nth-child(4) {
    --stagger-delay: 0.3s;
}

/* Chart loading state */
.chart-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    z-index: 10;
}

.chart-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive charts */
@media (max-width: 1200px) {
    .enhanced-charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-card-wide {
        grid-column: span 1;
    }
}

/* Responsive chart selector */
@media (max-width: 768px) {
    .chart-selector {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .chart-tab {
        text-align: center;
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .chart-card-body {
        padding: 1rem;
        min-height: 250px;
    }

    .chart-card-header {
        padding: 1rem;
    }

    .chart-card-header h3 {
        font-size: var(--font-size-base);
    }

    .enhanced-charts-grid {
        gap: 1rem;
    }
}

/* =================================
   FEEDBACK ANALYSIS STYLES
   ================================= */

.feedback-recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feedback-recommendation-card {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-large);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
    animation: fadeInUp 0.6s ease-out var(--stagger-delay, 0s) both;
    box-shadow: var(--shadow-small);
}

.feedback-recommendation-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-large);
    border-color: var(--accent-primary);
}

.feedback-recommendation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-button);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.feedback-recommendation-card:hover::before {
    transform: scaleX(1);
}

.feedback-recommendation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.feedback-recommendation-number {
    background: var(--gradient-button);
    color: #000000;
    font-weight: 700;
    font-size: var(--font-size-lg);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feedback-recommendation-category {
    background: var(--surface-bg);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-small);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.feedback-recommendation-text {
    font-size: var(--font-size-base);
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.feedback-recommendation-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.feedback-stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.feedback-stat-icon {
    font-size: var(--font-size-sm);
}

.feedback-analysis-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.feedback-analysis-button {
    background: var(--gradient-button);
    color: #000000;
    border: none;
    border-radius: var(--radius-medium);
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feedback-analysis-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.feedback-analysis-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.feedback-analysis-button.is-loading {
    position: relative;
    color: transparent;
}

.feedback-analysis-button.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Stagger animation delays for feedback recommendations */
.feedback-recommendation-card:nth-child(1) {
    --stagger-delay: 0s;
}

.feedback-recommendation-card:nth-child(2) {
    --stagger-delay: 0.1s;
}

.feedback-recommendation-card:nth-child(3) {
    --stagger-delay: 0.2s;
}

.feedback-recommendation-card:nth-child(4) {
    --stagger-delay: 0.3s;
}

.feedback-recommendation-card:nth-child(5) {
    --stagger-delay: 0.4s;
}

.feedback-recommendation-card:nth-child(6) {
    --stagger-delay: 0.5s;
}

/* Responsive design for feedback analysis */
@media (max-width: 768px) {
    .feedback-recommendations-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feedback-analysis-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .feedback-analysis-button {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .feedback-recommendation-card {
        padding: 1rem;
    }
}

/* =================================
   MODAL STYLES
   ================================= */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: var(--surface-bg);
    margin: 5% auto;
    padding: 0;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 800px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-large);
    animation: slideDown 0.3s;
    position: relative;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: 300;
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
}

.close {
    color: var(--text-muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: var(--accent-danger);
    text-decoration: none;
    cursor: pointer;
}

/* Settings Tabs */
.settings-tabs {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

/* Prompts List */
.prompt-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.prompt-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface-bg);
    border: 1px solid var(--border-color);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: rgba(0, 255, 136, 0.2);
    border-color: var(--accent-primary);
}

input:checked+.slider:before {
    transform: translateX(24px);
    background-color: var(--accent-primary);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--accent-primary);
}

/* Form Styles in Modal */
.modal-body .form-group {
    margin-bottom: 1.5rem;
}

.modal-body textarea.form-control {
    min-height: 200px;
    font-family: monospace;
    line-height: 1.5;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-small);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--accent-danger);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-small);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: rgba(255, 71, 87, 0.2);
    border-color: var(--accent-danger);
}