:root {
    /* Color Palette - Slate / Zinc inspired */
    --bg-app: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-dim: rgba(59, 130, 246, 0.15);

    --border-subtle: #334155;
    --border-focus: #3b82f6;

    --success: #10b981;
    --danger: #ef4444;

    /* Spacing & Layout */
    --sidebar-width: 280px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --font-family: 'Inter', system-ui, -apple-system, sans-serif;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* --- Layout --- */
.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 10;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: radial-gradient(circle at top right, #1e293b 0%, #0f172a 40%);
}

.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* --- Typography & Elements --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.025em;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* --- Sidebar Components --- */
.logo {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo h1 {
    font-size: 1.25rem;
    color: var(--text-primary);
    /* Gradient Text */
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-section-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.league-item {
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.league-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.league-item.active {
    background-color: var(--accent-dim);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
}

/* Update Status & Search in Sidebar */
.sidebar-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.status-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.search-results {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    z-index: 50;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.search-result-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
}

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

.search-result-item:hover {
    background-color: var(--bg-card-hover);
}

/* --- Top Bar --- */
.top-bar {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 20;
}

.top-bar h2 {
    font-size: 1.25rem;
}

/* --- Cards & UI Elements --- */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-family: var(--font-family);
}

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

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

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

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

/* --- Club Details Grid --- */
.club-details-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 15px;
    row-gap: 20px;
    font-size: 1rem;
}

.club-details-grid>div {
    overflow-wrap: break-word;
    word-break: break-word;
    /* Break long emails */
    min-width: 0;
    /* Allow flex/grid shrinking */
}

@media (max-width: 600px) {
    .club-details-grid {
        grid-template-columns: 1fr;
        /* Stack on mobile */
        gap: 4px;
        row-gap: 12px;
    }

    /* Make labels distinct when stacked */
    .club-details-grid>div:nth-child(odd) {
        color: var(--text-muted);
        font-size: 0.85em;
        margin-top: 8px;
    }
}


/* --- Tables --- */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    white-space: nowrap;
}

th {
    background-color: #0f172a;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-subtle);
}

td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

tr:hover td {
    background-color: rgba(59, 130, 246, 0.1);
}

.highlight-row {
    background-color: rgba(59, 130, 246, 0.2) !important;
    border-left: 3px solid var(--accent-primary);
}

.highlight-row td {
    color: #fff;
    font-weight: 600;
}

/* --- Tabs --- */
/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 2rem;
    overflow-x: auto;
    white-space: nowrap;
}

.tab-btn {
    background: none;
    border: none;
    padding-bottom: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-family);
    position: relative;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-primary);
    border-radius: 2px 2px 0 0;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* --- Collapsible Sections --- */
.collapsible-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 0.5rem;
    text-align: left;
}

.collapsible-header:hover {
    background-color: var(--bg-card-hover);
}

.collapsible-header h3 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collapsible-icon {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.collapsible-header.active .collapsible-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    display: none;
    border: 1px solid var(--border-subtle);
    border-top: none;
    background-color: rgba(30, 41, 59, 0.3);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 1.5rem;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease;
}

.collapsible-content.open {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

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

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

.text-xs {
    font-size: 0.75rem;
}

.text-muted {
    color: var(--text-muted);
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-app);
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .app-container {
        position: relative;
    }

    .sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 85%;
        max-width: 300px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 2000;
        /* Above everything */
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-only {
        display: block !important;
        margin-right: 15px;
        background: transparent;
        border: 1px solid var(--border-subtle);
        color: var(--text-primary);
        font-size: 1.2rem;
        padding: 4px 10px;
        border-radius: 4px;
        cursor: pointer;
    }

    .mobile-only:hover {
        background: var(--bg-card-hover);
    }

    .main-content {
        width: 100%;
    }

    .top-bar {
        padding: 10px 15px;
    }
}

/* New: Small Mobile Tweaks */
@media (max-width: 480px) {
    body {
        font-size: 13px;
        /* Slightly smaller base */
    }

    .content-area {
        padding: 1rem;
        /* Reduce padding */
    }

    .card {
        padding: 1rem;
    }

    table {
        font-size: 0.8rem;
        /* Smaller table text */
    }

    th,
    td {
        padding: 0.6rem 0.75rem;
        /* Tighter cells */
    }

    .card-title {
        font-size: 1rem;
    }

    h2 {
        font-size: 1.1rem;
    }
}