/* ═══════════════════════════════════════════════════════════════════
   ETEL MADEYA — PREMIUM DESIGN LAYER
   Depth/glass effects on top of the existing golden theme. Loaded
   AFTER driver-style.css / controller-style.css / admin-style.css on
   every page so these rules win the cascade without needing !important.
   Token values sourced from Etel Group's premium WordPress theme
   (etel-theme-premium) so the standalone apps match that design system.
   ═══════════════════════════════════════════════════════════════════ */

:root {
    /* ── Gold spectrum (aligned to the premium theme's palette) ── */
    --ep-gold:        #D4AF37;
    --ep-gold-light:  #F5CC44;
    --ep-gold-pale:   #FFE99A;
    --ep-gold-dim:    #B8941E;
    --ep-gold-deep:   #8B6914;
    --ep-gold-glow:   rgba(244,210,80,0.55);
    --ep-gold-subtle: rgba(244,210,80,0.12);
    --ep-gold-border: rgba(244,210,80,0.35);

    /* ── Carbon/void backgrounds ── */
    --ep-void:        #14100a;
    --ep-carbon:      #221a0e;

    /* ── Gradients ── */
    --ep-grad-gold:   linear-gradient(135deg, #B8820A 0%, #D4AF37 25%, #F5CC44 55%, #D4AF37 80%, #8B6914 100%);
    --ep-grad-glass:  linear-gradient(135deg, rgba(244,210,80,0.16) 0%, rgba(255,248,232,0.04) 100%);
    --ep-grad-shimmer:linear-gradient(105deg, transparent 40%, rgba(255,248,232,0.35) 50%, transparent 60%);

    /* ── Shadows & depth ── */
    --ep-shadow-sm:   0 2px 8px rgba(0,0,0,0.35);
    --ep-shadow-md:   0 8px 28px rgba(0,0,0,0.45);
    --ep-shadow-lg:   0 20px 56px rgba(0,0,0,0.55);
    --ep-shadow-gold: 0 0 32px rgba(212,175,55,0.18), 0 0 64px rgba(212,175,55,0.07);
    --ep-shadow-card: 0 8px 28px rgba(0,0,0,0.5), 0 1px 0 rgba(212,175,55,0.12) inset;
    --ep-shadow-inset:inset 0 1px 0 rgba(212,175,55,0.14), inset 0 -1px 0 rgba(0,0,0,0.3);

    /* ── Glass / blur ── */
    --ep-border-glass: 1px solid rgba(212,175,55,0.16);
    --ep-blur-sm:  blur(8px);
    --ep-blur-md:  blur(16px);

    /* ── Motion ── */
    --ep-ease-io:     cubic-bezier(0.4, 0.0, 0.2, 1.0);
    --ep-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1.0);
    --ep-dur-fast: 150ms;
    --ep-dur-base: 250ms;
    --ep-dur-slow: 450ms;

    /* ── Radii ── */
    --ep-r-sm: 8px;
    --ep-r-md: 12px;
    --ep-r-lg: 18px;

    /* ── Typography ── */
    --ep-font-display: 'Cormorant Garamond', Georgia, serif;
    --ep-font-ui:      'Rajdhani', 'Noto Sans Ethiopic', sans-serif;
    --ep-font-mono:    'JetBrains Mono', 'Courier New', monospace;
}

/* ═══ TYPOGRAPHY ═══════════════════════════════════════════════════ */
/* Latin text renders in Rajdhani/Cormorant; Ethiopic glyphs (not in
   those fonts) fall through the stack to Noto Sans Ethiopic automatically. */
body {
    font-family: var(--ep-font-ui), 'Noto Sans Ethiopic', sans-serif;
}

h1, h2, .logo-name, .page-title, .login-box h1, .header-title,
.sidebar-header h2, .stat-value, .imp-card-num, .position-number {
    font-family: var(--ep-font-display), 'Noto Sans Ethiopic', serif;
    letter-spacing: 0.3px;
    /* Solid fallback color, set before the gradient-clip rules below win
       the cascade - guarantees a legible flat gold on any engine that
       doesn't support background-clip:text (or for a11y tooling reading
       computed `color`), instead of default/invisible text. */
    color: var(--ep-gold);
}

.report-plate, .imp-dup-plate, .imp-clean-chip, code, .header-subtitle,
#reportTableBody td:nth-child(5), .queue-table td:nth-child(6) {
    font-family: var(--ep-font-mono);
}

/* ═══ GLASS SURFACE UTILITY ════════════════════════════════════════ */
.card, .login-box, .modal-content, .dashboard-card, .settings-card,
.stat-card, .queue-container, .report-panel, .imp-panel, .imp-card,
.vehicle-card, .controller-item, .queue-monitor-item, .table-container {
    background-image: var(--ep-grad-glass);
    background-blend-mode: overlay;
    border: var(--ep-border-glass);
    box-shadow: var(--ep-shadow-card);
    backdrop-filter: var(--ep-blur-sm);
    -webkit-backdrop-filter: var(--ep-blur-sm);
    transition: transform var(--ep-dur-base) var(--ep-ease-io),
                box-shadow var(--ep-dur-base) var(--ep-ease-io);
}

/* Header/sidebar/topbar carry their own directional accent borders
   (border-bottom/border-right); the drop zone relies on its dashed
   border as a drag-target affordance. Add only blur/shadow here, never
   a shorthand `border` that would reset those. */
.header, .sidebar, .topbar, .imp-dropzone {
    background-image: var(--ep-grad-glass);
    background-blend-mode: overlay;
    backdrop-filter: var(--ep-blur-md);
    -webkit-backdrop-filter: var(--ep-blur-md);
}

/* ═══ HOVER-LIFT ═══════════════════════════════════════════════════ */
.stat-card:hover, .dashboard-card:hover, .settings-card:hover,
.vehicle-card:hover, .controller-item:hover, .imp-card:hover,
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ep-shadow-lg), var(--ep-shadow-gold);
}

/* ═══ BUTTONS ══════════════════════════════════════════════════════ */
.btn, .btn-primary, .btn-secondary, .btn-success, .btn-logout,
.btn-refresh, .action-btn, .imp-check-btn, .imp-browse-btn,
.imp-import-btn, .lang-btn, .admin-link {
    position: relative;
    overflow: hidden;
    border-radius: var(--ep-r-sm);
    transition: transform var(--ep-dur-fast) var(--ep-ease-spring),
                box-shadow var(--ep-dur-base) var(--ep-ease-io),
                filter var(--ep-dur-fast) ease;
}

.btn-primary, .btn-success, .imp-check-btn, .imp-import-btn {
    background: var(--ep-grad-gold);
    box-shadow: var(--ep-shadow-sm), var(--ep-shadow-inset);
}

.btn-primary::before, .btn-success::before, .imp-check-btn::before,
.imp-import-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--ep-grad-shimmer);
    transform: translateX(-120%);
}

.btn-primary:hover::before, .btn-success:hover::before,
.imp-check-btn:hover::before, .imp-import-btn:hover::before {
    transform: translateX(120%);
    transition: transform var(--ep-dur-slow) var(--ep-ease-io);
}

.btn:hover, .btn-primary:hover, .btn-secondary:hover, .btn-success:hover,
.btn-logout:hover, .btn-refresh:hover, .action-btn:hover,
.imp-check-btn:hover, .imp-browse-btn:hover, .imp-import-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--ep-shadow-md), var(--ep-shadow-gold);
    filter: brightness(1.06);
}

.btn:active, .btn-primary:active, .btn-secondary:active,
.btn-success:active, .action-btn:active {
    transform: translateY(0);
}

/* ═══ INPUTS / SELECTS — themed appearance + focus glow ═══════════
   .form-group inputs across the app (login, Add Vehicle, Add
   Controller, Settings, etc.) are bare <input>/<select>/<textarea>
   with no .form-control class, so they fell back to unstyled white
   browser-default boxes that broke the dark/gold theme. This gives
   every one of them the same themed look, .form-control included.
   Scoped to .form-group / .form-control only - deliberately NOT a
   bare input[type=...] catch-all, since several standalone inputs
   elsewhere (.report-search-bar input, the toolbar date picker) have
   their own intentional styling (e.g. a red accent border, flex:1
   sizing) that a wide catch-all would have silently overridden. */
.form-control, .form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--ep-gold-border);
    border-radius: var(--ep-r-sm);
    background: rgba(20,14,4,0.55);
    color: #fff8e8;
    font-size: 16px; /* >=16px prevents iOS Safari auto-zoom-on-focus */
    font-family: inherit;
    transition: box-shadow var(--ep-dur-base) var(--ep-ease-io),
                border-color var(--ep-dur-base) var(--ep-ease-io);
}

.form-control::placeholder, .form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255,248,232,0.4);
}

.form-control:focus, .form-group input:focus, .form-group select:focus,
.form-group textarea:focus, #reportSearch:focus, #impVehicleType:focus {
    outline: none;
    border-color: var(--ep-gold) !important;
    box-shadow: 0 0 0 3px var(--ep-gold-subtle), var(--ep-shadow-sm);
}

/* ═══ TABLES — subtle depth ═══════════════════════════════════════ */
.queue-table thead, .report-table thead, .data-table thead,
.imp-dup-table thead {
    box-shadow: var(--ep-shadow-inset);
}

.queue-table tbody tr, .report-table tbody tr, .data-table tbody tr,
.imp-dup-table tbody tr {
    transition: background var(--ep-dur-fast) ease;
}

/* ═══ BADGES — glow pill ══════════════════════════════════════════ */
.badge, .status-badge, .imp-badge {
    box-shadow: var(--ep-shadow-sm);
}

/* ═══ MODALS — elevated glass panel ═══════════════════════════════ */
.modal-content {
    box-shadow: var(--ep-shadow-lg), var(--ep-shadow-gold);
    animation: ep-modal-in var(--ep-dur-base) var(--ep-ease-spring);
}

@keyframes ep-modal-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══ NOTIFICATION toast — glass + glow ═══════════════════════════ */
.notification {
    backdrop-filter: var(--ep-blur-md);
    -webkit-backdrop-filter: var(--ep-blur-md);
    box-shadow: var(--ep-shadow-lg);
}

/* ═══ ENTRANCE ANIMATION for stat/dashboard cards ═════════════════ */
.stat-card, .dashboard-card, .settings-card {
    animation: ep-fade-up var(--ep-dur-slow) var(--ep-ease-io) both;
}

@keyframes ep-fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══ ETELID-ONLY PREMIUM LOGIN SCREEN ════════════════════════════
   Controller Panel + Admin Panel login screens: EtelID SSO is now the
   only sign-in method, so this is the single most-seen "first
   impression" surface — worth its own dedicated depth/3D treatment. */

.login-screen {
    overflow-x: hidden;
    overflow-y: auto;
    /* Not overflow:hidden - on mobile, when the on-screen keyboard
       opens (or the address bar shrinks the viewport), a hidden
       overflow can trap the form/submit button off-screen with no
       way to scroll to it. Real perspective/3D-rotate transforms were
       deliberately dropped from this screen too (see .login-box-etelid
       below) for the same mobile-safety reason - some mobile WebKit
       builds mishandle touch hit-testing inside an active 3D
       transform/perspective context. */
    padding: 24px 16px;
    box-sizing: border-box;
}

/* Abstract branded motif - a fuel-nozzle silhouette with radiating
   "energy" rings and sparks, drawn as inline gold linework (no photo,
   no external asset, nothing to host or swap out later if a real
   generated hero image gets added). Sits low-opacity in the top-right,
   behind the orbs and the card, purely decorative (pointer-events:none,
   aria-hidden via presentation-only background-image). */
.login-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    /* The real Etel Madeya medallion artwork (already shipped in
       assets/images/), not a drawn substitute - root-relative path so
       it resolves the same from both / (index.php, controller.php)
       and /admin/ (admin/index.php). */
    background-image: url('/Etel-Madeya/assets/images/etel-madeya-logo.webp');
    background-repeat: no-repeat;
    background-position: center 45%;
    background-size: min(1300px, 115vw);
    opacity: 0.32;
}

/* Floating ambient glow orbs behind the card, for depth/parallax feel */
.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.55;
    animation: ep-orb-float 14s ease-in-out infinite;
}

.login-orb-1 {
    width: 360px; height: 360px;
    top: -120px; left: -100px;
    background: radial-gradient(circle, var(--ep-gold-glow) 0%, transparent 70%);
    animation-delay: 0s;
}

.login-orb-2 {
    width: 420px; height: 420px;
    bottom: -160px; right: -120px;
    background: radial-gradient(circle, rgba(139,105,20,0.5) 0%, transparent 70%);
    animation-delay: -7s;
}

@keyframes ep-orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(30px, -20px) scale(1.08); }
}

/* The card itself: glass surface + a slowly-rotating conic-gradient
   "aura" ring behind it, achieved with a blurred ::before so no extra
   markup is needed. */
.login-box-etelid {
    position: relative;
    z-index: 1;
    overflow: visible;
    animation: ep-card-rise 0.6s var(--ep-ease-spring) both;
}

@keyframes ep-card-rise {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-box-etelid:hover {
    transform: translateY(-2px);
}

/* Pulsing glow ring around the logo */
.login-logo-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.login-logo-ring::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--ep-gold-glow) 0%, transparent 68%);
    animation: ep-logo-pulse 2.6s ease-in-out infinite;
}

@keyframes ep-logo-pulse {
    0%, 100% { transform: scale(0.94); opacity: 0.7; }
    50%      { transform: scale(1.08); opacity: 1; }
}

.login-logo-ring .login-logo {
    position: relative;
    z-index: 1;
}

/* "Secured by EtelID" trust badge */
.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 auto 22px;
    padding: 5px 14px;
    border-radius: var(--ep-r-md);
    background: var(--ep-gold-subtle);
    border: 1px solid var(--ep-gold-border);
    color: var(--ep-gold-light);
    font-family: var(--ep-font-ui);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.login-badge svg { flex-shrink: 0; }

/* Icon-prefixed inputs */
.form-group-icon { position: relative; text-align: left; }

.form-group-icon .input-icon {
    position: absolute;
    left: 12px;
    top: 38px;
    color: var(--ep-gold-dim);
    pointer-events: none;
}

.form-group-icon input {
    padding-left: 40px !important;
}

.login-footer-note {
    margin-top: 20px;
    font-size: 12.5px;
    color: rgba(255,255,255,0.78);
}

.login-footer-note a {
    color: var(--ep-gold-light);
    font-weight: 600;
    text-decoration: none;
}

.login-footer-note a:hover { text-decoration: underline; }

/* Snappier mobile taps on every clickable control, plus a smaller
   login card and logo on narrow screens so the whole form - button
   included - comfortably fits without the surrounding orbs/blur
   pushing it off-viewport. */
button, .btn, .btn-primary, .btn-secondary, .btn-success, a {
    touch-action: manipulation;
}

@media (max-width: 480px) {
    .login-box-etelid {
        padding: 28px 22px;
        max-width: 100%;
    }
    .login-logo-ring {
        width: 90px;
        height: 90px;
    }
    .login-orb-1, .login-orb-2 {
        width: 220px;
        height: 220px;
    }
}

/* ═══ MEDALLION WATERMARK — Controller/Admin main panel + Driver page ═
   Same real artwork as the login screen, applied as a large faint
   watermark behind the working content (queue table, dashboard,
   position-check UI) - matching how the WordPress build always kept
   the brand medallion visible in the background of every screen. */
/* z-index:0 (not just position:relative) is deliberate - it makes
   each of these its own stacking context, so the ::before's
   z-index:-1 resolves against IT specifically. Per the CSS stacking
   spec that means the watermark paints above this element's own
   background but below its normal-flow children (the queue table,
   stat cards, etc.) - not swallowed by admin's #mainPanel or
   .main-content, both of which set their own background here.

   #mainPanel is shared markup between controller.php and
   admin/index.php, but only admin nests a further .main-content
   inside it - :not(:has(.main-content)) keeps the watermark from
   double-rendering there (once on #mainPanel, once on .main-content
   inside it); on controller.php, which has no .main-content, it's a
   no-op and #mainPanel gets it directly as intended. */
#mainPanel:not(:has(.main-content)), #mainContent, .main-content {
    position: relative;
    z-index: 0;
}

#mainPanel:not(:has(.main-content))::before, #mainContent::before, .main-content::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url('/Etel-Madeya/assets/images/etel-madeya-logo.webp');
    background-repeat: no-repeat;
    background-position: center 45%;
    /* Full width of its container, not a small centered badge - same
       "fill the display" treatment the login screen got, just kept
       fainter here since this sits directly behind working content
       (the queue table, dashboard cards) rather than a mostly-empty
       login screen. */
    background-size: 100% auto;
    opacity: 0.08;
}

/* ═══ ADMIN DASHBOARD — stat-icon color consistency ═══════════════
   Ran the admin dashboard through the ui-ux-pro-max skill. Its top
   finding: the 4 stat-card icons (blue/green/orange/purple) don't map
   to anything semantic - Active Controllers, Total Queued, Served
   Today, and Vehicle Types are all neutral count metrics, none of
   them an error/warning/success state, so the color variety was pure
   decoration clashing with the gold/carbon brand used everywhere else.
   Unified to the brand gold gradient; the 4 cards stay distinguishable
   via their icon + label, matching the skill's visual-hierarchy
   guidance (hierarchy via icon/label, not arbitrary color). */
.stat-icon.blue, .stat-icon.green, .stat-icon.orange, .stat-icon.purple {
    background: linear-gradient(135deg, var(--ep-gold-light) 0%, var(--ep-gold-deep) 100%);
}

/* ═══ REDUCED MOTION — respect user preference ════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
