/* ============================================
   Dominica Sports Division - Admin Template
   Primary: #003366 (Navy Blue)
   Accent:  #FFD700 (Gold)
   ============================================ */

:root {
    --sd-primary: #003366;
    --sd-primary-light: #004080;
    --sd-primary-dark: #002244;
    --sd-accent: #FFD700;
    --sd-accent-dark: #CCA800;
    --sd-bg-light: #f4f6f9;
    --sd-sidebar-width: 250px;
    --sd-topbar-height: 56px;
}

/* ── Base ─────────────────────────────────── */
html {
    font-size: 14px;
    min-height: 100%;
}

@media (min-width: 768px) {
    html { font-size: 15px; }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background-color: var(--sd-bg-light);
    margin: 0;
    padding: 0;
}

/* ── Sidebar ──────────────────────────────── */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sd-sidebar-width);
    height: 100vh;
    background-color: var(--sd-primary);
    overflow-y: auto;
    z-index: 1040;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.sidebar-nav .sidebar-heading {
    padding: 1rem 1.25rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.sidebar-nav a:hover {
    color: #fff;
    background-color: var(--sd-primary-light);
}

.sidebar-nav a.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
    border-left-color: var(--sd-accent);
}

.sidebar-nav a i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

/* ── Topbar ───────────────────────────────── */
#topbar {
    position: fixed;
    top: 0;
    left: var(--sd-sidebar-width);
    right: 0;
    height: var(--sd-topbar-height);
    background-color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    z-index: 1030;
}

#sidebarToggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--sd-primary);
    cursor: pointer;
    padding: 0.25rem;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
}

/* User dropdown in topbar */
.user-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.15s;
}

.user-dropdown .dropdown-toggle:hover {
    background-color: var(--sd-bg-light);
}

.user-dropdown .dropdown-toggle::after {
    display: inline-block;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-left: 0.3em solid transparent;
    vertical-align: 0.15em;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--sd-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Content Wrapper ──────────────────────── */
#content-wrapper {
    margin-left: var(--sd-sidebar-width);
    margin-top: var(--sd-topbar-height);
    padding: 1.5rem;
    min-height: calc(100vh - var(--sd-topbar-height));
    display: flex;
    flex-direction: column;
}

#content-wrapper main {
    flex: 1;
}

#content-wrapper footer {
    text-align: center;
    padding: 1rem 0;
    font-size: 0.8rem;
    color: #999;
    margin-top: 2rem;
}

/* ── Mobile Responsive ────────────────────── */
@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%);
    }

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

    #topbar {
        left: 0;
    }

    #sidebarToggle {
        display: block;
    }

    #content-wrapper {
        margin-left: 0;
    }

    /* Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1035;
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }
}

/* ── Tables ───────────────────────────────── */
.table thead th {
    background-color: var(--sd-primary);
    color: #fff;
    font-weight: 600;
    border: none;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 51, 102, 0.06);
}

.table td, .table th {
    vertical-align: middle;
}

/* ── Status Badges ────────────────────────── */
.badge-draft        { background-color: #6c757d; color: #fff; }
.badge-registration { background-color: #0dcaf0; color: #000; }
.badge-inprogress   { background-color: #0d6efd; color: #fff; }
.badge-completed    { background-color: #198754; color: #fff; }

/* ── Dashboard Cards ──────────────────────── */
.dashboard-card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.dashboard-card .card-title {
    color: var(--sd-primary);
    font-weight: 700;
}

.dashboard-card .card-icon {
    font-size: 2.5rem;
    color: var(--sd-accent);
}

.card-stat {
    font-size: 2rem;
    font-weight: 700;
    color: var(--sd-primary);
}

/* ── Buttons ──────────────────────────────── */
.btn-primary {
    background-color: var(--sd-primary);
    border-color: var(--sd-primary);
}

.btn-primary:hover {
    background-color: var(--sd-primary-light);
    border-color: var(--sd-primary-light);
}

.btn-accent {
    background-color: var(--sd-accent);
    border-color: var(--sd-accent);
    color: var(--sd-primary);
    font-weight: 600;
}

.btn-accent:hover {
    background-color: var(--sd-accent-dark);
    border-color: var(--sd-accent-dark);
    color: var(--sd-primary);
}

/* ── Forms ─────────────────────────────────── */
.form-control:focus,
.form-select:focus {
    border-color: var(--sd-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 51, 102, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
}

/* Focus Accessibility */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--sd-primary);
}

/* ── Alerts ────────────────────────────────── */
.alert {
    border-radius: 0.375rem;
}

/* ── Page Headers ──────────────────────────── */
.page-header {
    border-bottom: 3px solid var(--sd-accent);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--sd-primary);
}

/* ── Filter Bar ────────────────────────────── */
.filter-bar {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ── Print Styles ──────────────────────────── */
@media print {
    #sidebar, #topbar, .sidebar-overlay, .btn, .alert, .no-print {
        display: none !important;
    }

    #content-wrapper {
        margin: 0 !important;
        padding: 0 !important;
    }

    body {
        margin: 0;
        padding: 0;
        background: #fff;
    }

    .container {
        max-width: 100%;
        width: 100%;
    }

    .table thead th {
        background-color: #ddd !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
    }
}
