/* ==========================================================================
   EasyRide Theme — club badge palette (black + sunset amber/orange)
   Single source of truth for colors/fonts/component styling.
   ========================================================================== */

:root {
    --sidebar-width: 260px;

    /* Brand accent (from the club badge's sunset gradient) */
    --primary-gradient: linear-gradient(135deg, #e8792c 0%, #f2b134 100%);
    --primary-gradient-hover: linear-gradient(135deg, #d4691f 0%, #e0a020 100%);
    --accent-color: #e8792c;
    --accent-hover: #f2b134;

    /* Dark chrome (sidebar/header) — from the badge's black ring */
    --sidebar-gradient: linear-gradient(180deg, #141110 0%, #1c1815 50%, #141110 100%);
    --sidebar-gradient-diagonal: linear-gradient(135deg, #141110 0%, #1c1815 100%);
    --ez-black: #141110;
    --ez-black-soft: #1c1815;
    --ez-text-cream: #f2e4d0;
    --ez-text-muted-dark: #d8c4a0;

    /* Light content area (tables/forms/cards stay readable) */
    --ez-content-bg: #fbfaf8;
    --ez-orange: #e8792c;
    --ez-amber: #f2b134;

    /* Auth pages (login/register/etc.) — moody sunset backdrop, pure branding real estate */
    --auth-bg-gradient: linear-gradient(135deg, #1c1815 0%, #e8792c 100%);
    --auth-header-gradient: linear-gradient(135deg, #2b1d14 0%, #141110 100%);

    /* Semantic status colors — unchanged, do not touch */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Typography */
    --ez-font-display: 'Oswald', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Bootstrap's own variables — closes the gap on plain links, checkboxes,
       nav-pills/tabs, and pagination, which the old inline block never covered
       and which otherwise still show Bootstrap's stock blue (#0d6efd). */
    --bs-primary: #e8792c;
    --bs-primary-rgb: 232, 121, 44;
    --bs-link-color: #e8792c;
    --bs-link-color-rgb: 232, 121, 44;
    --bs-link-hover-color: #d4691f;
    --bs-link-hover-color-rgb: 212, 105, 31;
}

.form-check-input:checked {
    background-color: #e8792c;
    border-color: #e8792c;
}

.form-check-input:focus {
    border-color: #f2b134;
    box-shadow: 0 0 0 0.25rem rgba(232, 121, 44, 0.25);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: #e8792c;
}

.nav-tabs .nav-link.active {
    color: #e8792c;
}

.page-link {
    color: #e8792c;
}

.page-item.active .page-link {
    background-color: #e8792c;
    border-color: #e8792c;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #fbfaf8 0%, #f0ebe3 100%);
}

/* Animated Gradient Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-gradient);
    padding-top: 0;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.85);
    padding: 0.85rem 1.5rem;
    border-radius: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--ez-font-display);
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.sidebar .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.15) 0%, transparent 100%);
    transition: width 0.3s ease;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.sidebar .nav-link:hover::before {
    width: 100%;
}

.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.05) 100%);
    border-left: 4px solid #f2b134;
    box-shadow: inset 0 0 20px rgba(255,255,255,0.1);
}

.sidebar .nav-link i {
    width: 28px;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.sidebar-brand {
    color: #fff;
    font-family: var(--ez-font-display);
    font-size: 1.4rem;
    font-weight: 700;
    padding: 1.5rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0,0,0,0.2);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.sidebar-brand:hover {
    color: #fff;
    background: rgba(0,0,0,0.25);
}

.sidebar-section {
    color: rgba(255,255,255,0.5);
    font-family: var(--ez-font-display);
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 1.25rem 1.5rem 0.5rem;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
    padding: 2rem;
}

/* Glassmorphism Top Navbar */
.top-navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.top-navbar .dropdown {
    position: relative;
}

.top-navbar .dropdown-menu {
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    top: 100% !important;
    transform: none !important;
    z-index: 1050 !important;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    border: none;
    margin-top: 0.5rem;
}

.top-navbar .dropdown-toggle {
    font-weight: 500;
}

.top-navbar .dropdown-item {
    padding: 0.6rem 1rem;
}

.top-navbar .dropdown-item:hover {
    background-color: #f7f3ee;
}

/* Modern Cards */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

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

.card-header {
    background: linear-gradient(135deg, #f7f3ee 0%, #f0e9df 100%);
    border-bottom: 1px solid #e5dccb;
    font-family: var(--ez-font-display);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.card-header[class*="bg-"] {
    background-image: none;
}

/* Stats Cards with Gradients */
.stats-card {
    border-left: none !important;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    border-radius: 16px 0 0 16px;
}

.stats-card.primary::before { background: var(--primary-gradient); }
.stats-card.success::before { background: linear-gradient(180deg, #10b981 0%, #059669 100%); }
.stats-card.warning::before { background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%); }
.stats-card.danger::before { background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%); }
.stats-card.info::before { background: linear-gradient(180deg, #06b6d4 0%, #0891b2 100%); }

.stats-card .stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.stats-card.primary .stats-icon { background: var(--primary-gradient); }
.stats-card.success .stats-icon { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.stats-card.warning .stats-icon { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.stats-card.danger .stats-icon { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.stats-card.info .stats-icon { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); }

/* Modern Buttons */
.btn {
    border-radius: 10px;
    font-family: var(--ez-font-display);
    font-weight: 500;
    padding: 0.6rem 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 4px 15px rgba(232, 121, 44, 0.4);
}

.btn-primary:hover {
    background: var(--primary-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 121, 44, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: #fff;
}

.btn-outline-primary {
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
}

.btn-outline-primary:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

/* Modern Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.85em;
    border-radius: 8px;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}

.badge.bg-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; }
.badge.bg-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important; color: #fff !important; }
.badge.bg-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important; }
.badge.bg-primary { background: var(--primary-gradient) !important; }
.badge.bg-info { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important; }
.badge.bg-secondary { background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important; }

/* Modern Tables */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: linear-gradient(135deg, #f7f3ee 0%, #f0e9df 100%);
    border-bottom: 2px solid #e5dccb;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b5d4d;
    padding: 1rem;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: linear-gradient(135deg, #f7f3ee 0%, #fdf1e0 100%);
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0e9df;
}

/* Modern Form Controls */
.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #e5dccb;
    padding: 0.7rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(232, 121, 44, 0.15);
}

.form-label {
    font-weight: 500;
    color: #3d342a;
    margin-bottom: 0.5rem;
}

/* Modern Alerts */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: var(--card-shadow);
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: #047857;
    border-left: 4px solid #10b981;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: #b91c1c;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%);
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(8, 145, 178, 0.1) 100%);
    color: #0e7490;
    border-left: 4px solid #06b6d4;
}

/* Page Headings */
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
    font-family: var(--ez-font-display);
    font-weight: 700;
    color: #231a12;
    letter-spacing: -0.5px;
}

/* Headings inside dark chrome bands (auth-page header/hero blocks) need to
   stay light, overriding the dark default above meant for the light content area. */
.login-header h1, .login-header h2, .login-header h3,
.register-header h1, .register-header h2, .register-header h3,
.card-header-auth h1, .card-header-auth h2, .card-header-auth h3,
.install-header h1, .install-header h2, .install-header h3 {
    color: #fff;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item a {
    color: var(--accent-color);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #8a7a66;
}

/* Avatar — circular, badge-style ring (echoes the club emblem's shape) */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: 2px solid #f2b134;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

/* Dropdown */
.dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, #f7f3ee 0%, #fdf1e0 100%);
}

/* Progress bars */
.progress {
    border-radius: 10px;
    height: 10px;
    background: #e5dccb;
}

.progress-bar {
    border-radius: 10px;
    background: var(--primary-gradient);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .alert, .stats-card {
    animation: fadeInUp 0.4s ease-out;
}

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

::-webkit-scrollbar-track {
    background: #f0e9df;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #e8792c 0%, #f2b134 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d4691f 0%, #e0a020 100%);
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

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

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .top-navbar {
        padding: 0.6rem 0.8rem;
    }

    .top-navbar .dropdown-toggle {
        font-size: 0.85rem;
        padding: 0.25rem 0.4rem;
    }

    /* Notification dropdown: anchor to right edge of viewport on mobile */
    .top-navbar .dropdown .dropdown-menu.dropdown-menu-end {
        position: fixed !important;
        right: 0.5rem !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
    }

    .top-navbar .dropdown-toggle .user-name-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 30vw;
    }


    .content-wrapper {
        padding: 1rem;
    }
}

/* Mobile card view for tables - only on portrait phones (<576px) */
@media (max-width: 575.98px) {
    .mobile-cards-container .mobile-card {
        border-radius: 0.5rem;
        margin-bottom: 0.75rem;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }
    .mobile-cards-container .mobile-card .card-body {
        padding: 0.75rem;
    }
    .mobile-cards-container .mobile-card-label {
        font-size: 0.7rem;
        color: #6c757d;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 0.1rem;
    }
    .mobile-cards-container .mobile-card-row {
        margin-bottom: 0.4rem;
    }
    .mobile-cards-container .mobile-card-actions {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(0,0,0,0.08);
    }
    .mobile-cards-container .mobile-card-actions .btn {
        flex: 1;
    }
    .mobile-cards-container .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 0.4rem;
    }
    .mobile-cards-container .mobile-card-header .card-title {
        font-size: 0.95rem;
        margin-bottom: 0;
        flex: 1;
        margin-right: 0.5rem;
    }
    .mobile-cards-container .mobile-card-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        margin-bottom: 0.3rem;
    }
}

/* ── Summernote + Bootstrap 5 popup fix ── */
.note-modal-backdrop { display: none !important; }
.note-modal.open { display: flex !important; align-items: center; justify-content: center; background: rgba(0,0,0,.4); }
.note-modal .note-modal-content { margin: auto; max-width: 600px; width: 90%; }
.note-popover.popover { display: none; }
.note-popover.popover.in, .note-popover.popover.show { display: block !important; z-index: 3050 !important; }
.note-toolbar .dropdown-menu { z-index: 3060 !important; }
.note-color .note-dropdown-menu,
.note-table .note-dropdown-menu,
.note-style .note-dropdown-menu,
.note-para .note-dropdown-menu { z-index: 3060 !important; }
.note-editor .note-toolbar .note-dropdown-toggle::after { display: none; }
