/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    width: 90%;
    margin: 0 auto;
}

/* Header Styles */
header {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    color: #2c3e50;
}

nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: #3498db;
    padding: 8px 15px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

nav a:hover {
    background-color: #3498db;
    color: white;
}

/* Mobile-only hamburger and drawer */
.mobile-only {
    display: none;
}

.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #2c3e50;
    margin: 3px 0;
    border-radius: 2px;
}

.header-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-nav {
    position: fixed;
    inset: 0;
    display: none;
}

.mobile-nav.open {
    display: block;
}

.mobile-nav__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}

.mobile-nav__panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 82%;
    max-width: 340px;
    height: 100%;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-right: 1px solid #eee;
    transform: translateX(-100%);
    animation: slideIn .22s ease forwards;
    display: flex;
    flex-direction: column;
}

.mobile-nav__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
}

.mobile-nav__title {
    font-weight: 600;
    color: #2c3e50;
}

.close-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 18px;
}

.mobile-nav__list {
    display: flex;
    flex-direction: column;
    padding: 8px;
}

.mobile-link {
    display: block;
    padding: 12px 14px;
    border-radius: 8px;
    color: #2c3e50;
    text-decoration: none;
    border: 1px solid transparent;
}

.mobile-link:hover {
    background: #f5f5f5;
    border-color: #eee;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

/* Dark theme for mobile drawer */
[data-theme="dark"] .hamburger-btn {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

[data-theme="dark"] .hamburger-btn span {
    background: #f0f0f0;
}

[data-theme="dark"] .mobile-nav__panel {
    background: #1a1a1a;
    border-right-color: #2a2a2a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .mobile-nav__header {
    border-bottom-color: #2a2a2a;
}

[data-theme="dark"] .mobile-nav__title {
    color: #f0f0f0;
}

[data-theme="dark"] .close-btn {
    background: #1a1a1a;
    border-color: #2a2a2a;
    color: #f0f0f0;
}

[data-theme="dark"] .mobile-link {
    color: 18191A;
}

[data-theme="dark"] .mobile-link:hover {
    background: #222;
    border-color: #2a2a2a;
}

/* Visibility rules: mobile shows drawer, hides desktop nav */
@media (max-width: 768px) {
    .mobile-only {
        display: inline-flex;
    }

    .hamburger-btn {
        display: inline-flex;
    }

    .mag-nav {
        display: none;
    }
}

/* Form Styles */
.form-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 0 auto;
}

.form-container h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 16px;
}

.btn {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-success {
    background-color: #2ecc71;
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-warning {
    background-color: #f39c12;
}

.btn-warning:hover {
    background-color: #d35400;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
    width: auto;
}

/* Messages */
.error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 3px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.success {
    background-color: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 3px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #3498db;
    color: white;
    font-weight: bold;
}

table tr:hover {
    background-color: #f5f5f5;
}

.status {
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: bold;
}

.status.active {
    background-color: #2ecc71;
    color: white;
}

.status.banned {
    background-color: #e74c3c;
    color: white;
}

/* Welcome/Dashboard */
.welcome,
.dashboard {
    background-color: #fff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.welcome h2,
.dashboard h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

/* Event Styles */
.event-card {
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px;
    width: 300px;
}

.event-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 3px;
}

.event-title {
    margin: 10px 0 5px;
}

.event-description {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.event-fee {
    margin: 5px 0;
    font-weight: bold;
}

/* Responsive */
/* Dark Theme Overrides */
[data-theme="dark"] body {
    background-color: #121212;
    color: 18191A;
}

[data-theme="dark"] header,
[data-theme="dark"] .welcome,
[data-theme="dark"] .dashboard,
[data-theme="dark"] table,
[data-theme="dark"] .event-card {
    background-color: #1a1a1a;
    color: 18191A;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] header h1,
[data-theme="dark"] .welcome h2,
[data-theme="dark"] .dashboard h2 {
    color: #f0f0f0;
}

[data-theme="dark"] nav a {
    color: #8ab4f8;
}

[data-theme="dark"] nav a:hover {
    background-color: #2b4ea1;
    color: #fff;
}

[data-theme="dark"] table th {
    background-color: #2b4ea1;
}

[data-theme="dark"] table tr:hover {
    background-color: #1f1f1f;
}

[data-theme="dark"] .event-description {
    color: #b3b3b3;
}

[data-theme="dark"] .btn {
    background-color: #4e8ef7;
}

[data-theme="dark"] .btn:hover {
    background-color: #3b78e7;
}

[data-theme="dark"] .btn-danger {
    background-color: #cf6679;
}

[data-theme="dark"] .btn-danger:hover {
    background-color: #b84f60;
}

[data-theme="dark"] .btn-success {
    background-color: #34a853;
}

[data-theme="dark"] .btn-success:hover {
    background-color: #2c8b45;
}

[data-theme="dark"] .btn-warning {
    background-color: #f4b400;
}

[data-theme="dark"] .btn-warning:hover {
    background-color: #d39e00;
}

[data-theme="dark"] .error {
    background-color: #3a1f24;
    color: #f6b7bf;
    border-color: #5a2f36;
}

[data-theme="dark"] .success {
    background-color: #1f3a24;
    color: #b7f6c6;
    border-color: #2f5a3a;
}

/* Utilities for modern layout */
.events-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #3498db;
    object-fit: cover;
}

.avatar-fallback {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #3498db;
    color: #7f8c8d;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }

    nav {
        margin-top: 15px;
        justify-content: center;
    }

    .container {
        width: 95%;
        padding: 10px;
    }

    .form-container {
        padding: 20px;
    }

    .event-card {
        width: 100%;
        margin-bottom: 20px;
    }
}

/* Magazine-style layout enhancements */
.mag-page {
    gap: 20px;
}

.mag-header {
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 10px;
}

.mag-nav a {
    background: #fafafa;
    border: 1px solid #eee;
}

.mag-nav a:hover {
    background: #f0f0f0;
}

.section-title {
    font-size: 22px;
    letter-spacing: 0.3px;
    color: #2c3e50;
    margin-bottom: 12px;
    text-align: left;
}

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    border: 1px solid #eee;
}

.card:hover {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.profile-card {
    text-align: left;
}

.profile-card .profile-info p {
    margin: 6px 0;
}

.mag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.event-card {
    width: auto;
}

/* allow grid to control width */
.event-title {
    font-weight: 600;
}

.event-description {
    line-height: 1.5;
}

/* Dark theme overrides for magazine elements */
[data-theme="dark"] .mag-header {
    border-bottom-color: #2a2a2a;
}

[data-theme="dark"] .mag-nav a {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

[data-theme="dark"] .mag-nav a:hover {
    background: #222;
}

[data-theme="dark"] .section-title {
    color: #f0f0f0;
}

[data-theme="dark"] .card {
    background: #1a1a1a;
    border-color: #2a2a2a;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .card:hover {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

/* Responsive tweaks */
@media (min-width: 992px) {
    .section-title {
        font-size: 24px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    border-radius: 5px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Bottom Navigation (mobile only) */
.bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    :root {
        --bn-height: 64px;
    }

    .bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: var(--bn-height);
        background: #fff;
        border-top: 1px solid #eee;
        display: flex;
        z-index: 999;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .bottom-nav .bn-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #2c3e50;
        font-size: 12px;
        gap: 4px;
    }

    .bottom-nav .bn-item .bn-icon {
        font-size: 18px;
    }

    .bottom-nav .bn-item.active {
        color: #3498db;
        font-weight: 600;
    }

    /* Prevent content from being obscured by bottom nav */
    .container {
        padding-bottom: calc(var(--bn-height) + env(safe-area-inset-bottom));
    }
}

/* Accessibility focus improvements */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Dark theme for bottom nav */
[data-theme="dark"] .bottom-nav {
    background: #1a1a1a;
    border-top-color: #2a2a2a;
}

[data-theme="dark"] .bottom-nav .bn-item {
    color: 18191A;
}

[data-theme="dark"] .bottom-nav .bn-item.active {
    color: #7cc8ff;
}

/* Additional styles from index.php */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #27ae60;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --success-color: #27ae60;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    padding-bottom: 60px;
    /* Space for bottom nav on mobile */
}

/* Header Styles */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-links a,
.header-actions a {
    color: #00008B;
    /* Dark blue */
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-links a:hover,
.header-actions a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: var(--border-radius);
}

/* Main Content */
main {
    margin: 30px 0;
}

.page-title {
    font-size: 2.2rem;
    color: var(--secondary-color);
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
}

.page-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.section-title {
    font-size: 1.8rem;
    color: var(--secondary-color);
    font-weight: 700;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.event-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.event-thumbnail-container {
    height: 200px;
    overflow: hidden;
}

.event-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.event-card:hover .event-thumbnail {
    transform: scale(1.05);
}

.event-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.event-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.event-description {
    color: #666;
    margin-bottom: 15px;
    flex-grow: 1;
}

.event-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.event-fee {
    background-color: #e3f2fd;
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.event-participants {
    background-color: #e8f5e9;
    color: var(--success-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.event-winner {
    background-color: #fff8e1;
    color: #f39c12;
    padding: 10px;
    border-radius: var(--border-radius);
    text-align: center;
    margin: 10px 0;
    font-weight: 600;
}

.event-actions {
    margin-top: 15px;
}

.btn-participate {
    width: 100%;
    padding: 12px;
    font-weight: 600;
}

/* Messages */
.message {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    text-align: center;
}

.message.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.message.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

/* Welcome Section */
.welcome-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 40px;
    text-align: center;
    margin-bottom: 40px;
}

.welcome-card h2 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.welcome-card p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 25px;
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
    border-top: 1px solid #eee;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #00008B;
    /* Dark blue */
    font-size: 0.8rem;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 8px;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item:hover {
    color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.1);
}

.nav-icon {
    font-size: 1.2rem;
    margin-bottom: 3px;
}

/* Mobile Navigation */
.mobile-nav-trigger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Desktop Specific Styles */
@media (min-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .events-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 30px;
    }

    .event-title {
        font-size: 1.6rem;
    }

    .btn {
        padding: 14px 28px;
        font-size: 1.1rem;
    }

    /* Hide bottom nav on desktop */
    .bottom-nav {
        display: none;
    }

    body {
        padding-bottom: 0;
    }
}

/* Large Desktop (1920x1080 and above) */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
        padding: 40px;
    }

    .events-grid {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
        gap: 35px;
    }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1199px) {
    .container {
        padding: 25px;
    }

    .events-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 20px;
    }

    /* Hide bottom nav on tablet */
    .bottom-nav {
        display: none;
    }

    body {
        padding-bottom: 0;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .mobile-nav-trigger {
        display: block;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--secondary-color);
        flex-direction: column;
        padding: 20px;
        gap: 10px;
        z-index: 99;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .header-content {
        gap: 10px;
    }

    .header-actions {
        gap: 10px;
    }

    .events-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .container {
        padding: 15px;
    }

    main {
        margin: 20px 0;
    }

    .welcome-card {
        padding: 25px;
    }

    .welcome-card h2 {
        font-size: 1.6rem;
    }

    .welcome-card p {
        font-size: 1rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .logo {
        font-size: 1.5rem;
        justify-content: center;
    }

    .nav-links {
        top: 80px;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .event-meta {
        flex-direction: row !important;
        justify-content: space-between !important;
        gap: 5px !important;
        font-size: 0.85rem !important;
    }

    .event-fee,
    .event-participants {
        padding: 4px 8px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 48% !important;
    }

    .event-meta {
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* Icons */
.icon {
    font-size: 1.2em;
}

/* High Resolution Screens */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    header,
    .event-card,
    .welcome-card {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    }
}

/* Print Styles */
@media print {

    header,
    footer,
    .nav-links,
    .mobile-nav-trigger,
    .bottom-nav {
        display: none;
    }

    .event-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Additional styles from admin.php */
.admin-section {
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.points-adjust-form {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
}

.points-adjust-form input,
.points-adjust-form textarea {
    flex: 1;
    min-width: 150px;
}

.transaction-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.transaction-table th,
.transaction-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.transaction-table th {
    background-color: #f2f2f2;
}

.amount-positive {
    color: #27ae60;
}

.amount-negative {
    color: #e74c3c;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.status-pending {
    background-color: #f39c12;
    color: white;
}

.status-approved {
    background-color: #27ae60;
    color: white;
}

.status-denied {
    background-color: #e74c3c;
    color: white;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
}

.tab.active {
    background-color: white;
    border-bottom: 1px solid white;
    margin-bottom: -1px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-primary {
    background-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
}

.btn-success:hover {
    background-color: #219653;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: #f39c12;
}

.btn-warning:hover {
    background-color: #d68910;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.table-responsive {
    overflow-x: auto;
}

th,
td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
}

.status {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.status.active {
    background-color: #27ae60;
    color: white;
}

.status.banned {
    background-color: #e74c3c;
    color: white;
}

/* Additional styles from profile.php */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.profile-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: var(--transition);
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.profile-header {
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    color: white;
    padding: 30px;
    text-align: center;
}

.profile-avatar-container {
    margin: 0 auto 20px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid white;
    overflow: hidden;
    background-color: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-fallback {
    font-size: 4rem;
    color: #7f8c8d;
}

.profile-username {
    font-size: 2rem;
    font-weight: 700;
    margin: 15px 0 5px;
}

.profile-email {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.profile-points {
    font-size: 2.2rem;
    font-weight: 700;
    color: #f1c40f;
    margin: 15px 0;
}

.profile-body {
    padding: 30px;
    background-color: #192a56;
    /* Dark blue background */
    color: #ffffff;
    /* White text for better contrast */
}

.profile-section {
    margin-bottom: 30px;
}

.profile-section-title {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.profile-bio {
    line-height: 1.7;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-group .btn {
    flex: 1;
    min-width: 120px;
}

.amount-positive {
    color: var(--success-color);
    font-weight: 600;
}

.amount-negative {
    color: var(--danger-color);
    font-weight: 600;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Additional styles from create_event_post.php */
.post-form {
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 20px auto;
}

/* Additional styles from install.php */
.install-container {
    max-width: 600px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.install-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

/* Additional styles from fix_database.php */
.fix-container {
    max-width: 600px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.fix-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

/* Additional styles from update_database.php */
.update-container {
    max-width: 600px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.update-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

/* Light Theme Overrides */
body {
    background-color: #f4f4f4;
    color: #333;
}

header,
.welcome,
.dashboard,
table,
.event-card {
    background-color: #fff;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1,
.welcome h2,
.dashboard h2 {
    color: #2c3e50;
}

nav a {
    color: #3498db;
}

nav a:hover {
    background-color: #3498db;
    color: #fff;
}

table th {
    background-color: #3498db;
    color: #fff;
}

table tr:hover {
    background-color: #f5f5f5;
}

.event-description {
    color: #666;
}

.btn {
    background-color: #3498db;
    color: #fff;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-danger {
    background-color: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-success {
    background-color: #2ecc71;
    color: #fff;
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-warning {
    background-color: #f39c12;
    color: #fff;
}

.btn-warning:hover {
    background-color: #d35400;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

/* Pagination Styles */
.pagination {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination a {
    background-color: #f8f9fa;
    color: #3498db;
    border: 1px solid #dee2e6;
}

.pagination a:hover {
    background-color: #e9ecef;
    color: #2980b9;
}

.pagination .btn-primary {
    background-color: #3498db;
    color: white;
    border: 1px solid #3498db;
}

.pagination .btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

/* Event Details Page Styles */
.event-detail-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.event-detail-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 800px;
    width: 100%;
}

.event-detail-header {
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.event-detail-title {
    margin: 0;
    color: #2c3e50;
    font-size: 2rem;
}

.event-detail-content {
    padding: 20px;
}

.event-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.event-detail-fee,
.event-detail-date,
.event-detail-participants {
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.event-detail-description {
    margin-bottom: 20px;
}

.event-detail-description h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.event-detail-description p {
    line-height: 1.6;
    color: #555;
}

.event-detail-winner {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #e8f4f8;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.event-detail-winner h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.event-detail-winner p {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.event-detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.event-detail-actions .btn {
    flex: 1;
    min-width: 150px;
}

/* Dark theme for event details */
[data-theme="dark"] .event-detail-card {
    background-color: #1a1a1a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .event-detail-header {
    background-color: #2a2a2a;
    border-bottom-color: #333;
}

[data-theme="dark"] .event-detail-title {
    color: #f0f0f0;
}

[data-theme="dark"] .event-detail-meta {
    border-bottom-color: #333;
}

[data-theme="dark"] .event-detail-fee,
[data-theme="dark"] .event-detail-date,
[data-theme="dark"] .event-detail-participants {
    background-color: #2a2a2a;
    color: #f0f0f0;
}

[data-theme="dark"] .event-detail-description h3,
[data-theme="dark"] .event-detail-winner h3 {
    color: #f0f0f0;
}

[data-theme="dark"] .event-detail-description p {
    color: #ccc;
}

[data-theme="dark"] .event-detail-winner {
    background-color: #1e3a5f;
    border-left-color: #3498db;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    max-height: 80%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
}

.modal-content:hover {
    transform: translate(-50%, -50%) scale(1.02);
    transition: transform 0.2s;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close:hover {
    color: #bbb;
}

.modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* Zoom Controls */
.modal-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 1002;
}

.zoom-btn {
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    color: #333;
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.zoom-btn:hover {
    background-color: rgba(255, 255, 255, 1);
}

/* Dark theme for zoom controls */
[data-theme="dark"] .zoom-btn {
    background-color: rgba(50, 50, 50, 0.8);
    color: #f1f1f1;
}

[data-theme="dark"] .zoom-btn:hover {
    background-color: rgba(70, 70, 70, 1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: 95%;
    }

    .modal-controls {
        bottom: 10px;
    }

    .zoom-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Ensure consistent aspect ratio for event thumbnails */
.event-detail-thumbnail-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.event-detail-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}

.event-detail-thumbnail:hover {
    transform: scale(1.02);
}

.event-detail-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ecf0f1;
    color: #7f8c8d;
}

/* Dark theme for modal */
[data-theme="dark"] .modal {
    background-color: rgba(0, 0, 0, 0.95);
}

[data-theme="dark"] .close {
    color: #f1f1f1;
}

[data-theme="dark"] .close:hover {
    color: #bbb;
}

[data-theme="dark"] .modal-caption {
    color: #ccc;
}