:root {
    /* Original Variables */
    --primary-color: #4a90e2;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --background-dark: #2c3e50;
    --background-light: #ecf0f1;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --server-normal: #2ecc71;
    --server-warning: #f1c40f;
    --server-danger: #e74c3c;

    /* Theme Colors */
    --light-background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    --dark-background: linear-gradient(135deg, #0f1631, #590f0f, #805916);
    --light-container: rgba(255, 255, 255, 0.95);
    --dark-container: rgba(44, 62, 80, 0.95);
    --light-text: #333333;
    --dark-text: #ffffff;
}

/* Theme Classes */
body.light-theme {
    background: var(--light-background);
    color: var(--light-text);
}

body.dark-theme {
    background: var(--dark-background);
    color: var(--dark-text);
}

/* Container Theme Styles */
.light-theme .container {
    background: var(--light-container);
}

.dark-theme .container {
    background: var(--dark-container);
}

/* Theme Toggle Button */
#themeSwitch {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#themeSwitch:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Dark theme specific adjustments */
.dark-theme .explanation-panel {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.2), rgba(46, 204, 113, 0.2));
}

.dark-theme .quiz-option,
.dark-theme .resource-card {
    background: rgba(255, 255, 255, 0.1);
    color: var(--dark-text);
}

.dark-theme .styled-select {
    background: rgba(255, 255, 255, 0.1);
    color: var(--dark-text);
    border-color: rgba(255, 255, 255, 0.2);
}

.dark-theme .modal-content {
    background: var(--dark-container);
    color: var(--dark-text);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 2rem;
    width: 90%;
    max-width: 1200px;
    backdrop-filter: blur(10px);
}

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

h1 {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.5rem;
    margin: 0;
}

.visualizer-wrapper {
    background: var(--background-dark);
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.visualizer-container {
    position: relative;
    height: 400px;
}

canvas {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
}

.server-container {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.server-icon {
    width: 60px;
    height: 90px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 8px;
    margin: 0 auto 10px;
}

.control-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(44, 62, 80, 0.1);
    border-radius: 15px;
}

.styled-select {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    background: white;
    font-size: 1rem;
    cursor: pointer;
}

.slider-container {
    position: relative;
    padding: 1rem 0;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--danger-color));
    -webkit-appearance: none;
}

.action-button {
    background: linear-gradient(45deg, var(--danger-color), #c0392b);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.explanation-panel {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(46, 204, 113, 0.1));
    padding: 1.5rem;
    border-radius: 15px;
    border-left: 5px solid var(--primary-color);
}

/* Status indicators */
.status-normal { background-color: var(--server-normal); }
.status-warning { background-color: var(--server-warning); }
.status-danger { background-color: var(--server-danger); }

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

.server-icon {
    animation: pulse 2s infinite;
}

/* Quiz Styles */
.quiz-option {
    display: block;
    width: 100%;
    padding: 1rem;
    margin: 0.5rem 0;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-option:hover {
    background: var(--primary-color);
    color: white;
}

.quiz-results {
    text-align: center;
    padding: 2rem;
}

/* Resource Cards */
.resource-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.resource-card:hover {
    transform: translateY(-5px);
}

.resource-card a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 1rem;
}

/* Tab Navigation */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
}

/* Learning Cards */
.learning-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background: white;
    margin: 10% auto;
    padding: 2rem;
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Progress Bar */
.quiz-progress {
    width: 100%;
    height: 4px;
    background: #eee;
    margin: 1rem 0;
    border-radius: 2px;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0;
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tabs {
        flex-direction: column;
    }

    .control-panel {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}

/* Cool Navigation Header */
.tabs {
    background: linear-gradient(135deg, #1a2a6c 0%, #b21f1f 51%, #fdbb2d 100%);
    padding: 1.5rem;
    border-radius: 15px;
    margin: -20px -20px 2rem -20px;
    display: flex;
    gap: 1rem;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Animated background effect */
.tabs::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        #ff6b6b,
        #4ecdc4,
        #45b7d1,
        #96c93d,
        #ff6b6b
    );
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    opacity: 0.7;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.tab-btn {
    position: relative;
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* Glowing effect for active tab */
.tab-btn.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    border-radius: 25px;
    z-index: -1;
    animation: glowing 20s linear infinite;
    background-size: 400%;
    filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.tab-btn.active:hover::before {
    opacity: 1;
}

@keyframes glowing {
    0% { background-position: 0 0; }
    50% { background-position: 400% 0; }
    100% { background-position: 0 0; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tabs {
        flex-direction: column;
        padding: 1rem;
    }

    .tab-btn {
        width: 100%;
        padding: 0.8rem 1.5rem;
    }
}

/* Optional: Add icons to tabs */
.tab-btn::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.tab-btn:hover::after {
    transform: scale(1.5);
}

.tab-btn.active::after {
    background: white;
    box-shadow: 0 0 10px white;
}