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

/* ==================== THEME VARIABLES ==================== */

/* Light Mode (Default Cyberpunk) */
:root,
[data-theme-mode="light"] {
    --bg-dark: #0a0e27;
    --bg-card: #1a1f3a;
    --bg-gradient-start: #0f1528;
    --bg-gradient-end: #1a0b2e;

    --neon-cyan: #00f3ff;
    --neon-magenta: #ff00ff;
    --neon-purple: #bd00ff;
    --neon-pink: #ff006e;
    --neon-blue: #3b82f6;

    --text-primary: #e0e7ff;
    --text-secondary: #94a3b8;
    --text-accent: #00f3ff;

    --success: #00ff88;
    --danger: #ff0055;
    --warning: #ffaa00;

    --grid-opacity: 0.03;
}

/* Dark Mode */
[data-theme-mode="dark"] {
    --bg-dark: #000000;
    --bg-card: #0d0d0d;
    --bg-gradient-start: #000000;
    --bg-gradient-end: #0a0a0a;

    --neon-cyan: #00ffff;
    --neon-magenta: #ff00aa;
    --neon-purple: #9d00ff;
    --neon-pink: #ff0080;
    --neon-blue: #0080ff;

    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-accent: #00ffff;

    --success: #00ff66;
    --danger: #ff0044;
    --warning: #ffbb00;

    --grid-opacity: 0.05;
}

/* ==================== GLOBAL STYLES ==================== */

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

.hidden {
    display: none !important;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 243, 255, var(--grid-opacity)) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, var(--grid-opacity)) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 100px 20px;
    position: relative;
    z-index: 1;
}

/* ==================== DARK MODE TOGGLE ==================== */

.dark-mode-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background: var(--bg-card);
    border-radius: 15px;
    border: 1px solid var(--neon-cyan);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 3px;
}

.dark-mode-toggle:hover {
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.5);
}

.dark-mode-toggle-slider {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
    border-radius: 50%;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

[data-theme-mode="dark"] .dark-mode-toggle-slider {
    transform: translateX(30px);
}

.dark-mode-toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* ==================== HEADERS ==================== */

h1,
h2,
h3,
h4 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
    margin-bottom: 20px;
}

h2 {
    font-size: 2.5rem;
    position: relative;
    padding-bottom: 15px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-cyan), transparent);
    box-shadow: 0 0 10px var(--neon-cyan);
}

/* ==================== BUTTONS ==================== */

.btn {
    position: relative;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 700;
    /* Dark ink on the bright gradient: readable in EVERY theme. The old
       near-white text washed out on light gradients (midnight theme, the
       yellow Save & Quit, etc.). Buttons with transparent/ghost backgrounds
       override this color inline, so they keep their neon text. */
    color: #0b1020;
    text-shadow: none;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
    border: none;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
    text-decoration: none;
    display: inline-block;
    border-radius: 0;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

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

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.6), 0 0 60px rgba(0, 243, 255, 0.3);
    transform: translateY(-2px);
}

/* ==================== CARDS ==================== */

.card {
    background: rgba(26, 31, 58, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 243, 255, 0.2);
    padding: 30px;
    position: relative;
    transition: all 0.3s ease;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
    cursor: pointer;
}

[data-theme-mode="dark"] .card {
    background: rgba(13, 13, 13, 0.9);
    border-color: rgba(0, 255, 255, 0.3);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
    /* Decorative glow only — must never intercept clicks meant for inputs/buttons
       inside the card (this was swallowing clicks on the study-plan date field). */
    pointer-events: none;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 243, 255, 0.3);
}

.card h3,
.card h4 {
    color: var(--neon-cyan);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

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

/* ==================== HEADER ==================== */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(0, 243, 255, 0.2);
    flex-wrap: wrap;
    gap: 20px;
}

/* ==================== TABLES ==================== */

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(26, 31, 58, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 243, 255, 0.2);
    overflow: hidden;
}

[data-theme-mode="dark"] table {
    background: rgba(13, 13, 13, 0.7);
    border-color: rgba(0, 255, 255, 0.3);
}

th {
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.2), rgba(189, 0, 255, 0.2));
    color: var(--neon-cyan);
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid var(--neon-cyan);
}

td {
    padding: 15px;
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
    color: var(--text-primary);
}

tr {
    transition: all 0.3s ease;
}

tr:hover {
    background: rgba(0, 243, 255, 0.05);
    box-shadow: inset 0 0 20px rgba(0, 243, 255, 0.1);
}

/* ==================== FORMS ==================== */

input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
    font-family: 'Rajdhani', sans-serif;
    background: rgba(26, 31, 58, 0.8);
    border: 1px solid rgba(0, 243, 255, 0.3);
    color: var(--text-primary);
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

[data-theme-mode="dark"] input,
[data-theme-mode="dark"] textarea,
[data-theme-mode="dark"] select {
    background: rgba(13, 13, 13, 0.9);
    border-color: rgba(0, 255, 255, 0.4);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
    background: rgba(26, 31, 58, 1);
}

[data-theme-mode="dark"] input:focus,
[data-theme-mode="dark"] textarea:focus,
[data-theme-mode="dark"] select:focus {
    background: rgba(13, 13, 13, 1);
}

/* ==================== DASHBOARD & COMPONENTS ==================== */

.login-container {
    max-width: 500px;
    margin: 100px auto;
    text-align: center;
}

.question-block {
    background: rgba(26, 31, 58, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-left: 4px solid var(--neon-cyan);
    padding: 25px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

[data-theme-mode="dark"] .question-block {
    background: rgba(13, 13, 13, 0.9);
}

.question-block:hover {
    border-left-color: var(--neon-magenta);
    box-shadow: 0 5px 20px rgba(0, 243, 255, 0.2);
}

.options label {
    display: block;
    margin: 12px 0;
    padding: 12px 15px;
    background: rgba(0, 243, 255, 0.05);
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.options label:hover {
    background: rgba(0, 243, 255, 0.1);
    border-left-color: var(--neon-cyan);
    padding-left: 20px;
}

/* Custom Checkbox Styles */
.options input[type="radio"],
.options input[type="checkbox"],
.answer-checkbox-row input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid var(--neon-cyan);
    border-radius: 4px;
    background: rgba(0, 243, 255, 0.1);
    cursor: pointer;
    position: relative;
    margin-right: 15px;
    transition: all 0.3s ease;
    vertical-align: middle;
}

.options input[type="radio"] {
    border-radius: 50%;
}

.options input[type="radio"]:checked,
.options input[type="checkbox"]:checked,
.answer-checkbox-row input[type="checkbox"]:checked {
    background: var(--neon-cyan);
    box-shadow: 0 0 15px var(--neon-cyan);
}

.options input[type="checkbox"]:checked::after,
.answer-checkbox-row input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--bg-dark);
    font-weight: 900;
    font-size: 16px;
}

.options input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--bg-dark);
    border-radius: 50%;
}

.answer-checkbox-row {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(26, 31, 58, 0.6);
    border: 1px solid rgba(0, 243, 255, 0.2);
    margin-bottom: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.answer-checkbox-row:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--neon-cyan);
}

.answer-checkbox-row label {
    cursor: pointer;
    flex: 1;
    font-size: 1.1rem;
}

.btn-remove {
    background: rgba(255, 0, 85, 0.2);
    border: 1px solid var(--danger);
    color: var(--danger);
    width: 40px;
    height: 40px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 15px var(--danger);
}

.option-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.option-row input {
    flex: 1;
}

.btn-add {
    background: transparent;
    border: 2px dashed var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 15px;
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-add:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
}

.score-card {
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.1), rgba(189, 0, 255, 0.1));
    border: 2px solid var(--neon-cyan);
    padding: 40px;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.score-card h2 {
    font-size: 3rem;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {

    0%,
    100% {
        text-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
    }

    50% {
        text-shadow: 0 0 40px rgba(0, 243, 255, 0.8), 0 0 60px rgba(0, 243, 255, 0.5);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(0, 243, 255, 0.5), 0 0 20px rgba(255, 0, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(0, 243, 255, 0.8), 0 0 40px rgba(255, 0, 255, 0.6);
    }
}

@keyframes pulse-border {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 0, 0, 0.7), 0 0 50px rgba(255, 0, 0, 0.3);
    }
}

/* ==================== THEME SELECTOR ==================== */

.theme-selector {
    display: flex;
    gap: 8px;
}

.theme-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.theme-swatch:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.5);
}

.theme-swatch.active {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.6);
}

.theme-swatch[data-theme="neon"] {
    background: linear-gradient(135deg, #00f3ff, #bd00ff);
}

.theme-swatch[data-theme="ocean"] {
    background: linear-gradient(135deg, #0080ff, #00d4ff);
}

.theme-swatch[data-theme="sunset"] {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
}

.theme-swatch[data-theme="forest"] {
    background: linear-gradient(135deg, #00ff88, #00aa55);
}

.theme-swatch[data-theme="midnight"] {
    background: linear-gradient(135deg, #1a0b2e, #3d2c5a);
}

/* ==================== DASHBOARD SPECIFIC ==================== */

.dashboard-header {
    margin-bottom: 30px;
}

.user-welcome {
    flex: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;              /* wrap to a new row instead of overflowing */
}

/* Don't let buttons shrink below their natural width — that squeeze is what forced
   the uneven 2-line boxes. They keep single-line size and flow onto the next row.
   (The mobile media query re-enables flex:1 so they expand evenly on small screens.) */
.header-actions .btn {
    flex-shrink: 0;
}

.xp-container {
    margin-top: 20px;
    padding: 20px;
    background: rgba(26, 31, 58, 0.5);
    border-radius: 10px;
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.xp-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.level-badge {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
    padding: 5px 15px;
    border-radius: 15px;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
}

.xp-bar-bg {
    background: rgba(0, 0, 0, 0.3);
    height: 25px;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    margin-bottom: 15px;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    transition: width 0.5s ease;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.6);
}

.xp-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.user-stats-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.streak-badge {
    color: var(--warning);
    font-weight: 700;
}

.exam-selection {
    margin-bottom: 40px;
}

.exam-controls-wrapper {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.control-group {
    flex: 1;
    min-width: 200px;
}

.control-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--neon-cyan);
}

.form-select {
    width: 100%;
}

.history-table {
    width: 100%;
}

.btn-small {
    padding: 5px 15px;
    font-size: 0.85rem;
}

.btn-leaderboard {
    background: linear-gradient(135deg, var(--neon-magenta), var(--neon-pink));
}

/* ==================== HEATMAP ==================== */

.heatmap-container {
    margin: 40px 0;
    padding: 25px;
    background: rgba(26, 31, 58, 0.5);
    border-radius: 10px;
}

.heatmap-grid {
    display: flex;
    gap: 3px;
    overflow-x: auto;
}

.heatmap-week {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.heatmap-day {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: rgba(0, 243, 255, 0.1);
}

.heatmap-day.level-1 {
    background: rgba(0, 243, 255, 0.3);
}

.heatmap-day.level-2 {
    background: rgba(0, 243, 255, 0.5);
}

.heatmap-day.level-3 {
    background: rgba(0, 243, 255, 0.7);
}

.heatmap-day.level-4 {
    background: rgba(0, 243, 255, 0.9);
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    font-size: 0.8rem;
}

/* ==================== EXAM PAGE ==================== */

.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.timer-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    color: var(--neon-cyan);
}

.exam-progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.exam-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.6);
}

.question-counter {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--neon-cyan);
}

.question-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
    padding: 20px 0;
}

.flag-btn {
    background: transparent;
    border: 1px solid var(--warning);
    color: var(--warning);
    padding: 5px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.flag-btn.active {
    background: var(--warning);
    color: var(--bg-dark);
}

.flag-btn:hover {
    background: var(--warning);
    color: var(--bg-dark);
}

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

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-card);
    padding: 40px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.5);
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.review-grid-item {
    padding: 15px;
    text-align: center;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
}

.review-grid-item.answered {
    border-color: var(--success);
    background: rgba(0, 255, 136, 0.1);
}

.review-grid-item.unanswered {
    border-color: var(--danger);
    background: rgba(255, 0, 85, 0.1);
}

.review-grid-item.flagged::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    color: var(--warning);
}

.review-grid-item:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.5);
}

.legend {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
}

/* ==================== OPTION LABELS ==================== */

.option-label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin: 10px 0;
    background: rgba(0, 243, 255, 0.05);
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-label:hover {
    background: rgba(0, 243, 255, 0.15);
    border-left-color: var(--neon-cyan);
    padding-left: 20px;
}

.option-label input {
    margin-right: 12px;
}

/* ==================== CALENDAR HEATMAP ==================== */
.calendar-heatmap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.calendar-month {
    background: rgba(0, 243, 255, 0.04);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 12px;
    padding: 18px;
    transition: all 0.3s;
}

.calendar-month:hover {
    background: rgba(0, 243, 255, 0.06);
    border-color: rgba(0, 243, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 243, 255, 0.15);
}

.calendar-month-header {
    font-size: 1rem;
    font-weight: 800;
    color: var(--neon-cyan);
    text-align: center;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}

.calendar-weekdays div {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 2px 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 32px;
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.calendar-day.level-0 {
    background: rgba(0, 243, 255, 0.06);
    border: 1px solid rgba(0, 243, 255, 0.12);
    color: var(--text-secondary);
}

.calendar-day.level-1 {
    background: rgba(0, 243, 255, 0.3);
    border: 1px solid rgba(0, 243, 255, 0.5);
    color: var(--neon-cyan);
}

.calendar-day.level-2 {
    background: rgba(0, 243, 255, 0.5);
    border: 1px solid rgba(0, 243, 255, 0.7);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.35);
}

.calendar-day.level-3 {
    background: rgba(0, 243, 255, 0.7);
    border: 1px solid var(--neon-cyan);
    color: var(--bg-dark);
    font-weight: 700;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.5);
}

.calendar-day.level-4 {
    background: var(--neon-cyan);
    border: 2px solid var(--neon-cyan);
    color: var(--bg-dark);
    font-weight: 900;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.8),
        0 0 30px rgba(0, 243, 255, 0.4);
}

.calendar-day:not(.empty):hover {
    transform: scale(1.2);
    z-index: 10;
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.7);
}

.calendar-day.future {
    background: rgba(100, 100, 100, 0.1);
    border: 1px dashed rgba(100, 100, 100, 0.3);
    color: rgba(100, 100, 100, 0.5);
    cursor: default;
}

.calendar-day.future:hover {
    transform: none;
    box-shadow: none;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-nav button {
    min-width: auto;
}

@media (max-width: 768px) {
    .heatmap-container>div:first-child {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }

    .calendar-nav {
        width: 100%;
        justify-content: space-between;
    }
}


.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.heatmap-legend .heatmap-day {
    width: 18px;
    height: 18px;
    border-radius: 4px;
}

@media (max-width: 1200px) {
    .calendar-heatmap {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* Custom Test Creator Styles */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

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

.question-select-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
}

.question-select-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.question-select-item.selected {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.question-select-item div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.question-item {
    background: rgba(20, 20, 30, 0.6);
    border: 1px solid rgba(0, 243, 255, 0.2);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    position: relative;
    animation: slideIn 0.3s ease;
}

.remove-btn {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.3);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.remove-btn:hover {
    background: rgba(255, 59, 48, 0.4);
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.3);
}

@media (max-width: 768px) {
    .calendar-heatmap {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .calendar-month {
        padding: 12px;
    }
}

/* Improved Question Form Styles */
.question-item .form-group,
#singleQuestionForm .form-group {
    text-align: center;
    margin-bottom: 30px;
}

.question-item label,
#singleQuestionForm label {
    display: block;
    text-align: center;
    font-size: 1.2rem;
    color: var(--neon-cyan);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.question-item input[type="text"],
.question-item textarea,
.question-item select,
#singleQuestionForm input[type="text"],
#singleQuestionForm textarea,
#singleQuestionForm select {
    text-align: center;
    font-size: 1.2rem;
    padding: 18px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 8px;
    width: 100%;
    transition: all 0.3s ease;
    min-height: 55px;
}

.question-item input[type="text"]:focus,
.question-item textarea:focus,
.question-item select:focus,
#singleQuestionForm input[type="text"]:focus,
#singleQuestionForm textarea:focus,
#singleQuestionForm select:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
    transform: translateY(-2px);
}

.question-item textarea,
#singleQuestionForm textarea {
    min-height: 120px;
    resize: vertical;
}

.question-item .options-grid,
#singleQuestionForm .options-grid {
    gap: 25px;
    margin: 35px 0;
}

#singleQuestionForm {
    padding: 35px;
    max-width: 900px;
    margin: 0 auto;
}

.calendar-day {
    min-height: 28px;
    font-size: 0.7rem;
}

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

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

/* ==================== FILTER TABS ==================== */

.filter-tabs {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

.filter-tab {
    padding: 10px 25px;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    border-radius: 30px;
    /* Pill shape */
    background: rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.filter-tab:hover {
    background: rgba(0, 243, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.6);
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
    border-color: #fff;
}

.filter-tab:active {
    transform: translateY(1px);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

.filter-tab.active {
    background: var(--neon-cyan);
    color: var(--bg-dark);
    font-weight: 800;
    box-shadow: 0 0 25px var(--neon-cyan);
    border-color: var(--neon-cyan);
}
/* Mobile Responsive Fixes for Dashboard Header */
@media (max-width: 768px) {
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .theme-selector {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
        order: 10; /* Move themes to bottom of header controls */
    }
    
    .header-actions .btn {
        flex: 1; /* Make buttons expand evenly */
        min-width: 120px; /* But not too small */
        text-align: center;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}
