/*
 * Lets.Tech brand styles
 * Colors:
 *   Orange #F59B3A | Blue #372B84 | White #FFFFFF | Black #000000 | Grey 15% #D9D9D9
 * Typography:
 *   Montserrat Medium for headings / logotype
 *   Montserrat Light for body copy
 */

@font-face {
    font-family: 'Montserrat';
    src: url("/static/fonts/Montserrat-Thin.4f2d34947635.otf") format('opentype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url("/static/fonts/Montserrat-Light.45ecb6385844.otf") format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url("/static/fonts/Montserrat-Regular.b041170eac82.otf") format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url("/static/fonts/Montserrat-Medium.b7a0bca87b66.otf") format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url("/static/fonts/Montserrat-SemiBold.02ee4bf3ae4d.otf") format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url("/static/fonts/Montserrat-Bold.6f81fea92712.otf") format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url("/static/fonts/Montserrat-Black.0736ef3bd75d.otf") format('opentype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --lt-orange: #F59B3A;
    --lt-orange-hover: #e08a29;
    --lt-blue: #372B84;
    --lt-blue-hover: #2a2168;
    --lt-white: #FFFFFF;
    --lt-black: #000000;
    --lt-grey: #D9D9D9;
    --lt-bg: #F4F4F6;
    --lt-text: #1a1a1a;
    /* Per Lets.Tech guidelines: minimum clear space = ¼ width of the logo icon.
       Icon ≈ 52px, so the clear space "X" is 13px on all sides we control. */
    --lt-logo-h: 52px;
    --lt-logo-clear: 13px;
}

html, body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-weight: 300; /* Light per guidelines for body copy */
    color: var(--lt-text);
    background-color: var(--lt-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.navbar-brand, .btn, .form-label, .card-title, .nav-link, .offcanvas-title,
table thead th {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-weight: 500; /* Medium per guidelines */
    letter-spacing: 0.01em;
}

h1 { font-weight: 600; }
h2, h3 { font-weight: 500; }

/* Navbar — black with brand orange accent stripe.
   Padding gives the brand clear-space above + below + to the left of the logo. */
.navbar {
    background-color: var(--lt-black) !important;
    border-bottom: 4px solid var(--lt-orange);
    padding-top: var(--lt-logo-clear);
    padding-bottom: var(--lt-logo-clear);
    min-height: calc(var(--lt-logo-h) + (2 * var(--lt-logo-clear)));
}
.navbar > .container-fluid {
    padding-left: var(--lt-logo-clear);
    padding-right: var(--lt-logo-clear);
}
.navbar .navbar-brand {
    margin-right: 0;
    padding: 0;
    display: flex;
    align-items: center;
}
.navbar .navbar-brand img { height: var(--lt-logo-h); display: block; }
/* Mobile hamburger button — sits to the left of the logo with brand clear-space gap */
.navbar .sidebar-toggle {
    margin-right: var(--lt-logo-clear);
}
.navbar-brand, .navbar .nav-link, .navbar .text-white { color: var(--lt-white) !important; }
.navbar .nav-link {
    transition: color 0.15s ease, transform 0.15s ease;
}
.navbar .nav-link:hover {
    color: var(--lt-orange) !important;
    transform: translateY(-2px);
}
.navbar .btn-outline-light {
    border-color: rgba(255,255,255,0.7);
    color: var(--lt-white);
    font-weight: 500;
}
.navbar .btn-outline-light:hover {
    background-color: var(--lt-orange);
    border-color: var(--lt-orange);
    color: var(--lt-white);
}
.navbar .form-select {
    background-color: rgba(255,255,255,0.12);
    color: var(--lt-white);
    border-color: rgba(255,255,255,0.3);
    font-weight: 400;
}
.navbar .form-select option { color: var(--lt-text); background: var(--lt-white); }

/* Sidebar — brand orange, fills viewport below navbar */
.sidebar {
    background-color: var(--lt-orange) !important;
    box-shadow: inset -1px 0 0 rgba(0,0,0,0.05);
    min-height: calc(100vh - (var(--lt-logo-h) + (2 * var(--lt-logo-clear)) + 4px));
}
.sidebar .nav-link {
    color: var(--lt-white) !important;
    font-weight: 500;
    padding: .65rem 1rem;
    border-radius: 6px;
    margin: 2px 8px;
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.18);
    color: var(--lt-white) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.18);
}
.sidebar .nav-link.active {
    background-color: var(--lt-blue);
    color: var(--lt-white) !important;
}
.sidebar .nav-link.active:hover {
    background-color: var(--lt-blue-hover);
}

/* Mobile menu — fullscreen popup with centered content */
#sidebarMenu .modal-content {
    background-color: var(--lt-orange);
    border: none;
    color: var(--lt-white);
}
#sidebarMenu .modal-header {
    border-bottom: 1px solid rgba(255,255,255,0.25);
    padding: var(--lt-logo-clear);
}
#sidebarMenu .modal-title { color: var(--lt-white); font-weight: 500; }
#sidebarMenu .btn-close { filter: invert(1) brightness(2); opacity: 0.95; }
#sidebarMenu .modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    text-align: center;
}
#sidebarMenu .modal-body .nav {
    width: 100%;
    max-width: 320px;
    margin-bottom: 1.5rem;
}
#sidebarMenu .modal-body .nav-link {
    color: var(--lt-white) !important;
    font-weight: 500;
    font-size: 1.1rem;
    border-radius: 8px;
    padding: 0.9rem 1rem;
    margin: 6px 0;
    text-align: center;
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
#sidebarMenu .modal-body .nav-link:hover {
    background-color: rgba(255,255,255,0.18);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.18);
}
#sidebarMenu .modal-body .nav-link.active {
    background-color: var(--lt-blue);
    color: var(--lt-white) !important;
}
#sidebarMenu .lt-menu-section {
    width: 100%;
    max-width: 320px;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.25);
}
#sidebarMenu .lt-menu-section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.85);
    margin-bottom: 0.5rem;
    font-weight: 500;
}
#sidebarMenu .lt-menu-section .form-select {
    background-color: rgba(255,255,255,0.95);
    color: var(--lt-text);
    border: none;
    font-weight: 500;
    padding: 0.7rem 0.85rem;
}
#sidebarMenu .lt-menu-section .btn-logout {
    width: 100%;
    background-color: var(--lt-blue);
    border-color: var(--lt-blue);
    color: var(--lt-white);
    font-weight: 500;
    padding: 0.75rem;
}
#sidebarMenu .lt-menu-section .btn-logout:hover {
    background-color: var(--lt-blue-hover);
    border-color: var(--lt-blue-hover);
}
#sidebarMenu .lt-menu-user {
    color: rgba(255,255,255,0.95);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    word-break: break-all;
}

/* Buttons */
.btn-primary {
    background-color: var(--lt-blue);
    border-color: var(--lt-blue);
    font-weight: 500;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--lt-blue-hover);
    border-color: var(--lt-blue-hover);
}
.btn-outline-primary {
    color: var(--lt-blue);
    border-color: var(--lt-blue);
    font-weight: 500;
}
.btn-outline-primary:hover {
    background-color: var(--lt-blue);
    border-color: var(--lt-blue);
    color: var(--lt-white);
}
.btn-warning, .btn-orange {
    background-color: var(--lt-orange);
    border-color: var(--lt-orange);
    color: var(--lt-white);
    font-weight: 500;
}
.btn-warning:hover, .btn-orange:hover {
    background-color: var(--lt-orange-hover);
    border-color: var(--lt-orange-hover);
    color: var(--lt-white);
}

a { color: var(--lt-blue); }
a:hover { color: var(--lt-orange); }

/* Cards */
.card {
    border: 1px solid var(--lt-grey);
    border-radius: 8px;
}
.card-title { font-weight: 500; }
.stat-card { border-left: 4px solid var(--lt-blue) !important; }
.stat-card.accent { border-left-color: var(--lt-orange) !important; }

/* Tables */
.table thead th {
    background-color: var(--lt-blue);
    color: var(--lt-white);
    border-color: var(--lt-blue);
    font-weight: 500;
}
.table tbody tr:hover { background-color: rgba(245,155,58,0.06); }

/* Forms */
.form-control:focus, .form-select:focus {
    border-color: var(--lt-orange);
    box-shadow: 0 0 0 0.2rem rgba(245,155,58,0.20);
}
.form-label { font-weight: 500; }

/* Alerts — keep semantic colors readable on brand */
.alert-primary { background-color: rgba(55,43,132,0.10); border-color: var(--lt-blue); color: var(--lt-blue); }

/* Badges */
.badge.bg-primary { background-color: var(--lt-blue) !important; }
.badge.bg-warning { background-color: var(--lt-orange) !important; color: var(--lt-white) !important; }

/* Pagination */
.page-link { color: var(--lt-blue); }
.page-item.active .page-link {
    background-color: var(--lt-blue);
    border-color: var(--lt-blue);
}

.main-content { padding: 2rem; }
@media (max-width: 767.98px) {
    .main-content { padding: 1rem; }
}

/* Compact inline filter bar — fits search controls on one row on laptops */
.lt-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.5rem 0.75rem;
}
.lt-filter-bar .lt-field { flex: 1 1 110px; min-width: 100px; }
.lt-filter-bar .lt-field--plate { flex: 1 1 130px; }
.lt-filter-bar .lt-field--date { flex: 1 1 150px; }
/* On laptops the extra filters sit inline in the bar; the "More options"
   toggle is mobile-only and hidden here. */
.lt-filter-bar .lt-advanced { display: contents; }
.lt-filter-bar .lt-more-toggle { display: none; }
.lt-filter-bar .lt-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.lt-filter-bar .form-control,
.lt-filter-bar .form-select {
    padding: 0.35rem 0.55rem;
    font-size: 0.875rem;
    height: calc(1.5em + 0.7rem + 2px);
}
.lt-filter-bar .lt-actions {
    display: flex;
    gap: 0.4rem;
    align-self: end;
    padding-bottom: 1px;
}
.lt-filter-bar .lt-actions .btn {
    padding: 0.35rem 0.85rem;
    font-size: 0.875rem;
}

/* Narrow screens: collapse the extra filters behind a "More options" button.
   The bar initially shows only the plate input, the toggle and Search; pressing
   the toggle reveals the date range, camera and vehicle filters. */
@media (max-width: 767.98px) {
    .lt-filter-bar .lt-field--plate { flex: 1 1 100%; }
    .lt-filter-bar .lt-more-toggle {
        display: inline-block;
        align-self: end;
        padding: 0.35rem 0.85rem;
        font-size: 0.875rem;
    }
    .lt-filter-bar .lt-advanced {
        display: none;
        flex: 1 1 100%;
    }
    .lt-filter-bar .lt-advanced.is-open {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem 0.75rem;
        align-items: end;
    }
    .lt-filter-bar .lt-advanced .lt-field { flex: 1 1 140px; }
    .lt-filter-bar .lt-advanced .lt-field--date { flex: 1 1 100%; }
    .lt-filter-bar .lt-actions { margin-left: auto; }
}

/* Event card — name/company line */
.lt-event-meta {
    font-size: 0.75rem;
    color: #555;
    min-height: 1.1em;
    line-height: 1.2;
    margin: 0.15rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile-centered page contents (e.g. Account on phones) */
@media (max-width: 767.98px) {
    .lt-mobile-center > h1,
    .lt-mobile-center > h2,
    .lt-mobile-center > h3,
    .lt-mobile-center > p { text-align: center; }
    .lt-mobile-center .card { max-width: 440px; margin-left: auto; margin-right: auto; }
    .lt-mobile-center .card-header { text-align: center; }
    .lt-mobile-center .card-body > .btn,
    .lt-mobile-center form > .btn { display: block; margin-left: auto; margin-right: auto; }
}

/* Event card lift on hover */
.row > [class*="col"] > a.text-decoration-none .card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    will-change: transform;
}
.row > [class*="col"] > a.text-decoration-none:hover .card {
    transform: translateY(-4px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.14);
    border-color: var(--lt-orange);
}

/* Auth pages (login / password reset / force change) */
.lt-auth-body {
    background: linear-gradient(135deg, var(--lt-blue) 0%, #1f1755 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.lt-auth-card {
    width: 100%;
    max-width: 420px;
}
.lt-auth-card .card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.lt-auth-card .card-body { padding: 2.25rem; }
.lt-auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}
.lt-auth-logo img { height: 56px; }
.lt-auth-title {
    color: var(--lt-blue);
    font-weight: 500;
    text-align: center;
    margin: 0.5rem 0 0.25rem;
}
.lt-auth-sub {
    text-align: center;
    color: #666;
    font-weight: 300;
    margin-bottom: 1.25rem;
}
.lt-auth-card .form-control { padding: .65rem .85rem; }
.lt-auth-card .btn-primary { padding: .65rem; font-weight: 500; }
.lt-auth-card a { color: var(--lt-blue); font-weight: 500; }
.lt-auth-card a:hover { color: var(--lt-orange); }
