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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #c0392b;
    --text-color: #333;
    --light-text: #f5f5f5;
    --background-color: #f5f5f5;
    --card-bg: #ffffff;
    --border-color: #ddd;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --spacing: 1rem;
}

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

body {
    font-family: 'Tajawal', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header Styles */
header {
    background-color: var(--primary-color);
    color: var(--light-text);
    text-align: center;
    padding: 2rem 1rem;
    box-shadow: var(--shadow);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.sponsor {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.logo-container {
    margin: 1rem auto;
    max-width: 200px;
}

.logo {
    max-width: 100%;
    height: auto;
}

.ad-space {
    margin: 1rem auto;
    padding: 1rem;
    max-width: 720px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    min-height: 90px;
}

/* Main Content Styles */
main {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.game-section {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    text-align: center;
    position: relative;
}

h2:after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
    margin: 0.5rem auto;
    border-radius: 2px;
}

.instructions {
    list-style-position: inside;
    margin-bottom: 2rem;
}

.instructions li {
    padding: 0.5rem 0;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 1.1rem;
}

input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: 'Tajawal', Arial, sans-serif;
    font-size: 1rem;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.primary-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.secondary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.danger-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.small-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    cursor: pointer;
}

.primary-btn:hover, .small-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.secondary-btn:hover {
    background-color: #1f2c38;
    transform: translateY(-2px);
}

.danger-btn:hover {
    background-color: #a33025;
    transform: translateY(-2px);
}

.primary-btn:active, .secondary-btn:active, .danger-btn:active, .small-btn:active {
    transform: translateY(0);
}

/* Game Screen Styles */
.game-info {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--primary-color);
    color: var(--light-text);
    border-radius: var(--border-radius);
}

.game-info > div {
    margin: 0.5rem;
    font-size: 1.1rem;
}

.question-container {
    background-color: rgba(52, 152, 219, 0.1);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.question-container h3 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.options-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.option {
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.option:hover {
    background-color: rgba(52, 152, 219, 0.1);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.option.selected {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.option.correct {
    background-color: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.option.incorrect {
    background-color: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.timer {
    font-weight: bold;
    color: var(--light-text);
}

.timer.warning {
    color: var(--warning-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Result Screen Styles */
.result-summary {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.2rem;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.result-list {
    list-style-type: none;
}

.result-list li {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
}

.result-list li:last-child {
    border-bottom: none;
}

/* Scores Tables */
.scores-container {
    margin-bottom: 2rem;
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.results-table th,
.results-table td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.results-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
}

.results-table tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

.results-table tr:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

/* Footer Styles */
footer {
    background-color: var(--primary-color);
    color: var(--light-text);
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.admin-link {
    opacity: 0.7;
    font-size: 0.9rem;
    display: inline-block;
    margin-top: 0.5rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .game-info {
        flex-direction: column;
    }
    
    .buttons-container {
        flex-direction: column;
    }
    
    .result-details {
        grid-template-columns: 1fr;
    }
}