/* General Styles */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #007bff;
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Header */
header {
    background-color: #2c3e50; /* Dark blue-grey */
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping for mobile */
}

.logo h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #f39c12; /* Orange accent */
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

.main-nav li {
    margin-left: 25px;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: #f39c12;
}

.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #34495e, #2c3e50); /* Dark gradient */
    color: white;
    text-align: center;
    padding: 80px 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.hero h2 {
    font-size: 42px;
    margin-bottom: 15px;
    font-weight: 800;
    color: #ecf0f1;
}

.hero p {
    font-size: 18px;
    max-width: 800px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.countdown {
    background-color: rgba(0,0,0,0.2);
    padding: 20px 30px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 20px;
}

.countdown h3 {
    margin-top: 0;
    font-size: 22px;
    color: #f39c12;
}

.countdown .timer {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums; /* Ensures numbers align */
}

.countdown .timer span {
    display: inline-block;
    min-width: 60px;
}

/* Section Styling */
section {
    background-color: white;
    padding: 40px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

section h2 {
    color: #2c3e50;
    font-size: 32px;
    margin-top: 0;
    margin-bottom: 25px;
    border-bottom: 3px solid #f39c12;
    padding-bottom: 10px;
    display: inline-block;
}

/* Today's Results */
.current-date {
    font-size: 18px;
    font-weight: 600;
    color: #555;
    margin-bottom: 20px;
}

.today-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.result-entry {
    background-color: #ecf0f1;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.result-date-header {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.draws-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.draw-item {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.draw-info {
    font-size: 16px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.result-balls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.ball.number {
    background-color: #f39c12; /* Yellow/Orange for actual result */
}

.ball.pending {
    background-color: #95a5a6; /* Grey for pending */
    font-size: 20px;
}

.ball.type {
    width: 35px;
    height: 35px;
    font-size: 16px;
    background-color: #3498db; /* Blue for types */
    opacity: 0.6;
    box-shadow: none;
}

.ball.type.selected {
    opacity: 1;
    background-color: #e74c3c; /* Red for selected type */
    border: 2px solid #c0392b;
}

.no-results-message {
    text-align: center;
    font-style: italic;
    color: #777;
    padding: 20px;
    border: 1px dashed #ccc;
    border-radius: 5px;
    margin-top: 20px;
}

/* Historical Results Table */
.table-responsive {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.history-table th, .history-table td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
}

.history-table th {
    background-color: #34495e;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
}

.history-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.history-table tbody tr:hover {
    background-color: #f1f1f1;
}

.history-table .btn-danger {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.history-table .btn-danger:hover {
    background-color: #c0392b;
}

/* Statistics Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background-color: #ecf0f1;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-bottom: 4px solid #f39c12;
}

.stat-card h3 {
    color: #2c3e50;
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 36px;
    font-weight: 700;
    color: #f39c12;
    margin: 0;
}

.stat-card small {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: 14px;
}

/* Marks Chart */
.marks-chart-section .chart-description {
    text-align: center;
    font-size: 16px;
    color: #555;
    margin-bottom: 30px;
}

.marks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    text-align: center;
}

.mark-item {
    background-color: #ecf0f1;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.mark-number {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.mark-name {
    font-size: 16px;
    color: #555;
}

.chart-legend {
    margin-top: 40px;
    text-align: center;
}

.chart-legend h4 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 15px;
}

.legend-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 16px;
    color: #555;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 10px;
}

.legend-color.animals { background-color: #27ae60; } /* Green */
.legend-color.people { background-color: #8e44ad; } /* Purple */
.legend-color.objects { background-color: #e67e22; } /* Orange */

/* Rules Section */
.rules-content {
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.rules-content h3 {
    color: #2c3e50;
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 15px;
}

.rules-content p, .rules-content ul {
    font-size: 16px;
    color: #444;
    margin-bottom: 15px;
}

.rules-content ul {
    list-style: disc;
    padding-left: 25px;
}

.rules-content ul li {
    margin-bottom: 8px;
}

/* Tips Section */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.tip-card {
    background-color: #ecf0f1;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-bottom: 4px solid #3498db; /* Blue accent */
}

.tip-card h3 {
    color: #2c3e50;
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 10px;
}

.tip-card p {
    font-size: 16px;
    color: #444;
}

/* Admin Panel */
.admin-panel {
    background-color: #e8f4f8; /* Light blue background */
    border: 2px dashed #3498db; /* Blue dashed border */
    padding: 30px;
    margin-top: 40px;
}

.admin-panel h2 {
    color: #3498db;
    margin-bottom: 30px;
}

.admin-form, .admin-actions, .bulk-import-section {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.admin-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.admin-form input[type="date"],
.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form select,
.bulk-import-section textarea {
    width: calc(100% - 22px); /* Account for padding and border */
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

.admin-form input[type="text"][readonly] {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

/* New style for checkbox group */
.checkbox-group {
    margin-bottom: 15px;
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px; /* Space between checkboxes */
}

.checkbox-group label {
    display: inline-flex; /* Align label text with checkbox */
    align-items: center;
    margin-right: 0; /* Remove default margin */
    font-weight: normal;
    color: #555;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 5px;
    width: auto; /* Reset width */
    margin-bottom: 0; /* Reset margin */
}


.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: none;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn-primary {
    background-color: #2c3e50;
    color: white;
}

.btn-primary:hover {
    background-color: #34495e;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.bulk-import-section textarea {
    resize: vertical;
    min-height: 150px;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-top: 40px;
}

.footer-links a {
    color: white;
    margin: 0 10px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #f39c12;
}

/* Admin Button (Floating) */
.admin-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease, transform 0.3s ease;
    z-index: 999;
}

.admin-button:hover {
    background-color: #2980b9;
    transform: scale(1.1);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 90px; /* Adjust to be above admin button */
    right: 20px;
    background-color: #7f8c8d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease, opacity 0.3s ease;
    opacity: 0; /* Hidden by default */
    visibility: hidden;
    z-index: 998;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #6c757d;
}

/* Admin Mode Specific Styles */
body.admin-mode .history-table th.admin-only,
body.admin-mode .history-table td.admin-only {
    display: table-cell !important; /* Override display: none */
}

/* History Controls for Full History Page */
.history-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}

.history-controls .search-input {
    flex: 1;
    min-width: 180px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

.history-controls .btn {
    padding: 10px 15px;
    font-size: 16px;
}
