@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4A90E2;
    /* Blue for header */
    --secondary: #2ECC71;
    /* Green */
    --accent: #F1C40F;
    /* Yellow */
    --purple: #9B59B6;
    --pink: #FF9FF3;
    --dark: #2C3E50;
    --light: #F0F4F8;
    /* Light blueish grey background */
    --white: #FFFFFF;
    --danger: #E74C3C;
    --font-main: 'Fredoka', sans-serif;

    /* Card Colors */
    --card-blue-border: #4A90E2;
    --card-yellow-border: #F1C40F;
    --card-green-border: #2ECC71;
    --card-pink-border: #FF9FF3;
    --card-grey-border: #95A5A6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    border-bottom: 3px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-welcome {
    font-weight: 600;
    margin-right: 15px;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.header-btn:hover {
    transform: scale(1.1);
}

.btn-online {
    background: #E3F2FD;
    color: var(--primary);
    width: auto;
    padding: 0 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-settings {
    background: #ECF0F1;
    color: var(--dark);
}

.btn-logout {
    background: var(--danger);
    color: white;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.dashboard-card {
    background: white;
    border-radius: 25px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 320px;
    color: white;
    position: relative;
    overflow: hidden;
}

.dashboard-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.dashboard-card .card-icon-container {
    background: rgba(255, 255, 255, 0.2);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.dashboard-card i {
    font-size: 2.5rem;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.dashboard-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-card .card-desc {
    font-size: 0.95rem;
    margin-bottom: 20px;
    opacity: 0.95;
    font-weight: 400;
}

.dashboard-card .card-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient Card Styles */
.card-gradient-blue {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 10px 20px rgba(79, 172, 254, 0.3);
}

.card-gradient-green {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow: 0 10px 20px rgba(67, 233, 123, 0.3);
}

.card-gradient-purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.card-gradient-pink {
    background: linear-gradient(135deg, #ff9a9e 0%, #ff6a88 100%);
    box-shadow: 0 10px 20px rgba(255, 154, 158, 0.3);
}

.card-gradient-orange {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    box-shadow: 0 10px 20px rgba(246, 211, 101, 0.3);
}

.card-gradient-red {
    background: linear-gradient(135deg, #ff512f 0%, #dd2476 100%);
    box-shadow: 0 10px 20px rgba(255, 81, 47, 0.3);
}

/* Specific Card Styles */
/* Removed Old Specific Card Styles */

/* Action Buttons */
.admin-actions {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    justify-content: center;
}

.big-action-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    color: white;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.2s, transform 0.2s;
    min-width: 200px;
}

.big-action-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-admin-panel {
    background-color: var(--purple);
}

.btn-teacher-panel {
    background-color: var(--secondary);
}

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Leaderboard Grid */
.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.leaderboard-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.lb-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #1F618D;
    font-weight: 700;
}

.lb-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f9f9f9;
}

.lb-row:last-child {
    border-bottom: none;
}

.lb-rank {
    font-weight: bold;
    margin-right: 10px;
}

.lb-score {
    font-weight: 700;
    color: var(--primary);
}

/* Admin Panel Styles */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-tabs {
    display: flex;
    background: #E8F0FE;
    padding: 10px;
    border-radius: 10px;
    gap: 10px;
    margin-bottom: 30px;
    overflow-x: auto;
}

.admin-tab-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-family: var(--font-main);
    font-weight: 600;
    color: #5F6368;
    cursor: pointer;
    border-radius: 8px;
    white-space: nowrap;
}

.admin-tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    color: #7F8C8D;
    font-size: 0.9rem;
}

.admin-table-container {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    padding: 15px;
    color: #7F8C8D;
    font-weight: 600;
    border-bottom: 1px solid #eee;
}

.admin-table td {
    padding: 15px;
    border-bottom: 1px solid #f9f9f9;
}

/* Login/Auth Styles */
.auth-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.9rem;
}

/* Game Screen */
/* Game Screen New Design */
.game-card {
    background: white;
    width: 100%;
    max-width: 800px;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #4A90E2;
}

.game-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.back-btn {
    background: #E0E0E0;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #555;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.back-btn:hover {
    background: #D0D0D0;
}

.progress-container {
    flex: 1;
    background: #E0E0E0;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid #ccc;
}

.progress-bar {
    height: 100%;
    background: #2D72D9;
    /* Specific blue from image */
    width: 100%;
    transition: width 1s linear;
    border-radius: 10px;
}

.timer-text {
    font-weight: 700;
    color: #2D72D9;
    font-size: 1.2rem;
    min-width: 50px;
    text-align: right;
}

.question-header {
    text-align: center;
    color: #15468D;
    font-size: 1.5rem;
    margin-bottom: 25px;
    font-weight: 700;
}

.question-display {
    background: #F0F8FF;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
}

#question-text {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2C3E50;
}

#question-text span.highlight {
    color: #3498DB;
    text-decoration: underline;
}

/* Options */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-btn {
    background: white;
    border: 2px solid #E0E0E0;
    padding: 15px 20px;
    border-radius: 15px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
    position: relative;
}

.option-btn:hover {
    background: #FAFAFA;
    border-color: #D0D0D0;
}

.option-check {
    width: 30px;
    height: 30px;
    border: 2px solid #BDC3C7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.option-btn span {
    font-weight: 600;
    color: #34495E;
}

/* Feedback States */
.option-btn.correct {
    background-color: #DFF9E9;
    /* Light green bg */
    border-color: #2ECC71;
}

.option-btn.correct .option-check {
    background-color: #2ECC71;
    border-color: #2ECC71;
}

.option-btn.correct span {
    color: #219150;
}

.option-btn.wrong {
    background-color: #FADBD8;
    /* Light red bg */
    border-color: #E74C3C;
}

.option-btn.wrong .option-check {
    background-color: #E74C3C;
    border-color: #E74C3C;
}

.option-btn.wrong span {
    color: #C0392B;
}

/* Admin Split Layout */
.admin-split-layout {
    background: #E8F0FE;
    padding: 20px;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.admin-split-layout .add-class-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
}

.admin-split-layout .add-class-card .form-group {
    margin-bottom: 20px;
}

.admin-split-layout .add-class-card label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--dark);
}

.admin-split-layout .add-class-card input {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    font-family: var(--font-main);
    transition: border-color 0.3s;
}

.admin-split-layout .add-class-card input:focus {
    outline: none;
    border-color: var(--primary);
}

.admin-split-layout .btn-block {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 30px;
}

/* Teacher Panel Styles */
.teacher-tab-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-family: var(--font-main);
    font-weight: 600;
    color: #5F6368;
    cursor: pointer;
    border-radius: 8px;
    white-space: nowrap;
}

.teacher-tab-btn.active {
    background: white;
    color: var(--secondary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Aesthetic Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    /* Darker background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    /* Stronger blur */
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    /* Stronger shadow */
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal.hidden .modal-content {
    transform: translateY(-50px);
}

.modal-content h3 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

.modal-content .form-group {
    margin-bottom: 20px;
}

.modal-content label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.modal-content input,
.modal-content select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 1rem;
    font-family: var(--font-main);
    transition: all 0.3s;
    background: #f9f9f9;
}

.modal-content input:focus,
.modal-content select:focus {
    border-color: var(--primary);
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close-btn:hover {
    color: var(--danger);
    background: #fff0f0;
}