* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.hero-section {
    text-align: center;
    padding: 40px 20px;
}

.hero-section h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.countdown-box {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 30px auto;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.countdown-title {
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: bold;
}

.countdown-display {
    font-size: 1.2rem;
    color: #764ba2;
    font-weight: bold;
    line-height: 1.6;
}

.dashboard-countdown {
    margin: 0 0 30px 0;
}

.auth-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.btn-small {
    padding: 6px 15px;
    font-size: 0.9rem;
}

.auth-form {
    background: white;
    max-width: 450px;
    margin: 50px auto;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.auth-form h2 {
    color: #667eea;
    margin-bottom: 25px;
    text-align: center;
    font-size: 2rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.auth-form .btn {
    width: 100%;
    margin-top: 10px;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

.error-message,
.success-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
}

.error-message {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.success-message {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.mobile-header {
    display: none;
    background: #667eea;
    padding: 15px 20px;
    color: white;
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hamburger {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 5px;
}

.mobile-title {
    font-size: 1.2rem;
    font-weight: bold;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 20px;
}

.sidebar-header h2 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.sidebar-header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
}

.nav-menu li {
    margin-bottom: 5px;
}

.nav-menu a {
    display: block;
    padding: 15px 25px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-menu a:hover {
    background: #f5f5f5;
    color: #667eea;
    padding-left: 30px;
}

.nav-menu a.active {
    background: #667eea;
    color: white;
    border-left: 4px solid #764ba2;
}

.main-content {
    margin-left: 280px;
    padding: 30px;
    min-height: 100vh;
}

.main-content h1 {
    color: white;
    margin-bottom: 30px;
    font-size: 2rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 12px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.full-width {
    grid-column: 1 / -1;
}

.stat-box {
    text-align: center;
    padding: 20px;
}

.stat-number {
    font-size: 2.5rem;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    color: #888;
    font-size: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.data-table th {
    background: #f8f9fa;
    color: #667eea;
    font-weight: 600;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.highlight-row {
    background: #fff3cd !important;
    font-weight: bold;
}

.topic-list {
    list-style: none;
    padding: 0;
}

.topic-list li {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    color: #555;
}

.topic-list li:last-child {
    border-bottom: none;
}

.winner-box {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 25px;
}

.winner-box h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.winner-name {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.winner-score {
    font-size: 1.5rem;
    opacity: 0.9;
}

.topic-section {
    margin-bottom: 30px;
}

.topic-section h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2rem;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.course-group,
.course-section {
    margin-bottom: 25px;
}

.course-group h5,
.course-section h3 {
    color: #764ba2;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.checkbox-label:hover {
    background: #f5f5f5;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.inline-form {
    display: contents;
}

.small-input {
    width: 80px;
    padding: 6px;
}

.plan-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.plan-item strong {
    color: #667eea;
    display: block;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.plan-item ul {
    list-style: none;
    padding-left: 0;
}

.plan-item li {
    padding: 8px 0;
    color: #555;
    border-bottom: 1px solid #e0e0e0;
}

.plan-item li:last-child {
    border-bottom: none;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

canvas {
    max-height: 400px;
    margin: 20px 0;
}

.analysis-text {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    color: #555;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 20px 15px;
    }

    .main-content h1 {
        font-size: 1.5rem;
    }

    .hero-section h1 {
        font-size: 1.8rem;
    }

    .countdown-title {
        font-size: 1.2rem;
    }

    .countdown-display {
        font-size: 1rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .auth-form {
        margin: 20px auto;
        padding: 25px;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 0.9rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .winner-box {
        padding: 20px;
    }

    .winner-name {
        font-size: 1.5rem;
    }

    .winner-score {
        font-size: 1.2rem;
    }

    .card {
        padding: 20px;
    }

    .countdown-box {
        padding: 20px;
    }

    .filter-buttons {
        flex-direction: column;
    }

    .filter-buttons .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 1.5rem;
    }

    .countdown-display {
        font-size: 0.9rem;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .small-input {
        width: 60px;
        font-size: 0.9rem;
    }
}