﻿/* =========================================================
   BRAND & DESIGN TOKENS
   ========================================================= */
:root {
    --primary: #1A2F54;
    --primary-dark: #143048;
    --accent: #319e67;
    --accent-dark: #267a4f;
    --light-bg: #f8f9fa;
    --border: #e1e1e1;
    --text-grey: #495057;
    --white: #ffffff;
}

/* =========================================================
   GLOBAL BASE
   ========================================================= */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: var(--light-bg);
    font-family: "Segoe UI", system-ui, sans-serif;
    overflow-x: hidden;
}

/* =========================================================
   NAVBAR & LAYOUT
   ========================================================= */
.navbar {
    background-color: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    height: 70px;
}

.navbar-brand img.eshan-logo {
    height: 68px;
    transition: transform 0.2s ease;
}
/* Navbar laundry logo restraint order */
.laundry-logo {
    max-height: 36px; /* key line */
    max-width: 140px; /* prevents horizontal takeover */
    height: auto;
    width: auto;
    object-fit: contain;
}
.laundry-toggle {
    white-space: nowrap;
}

.w-320 {
    min-width: 320px;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--primary);
    border-bottom: 2px solid transparent;
}

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        color: var(--accent);
        border-bottom-color: var(--accent);
    }


/* =========================================================
 SPEECH
   ========================================================= */
#voiceToggleBtn {
    transition: background-color 0.2s ease, color 0.2s ease;
}

    #voiceToggleBtn.listening {
        background-color: #198754; /* Bootstrap green */
        color: #fff;
        border-color: #198754;
    }

    #voiceToggleBtn.offline {
        background-color: #dc3545; /* Bootstrap red */
        color: #fff;
        border-color: #dc3545;
    }

/* =========================================================
   DROPDOWNS
   ========================================================= */

.dropdown-menu {
    border-radius: 0.75rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border: none;
}

.dropdown-item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-weight: 500;
}

    .dropdown-item:hover {
        background: var(--light-bg);
        transform: translateX(3px);
    }

/* =========================================================
   LANDING / MARKETING
   ========================================================= */
.landing-hero {
    min-height: calc(100vh - 70px);
    background: linear-gradient(180deg, #f8fafc, #eef4f2);
    padding: 5rem 1rem;
}

.feature-card {
    background: var(--white);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 18px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

    .feature-card:hover {
        transform: translateY(-5px);
    }

/* =========================================================
   DASHBOARD / OFFICE UI
   ========================================================= */
.dashboard {
    min-height: calc(100vh - 70px);
    padding-bottom: 4rem;
}

.info-card {
    background: var(--white);
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.25s ease;
}

    .info-card:hover {
        transform: translateY(-3px);
    }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

    .btn-primary:hover {
        background-color: var(--primary-dark);
    }

.btn-success {
    background-color: var(--accent);
    border-color: var(--accent);
    font-weight: 600;
}

    .btn-success:hover {
        background-color: var(--accent-dark);
    }
/* Dispatch progress button */
.btn-dispatch {
    min-width: 170px;
    text-align: center;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

    .btn-dispatch::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient( 120deg, transparent 0%, rgba(40, 167, 69, 0.35) 50%, transparent 100% );
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .btn-dispatch.in-progress::after {
        animation: dispatch-progress 1.2s linear infinite;
    }

@keyframes dispatch-progress {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

/* =========================================================
   RFID – SHARED UI
   ========================================================= */
.rfid-status {
    font-size: 1.4rem;
    font-weight: 600;
}

.rfid-counter {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent);
}

/* =========================================================
   RFID TABLET MODE
   (enabled via body.tablet-mode)
   ========================================================= */
body.tablet-mode {
    background: #000;
    color: #fff;
}

    body.tablet-mode .navbar,
    body.tablet-mode footer {
        display: none;
    }

    body.tablet-mode .container {
        max-width: 100%;
        padding: 1.5rem;
    }

    body.tablet-mode button {
        font-size: 1.8rem;
        padding: 1.25rem 2rem;
    }

/* =========================================================
   SCANNING OVERLAY (TABLET SAFE)
   ========================================================= */
.scan-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 5000;
    align-items: center;
    justify-content: center;
    text-align: center;
}

    .scan-overlay.active {
        display: flex;
    }

.scan-animation {
    color: white;
}

.scanner-ring {
    width: 140px;
    height: 140px;
    border: 6px solid rgba(255,255,255,0.25);
    border-top-color: white;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1.2s linear infinite;
}

.scanner-icon {
    font-size: 3rem;
    animation: pulse 1.2s ease-in-out infinite;
}

.scanner-text {
    font-size: 2rem;
    font-weight: 600;
}

.scanner-subtext {
    opacity: 0.8;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%,100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

#currentTag.flash {
    animation: pulse 0.3s ease-out;
}

@keyframes pulse {
    from {
        background-color: #e7f1ff;
    }

    to {
        background-color: #f8f9fa;
    }
}


/* =========================================================
   LOOK UP
   ========================================================= */
.status-light {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#statusText {
    font-size: 1.4rem;
    line-height: 1;
    margin-top: 2px;
}


.status-ok {
    background: #28a745;
    box-shadow: 0 0 18px rgba(40,167,69,0.8);
}

.status-warn {
    background: #ffc107;
    box-shadow: 0 0 18px rgba(255,193,7,0.8);
}

.status-bad {
    background: #dc3545;
    box-shadow: 0 0 22px rgba(220,53,69,0.9);
    animation: pulse-red 1.2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

.scan-controls {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    padding-top: 0.5rem;
}

.status-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.status-text {
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
}

#scanTable tr {
    cursor: pointer;
}

    #scanTable tr.selected {
        background-color: #eef5ff;
        font-weight: 600;
    }

    #scanTable tr.unregistered td {
        color: #b02a37;
    }



/* ============================= */
/* Large status light            */
/* ============================= */

.status-light-lg {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #ccc;
    box-shadow: inset 0 0 0 6px rgba(255,255,255,0.6), 0 0 20px rgba(0,0,0,0.2);
}

/* States */
.status-ok {
    background: #28a745;
    box-shadow: 0 0 25px rgba(40,167,69,0.8);
}

.status-warn {
    background: #ffc107;
    box-shadow: 0 0 25px rgba(255,193,7,0.8);
}

.status-bad {
    background: #dc3545;
    box-shadow: 0 0 25px rgba(220,53,69,0.9);
}

/* Optional pulse on change */
.status-light-lg.flash {
    animation: pulse 0.4s ease-out;
}

@keyframes pulse {
    from {
        transform: scale(0.85);
    }

    to {
        transform: scale(1);
    }
}
#recentReads .list-group-item {
    font-size: 1.25rem;
}


/* =========================================================
  VOICE CONTROL AZURE
   ========================================================= */

.voice-btn {
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}


    .voice-btn.listening {
        animation: voicePulse 1.5s infinite;
    }

@keyframes voicePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.6);
    }

    70% {
        box-shadow: 0 0 0 0.4rem rgba(25, 135, 84, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0);
    }
}

.voice-btn.error {
    background-color: #dc3545; /* Bootstrap danger */
    border-color: #dc3545;
    color: #fff;
}





/* =========================================================
   FOOTER
   ========================================================= */
footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
    color: var(--text-grey);
}
