/* Fancy Add Survey Page - Modern & Centered */

:root {
    /* Default Neutral / Purple Theme */
    --theme-primary: #8b5cf6;
    --theme-primary-rgb: 139, 92, 246;
    --theme-accent: #db2777;
    --theme-bg-1: #0f172a;
    --theme-bg-2: #1e293b;
    --theme-orb-1: #7c3aed;
    --theme-orb-2: #3b82f6;
    --theme-card-bg: rgba(15, 23, 42, 0.4);
    --theme-card-border: rgba(255, 255, 255, 0.1);
    --theme-input-focus: #8b5cf6;
}

[data-bs-theme="light"] {
    --theme-bg-1: #f8fafc;
    --theme-bg-2: #f1f5f9;
    --theme-card-bg: rgba(255, 255, 255, 0.85);
    --theme-card-border: rgba(0, 0, 0, 0.08);
    --theme-orb-1: #c7d2fe;
    --theme-orb-2: #e0e7ff;
}

/* ═══════════ LIGHT MODE COMPREHENSIVE OVERRIDES ═══════════ */

/* Animated background - lighter gradient */
[data-bs-theme="light"] .animated-background {
    background: linear-gradient(-45deg, #f8fafc, #eef2ff, #f1f5f9, #faf5ff);
    background-size: 400% 400%;
}
[data-bs-theme="light"] .animated-background::before,
[data-bs-theme="light"] .animated-background::after {
    opacity: 0.08;
}

/* Main card */
[data-bs-theme="light"] .fancy-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.03);
}

/* Header */
[data-bs-theme="light"] .fancy-header {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.02), transparent);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
[data-bs-theme="light"] .fancy-title {
    color: #1e293b;
}

/* Tabs */
[data-bs-theme="light"] .fancy-tabs {
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
[data-bs-theme="light"] .fancy-tab {
    color: #64748b;
}
[data-bs-theme="light"] .fancy-tab:hover {
    color: #1e293b;
    background: rgba(0, 0, 0, 0.04);
}
[data-bs-theme="light"] .fancy-tab.active {
    background: rgba(var(--theme-primary-rgb), 0.1);
    color: var(--theme-primary);
    border-color: rgba(var(--theme-primary-rgb), 0.25);
    box-shadow: 0 2px 8px rgba(var(--theme-primary-rgb), 0.1);
}

/* Body */
[data-bs-theme="light"] .fancy-body {
    color: #334155;
}

/* Labels */
[data-bs-theme="light"] .fancy-label {
    color: var(--theme-primary);
}

/* Inputs - Using high specificity to ensure light mode wins */
html[data-bs-theme="light"] .fancy-input,
[data-bs-theme="light"] .fancy-input,
[data-bs-theme="light"] textarea.fancy-input,
[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .form-select {
    background-color: #f8fafc !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

html[data-bs-theme="light"] .fancy-input:focus,
[data-bs-theme="light"] .fancy-input:focus,
[data-bs-theme="light"] .form-control:focus {
    background-color: #ffffff !important;
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 4px rgba(var(--theme-primary-rgb), 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    color: #0f172a !important;
}

[data-bs-theme="light"] .fancy-input::placeholder,
[data-bs-theme="light"] .form-control::placeholder {
    color: #64748b !important;
    opacity: 0.7;
}

/* Outline button */
[data-bs-theme="light"] .fancy-btn-outline {
    border: 1px solid #cbd5e1;
    color: #475569;
}
[data-bs-theme="light"] .fancy-btn-outline:hover {
    border-color: #1e293b;
    color: #1e293b;
    background: rgba(0, 0, 0, 0.03);
}

/* AI highlight */
[data-bs-theme="light"] .ai-highlight {
    background: linear-gradient(135deg, rgba(var(--theme-primary-rgb), 0.06), rgba(var(--theme-primary-rgb), 0.02));
    border: 1px dashed rgba(var(--theme-primary-rgb), 0.2);
}
[data-bs-theme="light"] .ai-highlight h5,
[data-bs-theme="light"] .ai-highlight .text-white {
    color: #1e293b !important;
}
[data-bs-theme="light"] .ai-highlight p {
    color: #64748b !important;
}

/* Style pills */
[data-bs-theme="light"] .style-pill-label {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
}
[data-bs-theme="light"] .style-pill-label:hover {
    background: #e2e8f0;
    color: #1e293b;
}
[data-bs-theme="light"] .style-pill-input:checked+.style-pill-label {
    background: rgba(var(--theme-primary-rgb), 0.12);
    border-color: var(--theme-primary);
    color: var(--theme-primary);
    box-shadow: 0 0 10px rgba(var(--theme-primary-rgb), 0.1);
}

/* Slider track */
[data-bs-theme="light"] .custom-slider-track {
    background: #e2e8f0 !important;
}
[data-bs-theme="light"] .slider-dot {
    background: #cbd5e1 !important;
}
[data-bs-theme="light"] .custom-slider-labels {
    color: #64748b !important;
    font-weight: 600;
}
[data-bs-theme="light"] .slider-value-bubble {
    background: var(--theme-primary);
    color: white;
}

/* Question cards */
[data-bs-theme="light"] .question-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
[data-bs-theme="light"] .question-card:hover,
[data-bs-theme="light"] .question-card.active {
    background: #ffffff;
    border-color: rgba(var(--theme-primary-rgb), 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
[data-bs-theme="light"] .question-card.active {
    box-shadow: inset 4px 0 0 0 var(--theme-primary), 0 4px 16px rgba(0, 0, 0, 0.06);
}

[data-bs-theme="light"] .q-header {
    border-bottom: 1px solid #e2e8f0;
}
[data-bs-theme="light"] .q-title {
    color: #1e293b;
}
[data-bs-theme="light"] .q-right-panel {
    background: rgba(0, 0, 0, 0.02);
    border: 1px dashed #e2e8f0;
}
[data-bs-theme="light"] .q-footer {
    border-top: 1px dashed #e2e8f0;
}

/* Form elements within cards for light mode */
[data-bs-theme="light"] .question-card .form-label {
    color: #475569;
}
[data-bs-theme="light"] .question-card .form-control,
[data-bs-theme="light"] .question-card .form-select {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}
[data-bs-theme="light"] .question-card .form-control:focus,
[data-bs-theme="light"] .question-card .form-select:focus {
    background: #ffffff;
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 2px rgba(var(--theme-primary-rgb), 0.1);
}

/* Override the "force dark" block at the bottom for light mode */
[data-bs-theme="light"] .fancy-card .form-control,
[data-bs-theme="light"] .fancy-card .form-select {
    background-color: #f8fafc;
    color: #1e293b;
    border: 1px solid #e2e8f0;
}
[data-bs-theme="light"] .fancy-card .form-control::placeholder {
    color: #94a3b8;
}
[data-bs-theme="light"] .fancy-card option {
    background-color: #ffffff;
    color: #1e293b;
}

/* Toggle switch */
[data-bs-theme="light"] .fancy-toggle-slider {
    background-color: #cbd5e1;
    border-color: #94a3b8;
}

/* Quiz toggle */
[data-bs-theme="light"] .quiz-toggle-input {
    background-color: #cbd5e1;
    border-color: #94a3b8;
}

/* Icon button */
[data-bs-theme="light"] .icon-btn {
    color: #94a3b8;
}

/* Primary button stays vibrant in light mode (no change needed) */
[data-bs-theme="light"] .fancy-btn-primary {
    box-shadow: 0 8px 16px rgba(var(--theme-primary-rgb), 0.2);
}

body.theme-professional {
    --theme-primary: #0284c7;
    --theme-primary-rgb: 2, 132, 199;
    --theme-accent: #3b82f6;
    --theme-bg-1: #0f172a;
    --theme-bg-2: #0c4a6e;
    --theme-orb-1: #0284c7;
    --theme-orb-2: #0ea5e9;
    --theme-input-focus: #0ea5e9;
}

body.theme-academic {
    --theme-primary: #059669;
    --theme-primary-rgb: 5, 150, 105;
    --theme-accent: #10b981;
    --theme-bg-1: #0f172a;
    --theme-bg-2: #064e3b;
    --theme-orb-1: #059669;
    --theme-orb-2: #10b981;
    --theme-input-focus: #10b981;
}

body.theme-creative {
    --theme-primary: #ec4899;
    --theme-primary-rgb: 236, 72, 153;
    --theme-accent: #f97316;
    --theme-bg-1: #2e1065;
    --theme-bg-2: #4a044e;
    --theme-orb-1: #ec4899;
    --theme-orb-2: #f97316;
    --theme-input-focus: #f97316;
}


/* NEW: Dedicated background container to fix mobile overflow */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    /* Critical for mobile scroll fix */
    pointer-events: none;
    background: linear-gradient(-45deg, var(--theme-bg-1), var(--theme-bg-2), var(--theme-bg-1), #0f1320);
    background-size: 400% 400%;
    animation: gradientBG 25s ease infinite;
    transition: background 1s ease;
}

/* Fix desktop background visibility by clearing body background */
body[class*="theme-"] {
    background: transparent !important;
}

html[class*="theme-"] {
     background-color: #0f172a !important;
}
[data-bs-theme="light"] html[class*="theme-"] {
    background-color: #f8fafc !important;
}

/* Extend theme to Navbar and Footer */
body[class*="theme-"] .navbar {
    background: rgba(15, 23, 42, 0.8) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--theme-card-border);
    transition: all 0.5s ease;
}

body[class*="theme-"] footer {
    background: rgba(15, 23, 42, 0.9) !important;
    border-top: 1px solid var(--theme-card-border);
    color: #94a3b8;
    transition: all 0.5s ease;
}

body[class*="theme-"] .navbar-brand .brand-text {
    color: #fff !important;
}

body[class*="theme-"] .nav-link {
    color: #cbd5e1 !important;
}

body[class*="theme-"] .nav-link:hover {
    color: var(--theme-primary) !important;
}

.add-survey-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 4rem 1rem;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    /* Extra safety */
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Floating Orbs - Moved to background container */
.animated-background::before,
.animated-background::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.15;
    z-index: 0;
    animation: floatOrb 12s ease-in-out infinite;
}

.animated-background::before {
    background: radial-gradient(circle, var(--theme-orb-1) 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

.animated-background::after {
    background: radial-gradient(circle, var(--theme-orb-2) 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
    animation-delay: -6s;
}

@keyframes floatOrb {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(40px, 40px);
    }
}

.fancy-card {
    background: var(--theme-card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--theme-card-border);
    border-radius: 32px;
    padding: 0;
    width: 100%;
    max-width: 950px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: border 0.5s ease;
}

/* NEW: Horizontal AI Dashboard for large screens */
@media (min-width: 1200px) {
    .add-survey-wrapper {
        padding: 4rem 1rem;
    }

    .fancy-card.page-horizontal-ai {
        max-width: 1400px;
        width: 95vw;
    }

    .ai-grid-dashboard {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
        align-items: stretch;
    }
    
    .ai-col {
        display: flex;
        flex-direction: column;
    }
}

/* Fallbacks for smaller screens where grid is not active */
@media (max-width: 1199px) {
    .ai-grid-dashboard {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
}

.fancy-header {
    background: linear-gradient(to right, rgba(255, 255, 255, 0.03), transparent);
    border-bottom: 1px solid var(--theme-card-border);
    padding: 2.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fancy-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: 'Outfit', sans-serif;
}

.fancy-title i {
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.2rem;
}

/* Fancy Tabs */
.fancy-tabs {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 3rem;
    border-bottom: 1px solid var(--theme-card-border);
    background: rgba(15, 23, 42, 0.1);
}

.fancy-tab {
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    padding: 0.8rem 1.5rem;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.fancy-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.fancy-tab.active {
    background: rgba(var(--theme-primary-rgb), 0.15);
    color: #fff;
    border-color: rgba(var(--theme-primary-rgb), 0.4);
    box-shadow: 0 4px 15px rgba(var(--theme-primary-rgb), 0.2);
}

/* Content Area */
.fancy-body {
    padding: 3rem;
    color: #e2e8f0;
}

/* Input Styles */
.fancy-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--theme-primary);
    margin-bottom: 0.75rem;
    font-weight: 700;
    display: block;
    font-family: 'Outfit', sans-serif;
    transition: color 0.5s ease;
}

.fancy-input {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--theme-card-border);
    color: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

textarea.fancy-input {
    min-height: 100px;
}

.fancy-input:focus {
    background: rgba(15, 23, 42, 0.6);
    border-color: var(--theme-input-focus);
    box-shadow: 0 0 0 4px rgba(var(--theme-primary-rgb), 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.2);
    outline: none;
}

.fancy-input::placeholder {
    color: #475569;
}

/* Generate Button */
.fancy-btn-primary {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%);
    border: none;
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    width: 100%;
    margin-top: 1rem;
    transition: all 0.5s ease;
    box-shadow: 0 10px 20px rgba(var(--theme-primary-rgb), 0.3);
}

.fancy-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(var(--theme-primary-rgb), 0.4);
    filter: brightness(1.1);
}

.fancy-btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.fancy-btn-outline:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* AI Specifics */
.ai-highlight {
    background: linear-gradient(135deg, rgba(var(--theme-primary-rgb), 0.1), rgba(var(--theme-primary-rgb), 0.05));
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px dashed rgba(var(--theme-primary-rgb), 0.3);
    transition: all 0.5s ease;
}

.ai-badge {
    background: linear-gradient(90deg, var(--theme-primary), var(--theme-accent));
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-weight: 700;
    margin-left: 0.5rem;
    transition: background 0.5s ease;
}

/* ═══════════ Custom Fancy Slider ═══════════ */
.custom-slider-wrapper {
    width: 80%;
    margin: 0 auto;
    padding: 0.5rem 0 0.5rem;
}

.custom-slider {
    position: relative;
    height: 48px;
    cursor: pointer;
    touch-action: none;
    /* Prevent mobile page drag */
}

.custom-slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    transform: translateY(-50%);
    overflow: hidden;
}

.custom-slider-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--theme-primary), var(--theme-accent));
    border-radius: 100px;
    transition: width 0.15s ease-out, background 0.5s ease;
}

.custom-slider-glow {
    position: absolute;
    top: -4px;
    left: 0;
    height: calc(100% + 8px);
    background: linear-gradient(90deg, var(--theme-primary), var(--theme-accent));
    border-radius: 100px;
    opacity: 0.25;
    filter: blur(8px);
    transition: width 0.15s ease-out, background 0.5s ease;
    pointer-events: none;
}

.custom-slider-dots {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    pointer-events: none;
}

.slider-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    transform: translate(-50%, -50%);
    top: 50%;
    transition: all 0.2s ease;
    pointer-events: auto;
    cursor: pointer;
}

.slider-dot.active {
    background: rgba(var(--theme-primary-rgb), 0.5);
    box-shadow: 0 0 4px rgba(var(--theme-primary-rgb), 0.3);
}

.slider-dot.current {
    background: var(--theme-primary);
    width: 10px;
    height: 10px;
    box-shadow: 0 0 8px rgba(var(--theme-primary-rgb), 0.6);
}

.custom-slider-thumb {
    position: absolute;
    top: 50%;
    left: 16.67%;
    /* default for value 5: (5-3)/12*100 */
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    cursor: grab;
    touch-action: none;
    /* Prevent mobile page drag */
    z-index: 5;
    transition: left 0.15s ease-out;
}

.custom-slider-thumb:active {
    cursor: grabbing;
}

.thumb-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.thumb-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
    box-shadow:
        0 0 0 3px rgba(var(--theme-primary-rgb), 0.2),
        0 4px 12px rgba(var(--theme-primary-rgb), 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.2s ease, background 0.5s ease;
}

.custom-slider-thumb:hover .thumb-ring {
    transform: scale(1.1);
    box-shadow:
        0 0 0 5px rgba(var(--theme-primary-rgb), 0.15),
        0 6px 20px rgba(var(--theme-primary-rgb), 0.5),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15);
}

.custom-slider-thumb:active .thumb-ring {
    transform: scale(1.15);
    box-shadow:
        0 0 0 7px rgba(var(--theme-primary-rgb), 0.2),
        0 8px 24px rgba(var(--theme-primary-rgb), 0.6),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15);
}

.custom-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* ─── Quiz mode slider override ─── */
body.quiz-mode-active .custom-slider-fill {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

body.quiz-mode-active .custom-slider-glow {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

body.quiz-mode-active .slider-dot.active {
    background: rgba(245, 158, 11, 0.5);
    box-shadow: 0 0 4px rgba(245, 158, 11, 0.3);
}

body.quiz-mode-active .slider-dot.current {
    background: #fbbf24;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

body.quiz-mode-active .thumb-ring {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    box-shadow:
        0 0 0 3px rgba(245, 158, 11, 0.2),
        0 4px 12px rgba(245, 158, 11, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15);
}

body.quiz-mode-active .custom-slider-thumb:hover .thumb-ring {
    box-shadow:
        0 0 0 5px rgba(245, 158, 11, 0.15),
        0 6px 20px rgba(245, 158, 11, 0.5),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15);
}

/* Style Selection Pills */
.style-pill-input:checked+.style-pill-label {
    background: rgba(var(--theme-primary-rgb), 0.4);
    border-color: var(--theme-primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(var(--theme-primary-rgb), 0.3);
}

.style-pill-label {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.style-pill-label:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

/* Question Cards */
.question-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    transition: all 0.2s ease;
}

.q-grid-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

@media (min-width: 992px) {
    .q-grid-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        align-items: start;
    }
}

.q-left-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.q-right-panel {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px dashed rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.question-card:hover,
.question-card.active {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(var(--theme-primary-rgb), 0.3);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.2);
}

.question-card.active {
    box-shadow: inset 4px 0 0 0 var(--theme-primary), 0 4px 20px -2px rgba(0, 0, 0, 0.2);
    border-left-color: rgba(var(--theme-primary-rgb), 0.3);
    /* Keep border color consistent with hover */
}

.q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.8rem;
}

.q-title {
    font-weight: 700;
    color: #e2e8f0;
    font-size: 1.1rem;
}

/* Collapsed State */
.question-card.collapsed .q-grid-container {
    display: none !important;
}

.question-card.collapsed {
    padding-bottom: 0.8rem;
}

.question-card.collapsed .q-header {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.q-toolbar {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #64748b;
    padding: 0.4rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    color: #ef4444;
    /* Red for delete/remove actions usually */
    background: rgba(239, 68, 68, 0.1);
}

.duplicate-question-btn:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

/* Form elements within cards */
.question-card .form-label {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 0.4rem;
}

.question-card .form-control,
.question-card .form-select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    font-size: 0.95rem;
}

.question-card .form-control:focus,
.question-card .form-select:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 2px rgba(var(--theme-primary-rgb), 0.15);
    outline: none;
}

/* Answers area */
.answer-row {
    margin-bottom: 0.8rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.q-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.add-answer-btn {
    color: var(--theme-primary);
    border-color: rgba(var(--theme-primary-rgb), 0.3);
    background: transparent;
}

.add-answer-btn:hover {
    background: rgba(var(--theme-primary-rgb), 0.1);
    color: #fff;
    border-color: var(--theme-primary);
}

/* ═══════════ Fancy Toggle Switch ═══════════ */
.fancy-toggle-wrapper {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.fancy-toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.fancy-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: .4s;
    border-radius: 34px;
    border: 1px solid #475569;
}

.fancy-toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.fancy-toggle-input:checked+.fancy-toggle-slider {
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
    border-color: var(--theme-primary);
}

.fancy-toggle-input:focus+.fancy-toggle-slider {
    box-shadow: 0 0 0 4px rgba(var(--theme-primary-rgb), 0.2);
}

.fancy-toggle-input:checked+.fancy-toggle-slider:before {
    transform: translateX(26px);
}

/* Quiz Mode Override */
body.quiz-mode-active .fancy-toggle-input:checked+.fancy-toggle-slider {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    border-color: #f59e0b;
}

body.quiz-mode-active .fancy-toggle-input:focus+.fancy-toggle-slider {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .add-survey-wrapper {
        padding: 1rem 0.5rem;
        /* min-height: 100vh; */
    }

    .fancy-card {
        border-radius: 16px;
    }

    .fancy-header {
        padding: 1.25rem 1.5rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .fancy-header .fancy-btn-outline {
        width: 100%;
        justify-content: center;
    }

    .fancy-tabs {
        padding: 0.5rem 1rem;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Hide scrollbar for cleaner look */
    }

    .fancy-tabs::-webkit-scrollbar {
        display: none;
    }

    .fancy-tab {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .fancy-body {
        padding: 1.5rem 1.25rem;
    }

    .custom-slider-wrapper {
        width: 100%;
        padding: 0.5rem 0 1rem;
    }

    .ai-highlight {
        padding: 1rem;
    }

    .question-card {
        padding: 1rem;
    }

    .fancy-btn-primary {
        padding: 0.8rem;
    }

    /* Prevent text zooming on iOS */
    .fancy-input {
        font-size: 16px;
        padding: 1rem;
    }

    .fancy-body {
        padding: 1.25rem 1rem;
    }

    .fancy-title {
        font-size: 1.35rem;
    }

    .fancy-btn-primary {
        font-size: 1.1rem;
        padding: 1.1rem;
    }
}

@media (max-width: 480px) {
    .fancy-title {
        font-size: 1.25rem;
    }

    .q-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .q-toolbar {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Quiz Mode Overrides */
body.quiz-mode-active .add-survey-wrapper {
    background: transparent;
    /* Background handles gradient now */
}

/* Update gradient for the background container in quiz mode */
body.quiz-mode-active .animated-background {
    background: linear-gradient(-45deg, #0f172a, #1a1508, #1e1b4b, #0f172a);
    background-size: 400% 400%;
}

body.quiz-mode-active .animated-background::before {
    background: radial-gradient(circle, #f59e0b 0%, transparent 70%);
    opacity: 0.15;
}

body.quiz-mode-active .animated-background::after {
    background: radial-gradient(circle, #fbbf24 0%, transparent 70%);
    opacity: 0.1;
}

body.quiz-mode-active .fancy-card {
    background: rgba(30, 25, 10, 0.85);
    /* Warm dark background */
    backdrop-filter: blur(20px);
    border-color: rgba(251, 191, 36, 0.3);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 40px -10px rgba(251, 191, 36, 0.15),
        inset 0 1px 0 rgba(251, 191, 36, 0.15);
}

body.quiz-mode-active .ai-highlight {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
    border-color: rgba(251, 191, 36, 0.3);
}

body.quiz-mode-active .fancy-title i {
    color: #fbbf24;
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}

/* Tabs - Gold Theme */
body.quiz-mode-active .fancy-tab.active {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-bottom: 2px solid #f59e0b;
    /* Fallback */
    box-shadow: 0 4px 12px -2px rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

body.quiz-mode-active .fancy-tab:hover:not(.active) {
    color: #fcd34d;
    background: rgba(251, 191, 36, 0.05);
}

/* Inputs - Gold Focus */
body.quiz-mode-active .fancy-input:focus,
body.quiz-mode-active .form-control:focus,
body.quiz-mode-active .form-select:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

/* Primary Button - Gold Gradient */
body.quiz-mode-active .fancy-btn-primary {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    color: #fff;
    font-weight: 700;
    border: 1px solid rgba(251, 191, 36, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.quiz-mode-active .fancy-btn-primary:hover {
    box-shadow: 0 10px 20px -5px rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    transform: translateY(-2px);
    border-color: rgba(251, 191, 36, 0.4);
}

body.quiz-mode-active .question-card.active {
    box-shadow: inset 4px 0 0 0 #f59e0b, 0 8px 30px -5px rgba(0, 0, 0, 0.3);
    border-left-color: rgba(245, 158, 11, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

body.quiz-mode-active .add-answer-btn {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.4);
}

body.quiz-mode-active .add-answer-btn:hover {
    background: rgba(251, 191, 36, 0.1);
    color: #fff;
    border-color: #fbbf24;
}

body.quiz-mode-active .style-pill-input:checked+.style-pill-label {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #fbbf24;
}

.quiz-toggle-input {
    float: none !important;
    margin-right: 0.5rem !important;
    background-color: #334155;
    border-color: #475569;
}

/* --- DARK MODE FIXES --- */
/* Ensure inputs don't become white in dark mode system pref */
@media (prefers-color-scheme: dark) {

    .fancy-input,
    .form-control,
    .form-select {
        background-color: rgba(15, 23, 42, 0.8) !important;
        color: #e2e8f0 !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }

    .fancy-input:focus,
    .form-control:focus,
    .form-select:focus {
        background-color: rgba(15, 23, 42, 0.95) !important;
        border-color: #8b5cf6 !important;
        color: #fff !important;
    }

    /* Fix white background on potential autocomplete/autofill */
    input:-webkit-autofill,
    input:-webkit-autofill:hover,
    input:-webkit-autofill:focus,
    input:-webkit-autofill:active {
        -webkit-box-shadow: 0 0 0 30px #1e293b inset !important;
        -webkit-text-fill-color: white !important;
    }
}

/* Force dark styles ONLY when in dark mode */
[data-bs-theme="dark"] .fancy-card .form-control,
[data-bs-theme="dark"] .fancy-card .form-select {
    background-color: rgba(15, 23, 42, 0.6);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .fancy-card .form-control::placeholder {
    color: #64748b;
}

/* Fix dropdown options visibility */
[data-bs-theme="dark"] .fancy-card option {
    background-color: #1e293b;
    color: #fff;
}

/* NEW: Creation Hub Modal Premium Styles */
.modal-blobs {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.modal-blob {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
    animation: blobFloat 15s infinite ease-in-out;
}

.modal-blob-1 {
    background: var(--theme-primary, #8b5cf6);
    top: -100px;
    left: -100px;
}

.modal-blob-2 {
    background: var(--theme-accent, #db2777);
    bottom: -100px;
    right: -100px;
    animation-delay: -7s;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, 30px) scale(1.1); }
}

.creation-hub-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

[data-bs-theme="light"] .creation-hub-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}

.creation-hub-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="light"] .creation-hub-card:hover {
    background: #fff;
    border-color: var(--theme-primary);
    box-shadow: 0 15px 35px rgba(var(--theme-primary-rgb), 0.1);
}

.creation-hub-icon-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.creation-hub-icon {
    width: 56px;
    height: 56px;
    background: rgba(var(--theme-primary-rgb), 0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--theme-primary);
    transition: all 0.3s ease;
}

.creation-hub-card:hover .creation-hub-icon {
    transform: scale(1.1) rotate(5deg);
    background: var(--theme-primary);
    color: #fff;
}

.ai-powered-tag, .live-tag {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    letter-spacing: 0.05em;
}

.ai-powered-tag {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.live-tag {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.creation-hub-content h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: #fff;
}

[data-bs-theme="light"] .creation-hub-content h3 {
    color: #1e293b;
}

.creation-hub-content p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
    line-height: 1.5;
}

[data-bs-theme="light"] .creation-hub-content p {
    color: #64748b;
}

.creation-hub-footer {
    padding-top: 1.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--theme-primary);
}

.text-danger-vibrant {
    color: #ef4444 !important;
}

/* Card Specific Themes */
.card-ankieta:hover { border-bottom: 4px solid #3b82f6; }
.card-quiz:hover { border-bottom: 4px solid #f59e0b; }
.card-arena:hover { border-bottom: 4px solid #ef4444; }

/* Auto-grow textarea for title/topic fields */
.auto-grow-textarea {
    min-height: 48px;
    line-height: 1.5;
    overflow: hidden;
    resize: none;
    transition: height 0.15s ease;
}

/* Quiz Mode Visibility */
body:not(.quiz-mode-active) .explanation-wrapper {
    display: none !important;
}
body.quiz-mode-active .explanation-wrapper {
    display: block !important;
}

/* Dynamic Color Themes handled by variables at the top */
