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

:root {
    /* Golden Theme Palette */
    --primary-color: #F59E0B;
    /* Amber-500 */
    --primary-dark: #B45309;
    /* Amber-700 */
    --secondary-color: #D97706;
    /* Amber-600 - keeping it warm/gold */
    --accent-color: #FFD700;
    /* Gold */

    /* Text Colors - Inverted for Dark Mode */
    --text-dark: #F9FAFB;
    /* Gray-50 (Main text is now white/light) */
    --text-light: #D1D5DB;
    /* Gray-300 (Secondary text) */
    --text-muted: #9CA3AF;
    /* Gray-400 */

    /* Backgrounds */
    --bg-light: #000000;
    /* Pure Black background */
    --bg-white: #111827;
    /* Gray-900 (Cards background) */
    --bg-surface: #1F2937;
    /* Gray-800 */

    --border-color: #374151;
    /* Gray-700 */

    --error-color: #ef4444;
    --success-color: #10b981;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-light);
    /* Solid Black */
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Landing Page Styles */
.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.landing-header {
    text-align: center;
    color: white;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo-section i {
    font-size: 3rem;
    color: var(--accent-color);
}

.landing-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.welcome-section {
    text-align: center;
    color: white;
    margin-bottom: 3rem;
}

.welcome-section h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.welcome-section p {
    font-size: 1.1rem;
    opacity: 0.9;
}

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

.form-card {
    background: var(--bg-white);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.form-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.card-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #FFD700, #B45309);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    border: 2px solid #B45309;
}

.card-icon.checkin-icon {
    /* Use same gold gradient, maybe slightly different angle or just remove override */
    background: linear-gradient(135deg, #F59E0B, #B45309);
}

.card-icon i {
    font-size: 2.5rem;
    color: white;
}

.form-card h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    /* Gold text */
    margin-bottom: 1rem;
    text-align: center;
}

.form-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    text-align: center;
}

.card-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
}

.btn-primary {
    background: var(--primary-color);
    color: #000000;
    /* Black text on Gold button */
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: #000000;
    border-color: var(--primary-color);
}

.admin-section {
    text-align: center;
    margin-top: 3rem;
}

.admin-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.admin-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.landing-footer {
    text-align: center;
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.landing-footer p {
    margin: 0.5rem 0;
    opacity: 0.9;
}

.landing-footer a {
    color: var(--accent-color);
    text-decoration: none;
}

/* Form Container Styles */
.form-container {
    max-width: 900px;
    margin: 2rem auto;
    background: var(--bg-white);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.checkin-container {
    max-width: 600px;
}

.form-header {
    background: linear-gradient(135deg, #000000, #1F2937);
    border-bottom: 2px solid var(--primary-color);
    color: white;
    padding: 2rem;
    position: relative;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.header-content {
    text-align: center;
}

.header-content i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.header-content h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.header-content h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--primary-color);
    opacity: 1;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Form Styles */
.registration-form {
    padding: 2rem;
}

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

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.form-section h3 i {
    font-size: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.required {
    color: var(--error-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Radio and Checkbox Styles */
.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.3s ease;
}

.radio-label:hover,
.checkbox-label:hover {
    background: var(--bg-light);
}

.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.checkbox-grid {
    display: grid;
    gap: 0.75rem;
}

.days-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

/* Subject Selection Styles */
.subject-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
}

.year-group {
    padding: 1rem;
    background: var(--bg-white);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.year-group h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.year-group .checkbox-label {
    margin-bottom: 0.5rem;
}

/* Declaration Section */
.declaration-section {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--primary-color);
}

.declaration-label {
    font-size: 1rem;
    padding: 0;
}

.declaration-label input {
    width: 1.5rem;
    height: 1.5rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: center;
    padding: 2rem 0 1rem;
}

.btn-submit {
    background: var(--primary-color);
    /* Gold */
    color: #000000;
    font-weight: 600;
    padding: 1rem 3rem;
    font-size: 1.1rem;
}

.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 1rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--text-dark);
}

.success-content {
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}

.success-content h2 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.success-content p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

/* QR Code Styles */
#qrcode {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.qr-instruction {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Admin Dashboard Styles */
.admin-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 2rem;
}

.admin-header {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.admin-header h1 {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.stat-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.stat-card p {
    color: var(--text-light);
    font-size: 1rem;
}

.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-light);
    /* Explicit text color */
}

.tab-btn.active {
    background: var(--primary-color);
    color: #000000;
    border-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
}

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

.data-table {
    background: var(--bg-white);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table-header {
    padding: 1.5rem;
    background: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-header h2 {
    color: var(--text-dark);
}

.search-box {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    width: 300px;
    max-width: 100%;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-surface);
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
    color: var(--text-light);
}

tbody tr:hover {
    background: var(--bg-surface);
}

tbody td {
    padding: 1rem;
}

.no-data {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

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

.btn-view:hover {
    background: var(--primary-dark);
}

.btn-delete {
    background: var(--error-color);
    color: white;
    margin-left: 0.5rem;
}

.btn-delete:hover {
    background: #dc2626;
}

.export-btn {
    background: var(--secondary-color);
    color: white;
}

.export-btn:hover {
    background: #059669;
}

/* Responsive Design */
@media (max-width: 768px) {
    .landing-header h1 {
        font-size: 2rem;
    }

    .welcome-section h2 {
        font-size: 1.5rem;
    }

    .forms-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .subject-selection {
        grid-template-columns: 1fr;
    }

    .radio-group {
        flex-direction: column;
    }

    .days-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .admin-container {
        padding: 1rem;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-box {
        width: 100%;
    }

    .tabs {
        width: 100%;
    }

    .tab-btn {
        flex: 1;
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    .landing-header h1 {
        font-size: 1.5rem;
    }

    .logo-section i {
        font-size: 2rem;
    }

    .header-content h1 {
        font-size: 1.5rem;
    }

    .header-content h2 {
        font-size: 1.2rem;
    }

    .days-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        font-size: 0.9rem;
        padding: 0.65rem 1.25rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .back-btn,
    .form-actions,
    .admin-link,
    .action-btn {
        display: none;
    }

    .form-container,
    .admin-container {
        box-shadow: none;
        max-width: 100%;
    }

    .form-header {
        background: white;
        color: black;
        border-bottom: 2px solid black;
    }
}