/**
 * NDC Event Management System
 * Modern CSS Styling - No Purple Backgrounds
 */

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #94a3b8;
    --success-color: #22c55e;
    --warning-color: #fbbf24;
    --error-color: #f87171;
    --info-color: #60a5fa;
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Global heading sizes */
h1 {
    font-size: 1.5rem;
}

h2 {
    font-size: 1.25rem;
}

h3 {
    font-size: 1.1rem;
}

h4 {
    font-size: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    min-height: calc(100vh - 200px);
}

/* Add padding top for fixed header when no sidebar */
body:not(.has-sidebar) .container {
    padding-top: 80px;
}

/* Mobile container padding */
@media (max-width: 768px) {
    .container {
        padding-bottom: 80px; /* Space for mobile bottom nav */
    }
}

/* Logo */
.logo-img {
    max-height: 35px;
    width: auto;
    margin-right: 0.75rem;
}

/* Header */
.main-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    box-sizing: border-box;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    display: none; /* Hide the text, show only logo */
}

.main-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-menu span {
    color: var(--text-secondary);
    font-weight: 500;
}

.user-menu .material-icons {
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .main-header {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
    }
    
    .header-content {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0.75rem 1rem;
    }
    
    .user-menu span:not(.material-icons) {
        display: none; /* Hide username text on mobile, show icon only */
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .logo-img {
        max-height: 35px;
    }
}

/* Landing Page */
.landing-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.landing-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.5rem 0;
    min-height: auto;
}

.landing-header .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 2rem;
}

.landing-header .logo-img {
    max-height: 35px;
}

.landing-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: nowrap;
}

.landing-nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s;
    white-space: nowrap;
    padding: 0.25rem 0;
}

.landing-nav a:hover {
    color: var(--primary-color);
}

.landing-nav .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.hero-section {
    padding: 6rem 2rem;
    text-align: center;
    color: white;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.about-section,
.registration-section,
.features-section,
.participants-section {
    padding: 4rem 2rem;
    background-color: var(--surface-color);
}

.about-section h2,
.registration-section h2,
.features-section h2,
.participants-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.about-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.about-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.about-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.registration-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.info-box {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.info-box h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-item {
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
}

.feature-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.participants-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.participant-category {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.participant-category h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.landing-footer {
    background-color: var(--text-primary);
    color: white;
    padding: 2rem;
    text-align: center;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
}

.footer-links a:hover {
    opacity: 1;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}

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

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

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

.btn-secondary:hover {
    background-color: #475569;
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
}

.btn-large {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* Forms */
.content-box {
    background-color: var(--surface-color);
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.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-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

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

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background-color: var(--surface-color);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo-img {
    margin: 0 auto 1rem;
    display: block;
}

.login-header h1 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
}

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

.login-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

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

/* Alerts */
.alert {
    padding: 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background-color: var(--surface-color);
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2rem;
}

.stat-content h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.125rem;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.dashboard-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.dashboard-card canvas {
    max-height: 300px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.data-table thead {
    background-color: var(--bg-color);
    transition: background-color 0.3s ease;
}

.data-table th {
    padding: 0.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    transition: color 0.3s ease, border-color 0.3s ease;
    font-size: 0.875rem;
}

.data-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: color 0.3s ease, border-color 0.3s ease;
    font-size: 0.875rem;
}

.data-table tbody tr {
    background-color: var(--surface-color);
    transition: background-color 0.3s ease;
}

.data-table tbody tr:hover {
    background-color: var(--bg-color);
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Reports */
.report-filters {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.filter-form .form-row {
    align-items: flex-end;
}

.report-section {
    margin-bottom: 2rem;
}

.report-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

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

.report-card {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.report-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.stat-box {
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: var(--radius);
}

.stat-box h4 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-row:last-child {
    border-bottom: none;
}

/* Footer */
.main-footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    margin-top: 4rem;
}

/* Material Icons */
.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    vertical-align: middle;
}

.material-icons.md-18 { font-size: 18px; }
.material-icons.md-24 { font-size: 24px; }
.material-icons.md-36 { font-size: 36px; }
.material-icons.md-48 { font-size: 48px; }

/* Mobile Bottom Navigation - Only visible on mobile */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: var(--surface-color);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        padding: 0.5rem 0;
    }
    
    /* Remove left and right padding on mobile */
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .content-box,
    .dashboard-card,
    .report-card {
        margin-left: 0;
        margin-right: 0;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

.mobile-nav-items {
    display: flex;
    width: 100%;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 0.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s;
    min-height: 60px;
    position: relative;
}

.mobile-nav-item.active {
    color: var(--primary-color);
}

.mobile-nav-item .material-icons {
    font-size: 24px;
    margin-bottom: 0.25rem;
}

.mobile-nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

.mobile-nav-item:active {
    transform: scale(0.95);
}

.mobile-nav-item button {
    background: none;
    border: none;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: inherit;
    cursor: pointer;
    padding: 0;
}

/* Full Screen Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface-color);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    display: none;
}

.menu-overlay.active {
    transform: translateX(0);
    display: block;
}

.menu-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--primary-color);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1;
}

.menu-overlay-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
}

.menu-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: background 0.2s;
}

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

.menu-overlay-content {
    padding: 2rem 1.5rem;
}

.menu-stats-section {
    margin-bottom: 2rem;
}

.menu-stats-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.menu-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.menu-stat-item {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
}

.menu-stat-item .material-icons {
    font-size: 2rem;
    color: var(--primary-color);
}

.menu-stat-item strong {
    display: block;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.menu-stat-item small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.menu-links-section {
    margin-bottom: 2rem;
}

.menu-links-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.menu-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.menu-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

.menu-link .material-icons {
    font-size: 1.5rem;
}

.menu-link.logout-link {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.menu-link.logout-link:hover {
    background: #dc2626;
}

.menu-user-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.menu-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.menu-user-info .material-icons {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.menu-user-info strong {
    display: block;
    color: var(--text-primary);
}

.menu-user-info small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Body padding for mobile bottom nav */
body.has-mobile-nav {
    padding-bottom: 70px;
}

/* Mobile-friendly container */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
        padding-bottom: 5rem; /* Space for bottom nav */
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: row;
        align-items: center;
        padding: 0.75rem 1rem;
    }
    
    .main-nav {
        display: none; /* Hide desktop nav on mobile */
    }
    
    .mobile-bottom-nav {
        display: flex;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .stat-content h3 {
        font-size: 1.5rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .content-box {
        padding: 0.75rem;
    }
    
    h1 {
        font-size: 1.25rem;
    }
    
    h2 {
        font-size: 1.1rem;
    }
    
    h3 {
        font-size: 1rem;
    }
    
    .login-box {
        padding: 2rem 1.5rem;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch-friendly buttons on mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px; /* iOS touch target size */
        min-width: 44px;
    }
    
    .mobile-nav-item {
        min-height: 60px;
        min-width: 60px;
    }
}

/* Dashboard Widgets */
.dashboard-card h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-card h2 .material-icons {
    color: var(--primary-color);
}

.top-schools-list {
    max-height: 300px;
    overflow-y: auto;
}

.top-school-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.top-school-item:hover {
    background: var(--bg-color);
}

.top-school-item:last-child {
    border-bottom: none;
}

.school-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.875rem;
}

.school-info {
    flex: 1;
}

.school-info strong {
    display: block;
    color: var(--text-primary);
}

.school-info small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
}

.quick-action-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quick-action-btn .material-icons {
    font-size: 2rem;
}

.recent-activity {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item .material-icons {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.activity-item strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.activity-item small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    overflow-y: auto;
}

.modal.show,
.modal[style*="display: flex"],
.modal[style*="display:flex"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all 0.2s;
    width: 36px;
    height: 36px;
}

.modal-close:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-body .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-body .form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Mobile modal adjustments */
@media (max-width: 768px) {
    .modal {
        padding: 0;
    }
    
    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-body .form-row {
        grid-template-columns: 1fr;
    }
}

/* Participants Table Container - Fixed Height with Scroll */
.participants-table-container,
.schools-table-container {
    height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    position: relative;
}

.participants-table-container table,
.schools-table-container table {
    margin: 0;
    width: 100%;
    table-layout: auto;
}

.participants-table-container table td,
.participants-table-container table th,
.schools-table-container table td,
.schools-table-container table th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.participants-table-container thead,
.schools-table-container thead {
    position: sticky;
    top: 0;
    background-color: var(--surface-color);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.participants-table-container thead th,
.schools-table-container thead th {
    background-color: var(--surface-color);
    padding: 1rem;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.participants-table-container tbody tr,
.schools-table-container tbody tr {
    transition: background-color 0.2s;
}

.participants-table-container tbody tr:hover,
.schools-table-container tbody tr:hover {
    background-color: var(--bg-color);
}

/* Scrollbar styling */
.participants-table-container::-webkit-scrollbar,
.schools-table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.participants-table-container::-webkit-scrollbar-track,
.schools-table-container::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.participants-table-container::-webkit-scrollbar-thumb,
.schools-table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.participants-table-container::-webkit-scrollbar-thumb:hover,
.schools-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Event Details Styles */
.event-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

.detail-item span {
    color: var(--text-secondary);
}

.school-details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 1200px) {
    .school-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .school-details-grid {
        grid-template-columns: 1fr;
    }
}

.school-detail-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.school-detail-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.school-detail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 10px;
    flex-shrink: 0;
}

[data-theme="dark"] .school-detail-icon {
    background: rgba(59, 130, 246, 0.15);
}

.school-detail-content {
    flex: 1;
    min-width: 0;
}

.school-detail-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.school-detail-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    word-wrap: break-word;
    line-height: 1.5;
}

.school-detail-value a:hover {
    text-decoration: underline;
}

.event-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

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

.fee-card {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.fee-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.fee-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fee-content h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.fee-amount {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Sidebar Navigation Styles */
body.has-sidebar {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

.sidebar {
    width: 260px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 90;
    transition: width 0.3s ease, transform 0.3s ease;
    box-shadow: var(--shadow-md);
    overflow-y: auto;
    overflow-x: hidden;
    /* Hide scrollbar but keep scrolling functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sidebar::-webkit-scrollbar {
    display: none;
}

/* Ensure sidebar is visible on desktop */
@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
        display: flex !important;
    }
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 70px;
}

.sidebar-logo {
    max-height: 40px;
    width: auto;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-title {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    margin: 0 0.5rem;
    border-radius: var(--radius);
}

.sidebar-nav-item:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-nav-item.active {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.sidebar-nav-item .material-icons {
    font-size: 24px;
    width: 24px;
    flex-shrink: 0;
}

.sidebar-nav-text {
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-toggle {
    position: absolute;
    top: 1rem;
    right: -15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100;
}

.sidebar-toggle:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.sidebar-toggle .material-icons {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle .material-icons {
    transform: rotate(180deg);
}

/* Main content area with sidebar */
.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 260px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    width: calc(100% - 260px);
    max-width: calc(100% - 260px);
    overflow-x: hidden;
    padding-top: 100px; /* Space for fixed header */
}

.sidebar.collapsed ~ .main-content-wrapper,
body.has-sidebar .sidebar.collapsed ~ .main-content-wrapper {
    margin-left: 70px;
    width: calc(100% - 70px);
    max-width: calc(100% - 70px);
}

/* Header adjustments with sidebar */
body.has-sidebar .main-header {
    position: fixed;
    left: 260px;
    width: calc(100% - 260px);
    z-index: 80;
}

.sidebar.collapsed ~ .main-content-wrapper .main-header,
body.has-sidebar .sidebar.collapsed ~ .main-content-wrapper .main-header {
    left: 70px;
    width: calc(100% - 70px);
}

body.has-sidebar .header-content {
    max-width: 100%;
}

body.has-sidebar .user-menu {
    margin-left: auto;
}

body.has-sidebar .user-name {
    display: inline;
}

/* Theme Toggle Icon - White */
.theme-toggle .material-icons,
.theme-toggle #themeIcon {
    color: white !important;
}

/* Container adjustments */
body.has-sidebar .container {
    max-width: 100%;
    width: 100%;
    padding: 2rem;
    padding-top: 1.5rem; /* Reduced since main-content-wrapper already has padding-top */
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-primary);
    margin-right: 1rem;
}

.mobile-menu-toggle .material-icons {
    font-size: 28px;
}

/* Mobile sidebar */
@media (max-width: 768px) {
    /* Ensure body and html are full width */
    html, body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    body.has-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .sidebar {
        transform: translateX(-100%) !important;
        width: 100vw !important;
        max-width: 100vw !important;
        box-shadow: none;
        z-index: 1000 !important;
        transition: transform 0.3s ease;
        position: fixed !important;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0) !important;
        box-shadow: var(--shadow-lg);
    }
    
    .main-content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding-top: 90px; /* Space for fixed header on mobile */
    }
    
    /* Ensure content is not hidden when sidebar is closed */
    body:not(.sidebar-open) .main-content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Override any collapsed sidebar width calculations on mobile */
    .sidebar.collapsed ~ .main-content-wrapper,
    body.has-sidebar .sidebar.collapsed ~ .main-content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Fix header width on mobile - should be full width */
    body.has-sidebar .main-header {
        left: 0 !important;
        width: 100% !important;
        right: 0 !important;
    }
    
    .sidebar.collapsed ~ .main-content-wrapper .main-header,
    body.has-sidebar .sidebar.collapsed ~ .main-content-wrapper .main-header {
        left: 0 !important;
        width: 100% !important;
        right: 0 !important;
    }
    
    /* Ensure header-content spans full width on mobile */
    body.has-sidebar .header-content {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Ensure all containers are full width on mobile */
    .container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    body.has-sidebar .container {
        padding-bottom: 80px;
        padding-top: 1rem;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Ensure sidebar doesn't take up space when hidden */
    .sidebar:not(.mobile-open) {
        position: fixed !important;
        transform: translateX(-100%) !important;
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    /* Show mobile menu button on mobile */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Overlay for mobile sidebar - handled by JavaScript */
    #sidebar-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background-color: rgba(0, 0, 0, 0.6) !important;
        z-index: 999 !important;
    }
    
    /* Ensure sidebar is above overlay when open */
    .sidebar.mobile-open {
        z-index: 1000 !important;
    }
    
    /* Prevent content shift when sidebar opens */
    body.sidebar-open {
        overflow: hidden;
    }
    
    body.sidebar-open .main-content-wrapper {
        position: relative;
        z-index: 1;
    }
}

