:root {
    --primary: #3B82F6;
    --bg: #121212;
    --card-bg: #1E1E1E;
    --text: #ffffff;
    --text-muted: #aaaaaa;
    --border: #333333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    padding-bottom: 70px;
    /* Space for bottom nav */
}

/* --- NAVIGATION --- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    font-size: 1.2rem;
    font-weight: bold;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 60px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

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

/* --- SIDEBAR --- */
.sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    transition: 0.3s;
    padding: 20px;
    z-index: 200;
    padding-top: 80px;
}

.sidebar.open {
    left: 0;
}

/* --- LAYOUTS --- */
.content-wrapper {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    padding-bottom: 5px;
}

/* --- FORMS & BUTTONS --- */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

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

.form-group {
    margin-bottom: 15px;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px;
    background: #2a2a2a;
    border: 1px solid #444;
    color: white;
    border-radius: 6px;
    margin-top: 5px;
}

/* --- CLUBS GRID (NEW DESIGN) --- */
.clubs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    /* Responsive Grid */
    gap: 20px;
    margin-top: 20px;
}

.club-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
}

.club-card:hover {
    transform: translateY(-5px);
    border-color: #555;
}

.club-banner {
    height: 70px;
    width: 100%;
    position: relative;
}

.club-logo {
    width: 45px;
    height: 45px;
    background: #252525;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: absolute;
    bottom: -22px;
    left: 15px;
    border: 3px solid var(--card-bg);
}

.club-card-body {
    padding: 30px 15px 15px 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    align-self: flex-start;
    text-transform: uppercase;
    font-weight: bold;
    color: #fff;
}

/* --- TABS (NEW PILL DESIGN) --- */
.tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.tab {
    padding: 6px 16px;
    background: #2a2a2a;
    border-radius: 20px;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid #444;
}

.tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* --- CALENDAR --- */
.calendar-grid-header,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

.day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
}

.day.today {
    border: 1px solid var(--primary);
    color: var(--primary);
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    position: absolute;
    bottom: 4px;
}

/* --- MODALS --- */
.hidden {
    display: none !important;
}

.event-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-modal-card {
    background: var(--card-bg);
    width: 90%;
    max-width: 400px;
    padding: 20px;
    border-radius: 12px;
}

.event-modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

/* --- CLUBS GRID (NEW DESIGN) --- */
.clubs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    /* Responsive Grid */
    gap: 20px;
    margin-top: 20px;
}

.club-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
}

.club-card:hover {
    transform: translateY(-5px);
    border-color: #555;
}

.club-banner {
    height: 70px;
    width: 100%;
    position: relative;
}

.club-logo {
    width: 45px;
    height: 45px;
    background: #252525;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: absolute;
    bottom: -22px;
    left: 15px;
    border: 3px solid var(--card-bg);
}

.club-card-body {
    padding: 30px 15px 15px 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    align-self: flex-start;
    text-transform: uppercase;
    font-weight: bold;
    color: #fff;
}

/* The Edit Button Style */
.edit-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    /* Ensures it sits on top of the banner */
    transition: all 0.2s ease;
}

.edit-btn:hover {
    background: white;
    color: black;
    transform: scale(1.1);
}

/* --- Home Page Grid Layout --- */
#my-schedule-list {
    display: grid;
    /* This creates columns automatically. Min 160px wide, Max 1fr */
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.schedule-card {
    background: #1e1e1e;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #333;
    border-left: 4px solid var(--primary);
    /* Keeps your accent color */

    /* Make it a square-ish shape */
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Pushes 'Going' badge to bottom */
    transition: transform 0.2s;
}

.schedule-card:hover {
    transform: translateY(-3px);
    background: #252525;
}

.schedule-card h4 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    /* Limit title to 3 lines to fit in square */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.schedule-card .meta {
    font-size: 0.8rem;
    color: #888;
    margin-top: 8px;
}

/* --- SHARED GRID LAYOUT (Home Page) --- */
.events-grid {
    display: grid;
    /* Auto-fit columns: Min 160px wide, Max fills space */
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 30px;
    /* Space between sections */
}

/* The Square Card Styling */
.schedule-card {
    background: #1e1e1e;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #333;
    border-left: 4px solid var(--primary);

    /* Force Square Shape */
    aspect-ratio: 1 / 1;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, background 0.2s;
    cursor: pointer;
    /* Indicates clickable */
}

.schedule-card:hover {
    transform: translateY(-3px);
    background: #252525;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.schedule-card h4 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    /* Cut off text after 3 lines */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.schedule-card .meta {
    font-size: 0.8rem;
    color: #888;
    margin-top: 8px;
}

/* SECURITY / UI HIDING */
/* Hide admin elements by default. JS will show them if authorized. */
.admin-only {
    display: none !important;
}

/* When JS determines user is admin, we switch this class */
.is-admin-visible {
    display: inline-flex !important; /* or block/flex depending on element */
}
/* --- 1. GLOBAL BLACK BACKGROUND --- */
body {
    background-color: #000000 !important;
    /* Pure Black */
    color: #ffffff;
}

/* --- 2. HIDE NAV/HEADER BACKGROUNDS --- */
/* This makes the top header blend into the black body */
header,
nav,
.top-bar {
    background-color: #000000 !important;
    border-bottom: 1px solid #1a1a1a;
    /* Very subtle separation */
}

/* Bottom Navigation Bar (if you use it) */
.bottom-nav {
    background-color: #000000 !important;
    border-top: 1px solid #1a1a1a;
}

/* --- 3. INTERACTIVE ELEMENTS (GREY) --- */
/* Cards, Inputs, and Modals get the grey "surface" color */
.card,
.club-card,
.schedule-card,
.event-item,
#calendarDays .day,
.modal-content {
    background-color: #1e1e1e !important;
    /* Dark Grey */
    border: 1px solid #333;
    /* Slight border for definition */
}

/* Inputs should also use the grey surface */
input,
select,
textarea {
    background-color: #1e1e1e !important;
    color: white !important;
    border: 1px solid #444 !important;
}

/* --- 4. SIDEBAR --- */
#sidebar {
    background-color: #111111 !important;
    /* Slightly lighter than pure black */
}

/* --- FIX: FORCE FULL BLACK BACKGROUND --- */
html,
body {
    height: 100%;
    /* Force them to fill the window height */
    margin: 0;
    padding: 0;
    background-color: #000000 !important;
    /* Pure Black everywhere */
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

/* Ensure your main container doesn't have a grey background */
.container,
.main-content,
#app {
    background-color: transparent !important;
}

/* --- YOUR EXISTING CARD STYLES (Keep these Grey) --- */
.card,
.club-card,
.schedule-card,
.event-item,
#calendarDays .day {
    background-color: #1e1e1e !important;
    /* Grey for cards only */
}

/* Small Utility Button */
.btn-sm {
    background-color: transparent;
    border: 1px solid #444;
    color: #aaa;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-sm:hover {
    border-color: #fff;
    color: #fff;
    background-color: #1e1e1e;
}

/* Layout for the row containing Create Button and Tabs */
.club-controls {
    display: flex;
    align-items: center;
    gap: 15px; /* Space between button and tabs */
    flex-wrap: wrap; /* Allow wrapping on very small screens */
}

/* Ensure the tabs take up remaining space or align nicely */
.club-controls .tabs {
    flex: 1;
    margin-bottom: 0;
    justify-content: flex-end; /* Push tabs to the right */
}

/* Mobile Adjustment: Stack them on very small screens */
@media (max-width: 480px) {
    .club-controls {
        flex-direction: column-reverse; /* Tabs on top, button below if stacked */
        align-items: stretch;
    }
    .club-controls .tabs {
        justify-content: space-between;
    }
}
/* Style for the list of events inside the modal */
.event-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2a2a2a;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 4px solid #555; /* Default border color */
}

.event-actions {
    display: flex;
    gap: 10px;
}

.event-actions i {
    cursor: pointer;
    padding: 5px;
    color: #888;
    transition: color 0.2s;
}

.event-actions i.fa-pencil-alt:hover { color: #3B82F6; } /* Blue for edit */
.event-actions i.fa-trash:hover { color: #EF4444; } /* Red for delete */