:root {
    --pixel-green: #00ff41;
    --pixel-purple: #bf00ff;
    --pixel-dark: #0a0a0a;
    --pixel-bg: #0d0d0d;
    --pixel-card: #1a1a2e;
    --pixel-border: #3a3a5c;
    --pixel-text: #e0e0e0;
    --pixel-red: #ff0040;
    --pixel-blue: #00aaff;
}
body.light-theme {
    --pixel-green: #16a34a;
    --pixel-purple: #7c3aed;
    --pixel-dark: #1f2937;
    --pixel-bg: #f5f5f5;
    --pixel-card: #ffffff;
    --pixel-border: #d1d5db;
    --pixel-text: #1f2937;
    --pixel-red: #dc2626;
    --pixel-blue: #2563eb;
}
body.light-theme.main-bg { background: #f5f5f5 !important; }
body.light-theme.admin-bg { background-color: #f5f5f5 !important; }
body.light-theme.login-bg { background: linear-gradient(135deg, #f5f5f5 0%, #ede9fe 50%, #f5f5f5 100%) !important; }
body.light-theme .pixel-nav { background: #ffffff !important; border-bottom: 3px solid #d1d5db !important; }
body.light-theme .navbar-dark { background-color: #ffffff !important; color: #1f2937 !important; }
body.light-theme .navbar-dark .navbar-brand { color: #1f2937 !important; }
body.light-theme .table-dark { --bs-table-bg: #ffffff !important; --bs-table-color: #1f2937 !important; --bs-table-border-color: #e5e7eb !important; background-color: #ffffff !important; color: #1f2937 !important; }
body.light-theme .table-dark thead { background: #f3f4f6 !important; }
body.light-theme .table-dark thead th { color: #374151 !important; border-color: #d1d5db !important; background-color: #f3f4f6 !important; }
body.light-theme .table-dark td, body.light-theme .table-dark th { color: #1f2937 !important; border-color: #e5e7eb !important; }
body.light-theme .table-dark tbody tr { background-color: #ffffff !important; color: #1f2937 !important; }
body.light-theme .table-dark tbody tr:hover { background: #f5f3ff !important; }
body.light-theme .pixel-card { background: #ffffff !important; border: 3px solid #d1d5db !important; color: #1f2937 !important; box-shadow: none !important; }
body.light-theme .pixel-card:hover { border-color: #7c3aed !important; }
body.light-theme .pixel-h2, body.light-theme .pixel-h3, body.light-theme .pixel-h4, body.light-theme .pixel-h5 { color: #1f2937 !important; text-shadow: none !important; }
body.light-theme .pixel-title, body.light-theme .pixel-title-lg { color: #1f2937 !important; text-shadow: none !important; }
body.light-theme .pixel-label { color: #374151 !important; text-shadow: none !important; }
body.light-theme .pixel-btn { box-shadow: 3px 3px 0px #d1d5db !important; }
body.light-theme .pixel-btn:hover { box-shadow: 2px 2px 0px #d1d5db !important; }
body.light-theme .pixel-btn-delete { box-shadow: 3px 3px 0px #d1d5db !important; }
body.light-theme .pixel-btn-delete:hover { box-shadow: 2px 2px 0px #d1d5db !important; }
body.light-theme .pixel-table th { color: #374151 !important; text-shadow: none !important; }
body.light-theme .pixel-subtitle { color: #6b7280 !important; }
body.light-theme .pixel-label { color: #374151 !important; }
body.light-theme .pixel-name { color: #1f2937 !important; }
body.light-theme .pixel-value { color: #7c3aed !important; }
body.light-theme .pixel-stat-big .pixel-name { color: #1f2937 !important; }
body.light-theme .pixel-stat-big .pixel-value { color: #7c3aed !important; }
body.light-theme .pixel-input { background: #ffffff !important; border: 3px solid #d1d5db !important; color: #1f2937 !important; }
body.light-theme .pixel-input::placeholder { color: #9ca3af !important; }
body.light-theme .pixel-input:focus { border-color: #7c3aed !important; box-shadow: 0 0 10px rgba(124, 58, 237, 0.2) !important; }
body.light-theme .pixel-alert { background: #fef2f2 !important; border-color: #fca5a5 !important; color: #991b1b !important; }
body.light-theme .pixel-table { background: #ffffff !important; color: #1f2937 !important; }
body.light-theme .table-dark { --bs-table-bg: #ffffff !important; --bs-table-color: #1f2937 !important; --bs-table-border-color: #e5e7eb !important; background-color: #ffffff !important; color: #1f2937 !important; }
body.light-theme .table-dark thead { background: #f3f4f6 !important; }
body.light-theme .table-dark thead th { color: #374151 !important; border-color: #d1d5db !important; background-color: #f3f4f6 !important; }
body.light-theme .table-dark td, body.light-theme .table-dark th { color: #1f2937 !important; border-color: #e5e7eb !important; }
body.light-theme .table-dark tbody tr { background-color: #ffffff !important; color: #1f2937 !important; }
body.light-theme .table-dark tbody tr:hover { background: #f5f3ff !important; }
body.light-theme .pixel-table thead { background: #f3f4f6 !important; }
body.light-theme .pixel-table thead th { color: #374151 !important; border-color: #d1d5db !important; }
body.light-theme .pixel-table td, body.light-theme .pixel-table span, body.light-theme .text-muted { color: #1f2937 !important; }
body.light-theme .pixel-table tbody tr { border-color: #e5e7eb !important; }
body.light-theme .pixel-table tbody tr:hover { background: #f5f3ff !important; }
body.light-theme .student-name { color: #1f2937 !important; }
body.light-theme .sidebar .list-group { background: transparent !important; }
body.light-theme .sidebar .pixel-item { background: #ffffff !important; color: #1f2937 !important; border: 2px solid #d1d5db !important; }
body.light-theme .sidebar .pixel-item:hover { background: #f5f3ff !important; border-color: #7c3aed !important; }
body.light-theme .sidebar .pixel-item.active { background: #7c3aed !important; color: #ffffff !important; border-color: #7c3aed !important; }
body.light-theme .list-group-item { background: #ffffff !important; color: #1f2937 !important; border-color: #d1d5db !important; }
body.light-theme .form-control { background: #ffffff !important; color: #1f2937 !important; border-color: #d1d5db !important; }
body.light-theme .form-control:focus { background: #ffffff !important; color: #1f2937 !important; border-color: #7c3aed !important; }
body.light-theme .form-label { color: #374151 !important; }
body.light-theme #popupOverlay, body.light-theme #livePopup { background: rgba(0, 0, 0, 0.5) !important; }
body.light-theme #popupOverlay .pixel-card, body.light-theme #livePopup .pixel-card { background: #ffffff !important; border-color: #d1d5db !important; }
body.light-theme .audio-activate { background: #7c3aed; color: #fff; border-color: #000; }
body.light-theme .audio-controls { background: rgba(255, 255, 255, 0.95) !important; border-color: #d1d5db !important; }
body.light-theme .audio-controls .pixel-name { color: #1f2937 !important; }
body.light-theme .pixel-btn { border-color: #000 !important; }
body.light-theme .pixel-badge { background: rgba(124, 58, 237, 0.15) !important; border-color: #7c3aed !important; color: #7c3aed !important; }
body.light-theme .pixel-btn-delete { border-color: #000 !important; }
body.light-theme .d-flex .gap-2 { gap: 0.5rem !important; }
body.light-theme h1, body.light-theme h2, body.light-theme h3, body.light-theme h4, body.light-theme h5, body.light-theme h6 { text-shadow: none !important; }
body.light-theme .pixel-item:hover, body.light-theme .pixel-item.active { text-shadow: none !important; }

* { box-sizing: border-box; }

body {
    font-family: 'Press Start 2P', cursive, monospace;
    background-color: var(--pixel-bg);
    color: var(--pixel-text);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* LOGIN PAGE */
.login-bg {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0030 50%, #0a0a0a 100%);
    min-height: 100vh;
}
.login-bg .container {
    max-width: 100%;
}
.login-bg .card.pixel-card {
    max-width: 600px;
    width: 100%;
}

/* ADMIN PAGE */
.admin-bg {
    background-color: var(--pixel-bg);
    min-height: 100vh;
}

/* MAIN PAGE */
.main-bg {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0030 50%, #0a0a0a 100%);
    min-height: 100vh;
}

/* PIXEL CARDS */
.pixel-card {
    background: var(--pixel-card);
    border: 3px solid var(--pixel-border);
    border-radius: 0;
    box-shadow: 4px 4px 0px #000, inset 0 0 20px rgba(191, 0, 255, 0.1);
}

.pixel-card:hover {
    border-color: var(--pixel-purple);
}

/* PIXEL TITLE */
.pixel-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.8rem;
    color: var(--pixel-green);
    text-shadow: 3px 3px 0px #000, 0 0 20px rgba(0, 255, 65, 0.5);
}

.pixel-title-lg {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    color: #ff69b4;
    text-shadow: 2px 2px 0px #000;
    margin-top: 20px;
}

.pixel-subtitle {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--pixel-purple);
}

.pixel-h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: var(--pixel-green);
    margin-bottom: 20px;
    margin-top: 20px;
    text-shadow: 2px 2px 0px #000;
}

.pixel-h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: var(--pixel-purple);
    text-shadow: 2px 2px 0px #000;
}

.pixel-h4 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--pixel-blue);
    text-shadow: 1px 1px 0px #000;
}

.pixel-h5 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    color: var(--pixel-green);
}

/* PIXEL INPUTS */
.pixel-input {
    background: #0d0d1a;
    border: 2px solid var(--pixel-border);
    color: var(--pixel-green);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    padding: 10px 12px;
    border-radius: 0;
    transition: all 0.2s;
}

.pixel-input:focus {
    border-color: var(--pixel-purple);
    box-shadow: 0 0 15px rgba(191, 0, 255, 0.3);
    outline: none;
}

.pixel-input::placeholder {
    color: #555;
}

/* PIXEL BUTTONS */
.pixel-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    border: 3px solid #000;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 3px 3px 0px #000;
}

.pixel-btn:hover {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0px #000;
}

.pixel-btn:active {
    transform: translate(3px, 3px);
    box-shadow: none;
}

.pixel-alert {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    border: 3px solid;
    border-radius: 0;
}

/* NAVBAR */
.pixel-nav {
    background: var(--pixel-dark);
    border-bottom: 4px solid var(--pixel-purple);
    box-shadow: 0 4px 0px #000;
}

.pixel-nav .navbar-brand {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: var(--pixel-green) !important;
    text-shadow: 2px 2px 0px #000;
}

/* SIDEBAR */
.sidebar {
    background: var(--pixel-card);
    border-right: 3px solid var(--pixel-border);
    min-height: calc(100vh - 60px);
    padding-top: 15px;
}

.pixel-item {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    background: transparent;
    border: none;
    color: var(--pixel-text);
    border-left: 4px solid transparent;
    padding: 12px 15px;
    transition: all 0.2s;
}

.pixel-item:hover, .pixel-item.active {
    background: rgba(191, 0, 255, 0.15);
    border-left-color: var(--pixel-purple);
    color: var(--pixel-green);
}

/* THERMOMETER */
.thermometer-container {
    position: relative;
    width: 80px;
    height: 300px;
    margin: 0 auto;
}

.thermometer-bg {
    width: 40px;
    height: 100%;
    background: #111;
    border: 4px solid var(--pixel-border);
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.thermometer-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, var(--pixel-purple), #ff00ff, var(--pixel-green));
    border-radius: 16px 16px 0 0;
    transition: height 0.8s ease-out;
    box-shadow: 0 0 20px rgba(191, 0, 255, 0.5);
}

.thermometer-label {
    position: absolute;
    top: 50%;
    left: 55px;
    transform: translateY(-50%);
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5rem;
    color: var(--pixel-green);
    text-shadow: 2px 2px 0px #000;
}

/* STATS */
.pixel-stat-big {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    gap: 15px;
}

.pixel-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: var(--pixel-green);
}

.pixel-value {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    color: var(--pixel-purple);
    text-shadow: 2px 2px 0px #000;
}

/* TABLE */
.pixel-table {
    border: 2px solid var(--pixel-border);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
}

.pixel-table th {
    background: var(--pixel-dark);
    border: 2px solid var(--pixel-border);
    color: var(--pixel-purple);
}

.pixel-table td {
    border: 2px solid var(--pixel-border);
    color: var(--pixel-text);
}

.pixel-table tbody tr:hover {
    background: rgba(191, 0, 255, 0.1);
}
.pixel-table td, .pixel-table span, .text-muted {
    color: #e0e0e0 !important;
}
.text-muted {
    color: #e0e0e0 !important;
}
/* STUDENT CARD */
.student-name {
    color: #e0e0e0 !important;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
}
.pixel-btn-delete {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    background-color: #ff0040 !important;
    color: #ffffff !important;
    border: 3px solid #000 !important;
    padding: 4px 10px !important;
    cursor: pointer;
    box-shadow: 3px 3px 0px #000;
}
.pixel-btn-delete:hover {
    background-color: #cc0033 !important;
    box-shadow: 2px 2px 0px #000;
}
.pixel-btn-delete:active {
    box-shadow: none;
    transform: translate(3px, 3px);
}
/* WHITE PIXEL BTN */
.btn.pixel-btn {
    background-color: var(--pixel-purple) !important;
    color: #ffffff !important;
    border: 3px solid #000 !important;
}
.pixel-btn.btn-success {
    background-color: #00c853 !important;
    border-color: #006d1a !important;
}
.pixel-btn.btn-success:hover {
    background-color: #00e676 !important;
}
.pixel-btn.btn-danger {
    background-color: #ff0040 !important;
    border-color: #990026 !important;
}
.pixel-btn.btn-danger:hover {
    background-color: #ff1744 !important;
}

/* BADGE */
.pixel-badge {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    background: rgba(191, 0, 255, 0.3);
    border: 2px solid var(--pixel-purple);
    color: #ffffff;
}

/* LABELS */
.pixel-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    color: var(--pixel-green);
}

/* ANIMATION */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glow {
    0%, 100% { text-shadow: 2px 2px 0px #000, 0 0 20px rgba(191, 0, 255, 0.5); }
    50% { text-shadow: 2px 2px 0px #000, 0 0 40px rgba(191, 0, 255, 0.8); }
}

.pulse { animation: pulse 0.3s ease; }
.glow { animation: glow 0.5s ease; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .pixel-title { font-size: 1.2rem; }
    .pixel-h2 { font-size: 0.6rem; }
    .pixel-h3 { font-size: 0.55rem; }
    .thermometer-container { width: 60px; height: 220px; }
    .thermometer-label { font-size: 1rem; }
    .pixel-stat-big { padding: 10px; }
    .pixel-name { font-size: 0.5rem; }
    .pixel-value { font-size: 0.8rem; }
}

/* POPUP */
#popupOverlay .pixel-card {
    animation: popIn 0.3s ease;
}
@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* AUDIO CONTROLS */
.audio-activate {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    background: var(--pixel-purple);
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    padding: 12px 18px;
    border: 3px solid #000;
    box-shadow: 4px 4px 0px #000;
    cursor: pointer;
    animation: pulse 1.5s infinite;
    text-align: center;
}
.audio-activate:hover {
    background: #a855f7;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.audio-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(20, 0, 40, 0.9);
    border: 3px solid var(--pixel-purple);
    border-radius: 0;
    padding: 8px 12px;
    box-shadow: 4px 4px 0px #000;
}
.pixel-btn-audio {
    font-size: 1rem;
    background: rgba(191, 0, 255, 0.2) !important;
    color: #fff !important;
    border: 2px solid var(--pixel-purple) !important;
    padding: 4px 8px !important;
    cursor: pointer;
    line-height: 1;
}
.pixel-btn-audio:hover {
    background: var(--pixel-purple) !important;
}
.pixel-btn-audio.muted {
    background: #ff0040 !important;
    border-color: #ff0040 !important;
}

/* BLOCK PATTERN BACKGROUND */
.block-pattern {
    background-image: 
        linear-gradient(45deg, rgba(191, 0, 255, 0.03) 25%, transparent 25%, transparent 75%, rgba(191, 0, 255, 0.03) 75%),
        linear-gradient(45deg, rgba(191, 0, 255, 0.03) 25%, transparent 25%, transparent 75%, rgba(191, 0, 255, 0.03) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}