/* 
   Keshari Laminate & Veneer - Custom Premium Stylesheet
   Created with love for a luxury, modern wood and laminate styling experience.
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #311e15;
    /* Deep Mahogany / Dark Oak */
    --primary-light: #4d3326;
    /* Rich walnut */
    --primary-gradient: linear-gradient(135deg, #311e15 0%, #4d3326 100%);
    --accent-color: #d4af37;
    /* Luxury Gold / Polished Brass */
    --accent-hover: #bda02b;
    --accent-light: rgba(212, 175, 55, 0.1);
    --bg-color: #f7f5f0;
    /* Soft Ivory Cream */
    --bg-card: #ffffff;
    --text-dark: #20130e;
    /* Very dark warm brown */
    --text-muted: #73645c;
    --border-color: #e5dfd5;
    /* Delicate warm border */

    /* Harmonious Alert Colors */
    --color-pending: #df9b15;
    /* Warm Mustard */
    --color-processing: #248afd;
    /* Royal Blue */
    --color-dispatched: #8540f5;
    /* Modern Purple */
    --color-completed: #1da356;
    /* Emerald Green */
    --color-rejected: #d33a4c;
    /* Soft Ruby Crimson */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    font-size: 0.95rem;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Header & Brand styling */
.brand-header {
    background: var(--primary-gradient);
    color: #ffffff;
    padding: 1.25rem 2rem;
    box-shadow: 0 4px 20px rgba(49, 30, 21, 0.15);
    border-bottom: 3px solid var(--accent-color);
}

.brand-logo-text {
    font-weight: 800;
    letter-spacing: 1.5px;
    font-size: 1.5rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.brand-logo-text span {
    color: var(--accent-color);
}

.brand-tagline {
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-top: -3px;
}

/* Premium Card Designs */
.keshari-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(49, 30, 21, 0.04);
    padding: 1.75rem;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    margin-bottom: 1.5rem;
}

.keshari-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(49, 30, 21, 0.08);
}

.keshari-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Beautiful Role Selector pills */
.role-pills {
    background-color: rgba(49, 30, 21, 0.05);
    padding: 0.4rem;
    border-radius: 30px;
    display: inline-flex;
    gap: 0.25rem;
    border: 1px solid rgba(49, 30, 21, 0.08);
}

.role-pill-btn {
    border: none;
    background: transparent;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.role-pill-btn.active {
    background: var(--primary-gradient);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(49, 30, 21, 0.2);
}

.role-pill-btn:hover:not(.active) {
    background-color: rgba(49, 30, 21, 0.08);
    color: var(--primary-color);
}

/* Status Badge styling */
.badge-pending {
    background-color: rgba(223, 155, 21, 0.12);
    color: var(--color-pending);
    border: 1px solid rgba(223, 155, 21, 0.25);
}

.badge-processing {
    background-color: rgba(36, 138, 253, 0.12);
    color: var(--color-processing);
    border: 1px solid rgba(36, 138, 253, 0.25);
}

.badge-dispatched {
    background-color: rgba(133, 64, 245, 0.12);
    color: var(--color-dispatched);
    border: 1px solid rgba(133, 64, 245, 0.25);
}

.badge-completed {
    background-color: rgba(29, 163, 86, 0.12);
    color: var(--color-completed);
    border: 1px solid rgba(29, 163, 86, 0.25);
}

.badge-rejected {
    background-color: rgba(211, 58, 76, 0.12);
    color: var(--color-rejected);
    border: 1px solid rgba(211, 58, 76, 0.25);
}

/* Inputs & Form Elements */
.form-label {
    font-weight: 600;
    color: var(--primary-light);
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    color: var(--text-dark);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
    outline: none;
}

/* Quantity Counter Custom Control */
.quantity-input-group {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    max-width: 150px;
}

.quantity-btn {
    border: none;
    background: #fcfbfa;
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.quantity-btn:hover {
    background-color: var(--border-color);
}

.quantity-value {
    width: 50px;
    text-align: center;
    border: none;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
    background: transparent;
}

.quantity-value:focus {
    outline: none;
}

/* Size Custom Radio styling */
.size-option-wrapper {
    display: flex;
    gap: 1rem;
}

.size-radio-label {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    background: #fff;
}

.size-radio-input {
    display: none;
}

.size-radio-input:checked+.size-radio-label {
    border-color: var(--accent-color);
    background-color: var(--accent-light);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.15);
}

/* Custom Styled Buttons */
.btn-keshari-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(49, 30, 21, 0.15);
    transition: all 0.25s ease;
}

.btn-keshari-primary:hover {
    background: var(--accent-color);
    color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.25);
    transform: translateY(-1px);
}

.btn-keshari-secondary {
    background: #ffffff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.25s ease;
}

.btn-keshari-secondary:hover {
    background-color: rgba(49, 30, 21, 0.05);
    color: var(--primary-color);
}

/* Kanban Board Styling */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-top: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

@media (max-width: 992px) {
    .kanban-board {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
}

.kanban-column {
    background-color: rgba(49, 30, 21, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    border-bottom: 3px solid var(--border-color);
}

.kanban-column:nth-child(1) .kanban-column-header {
    border-bottom-color: var(--color-pending);
}

.kanban-column:nth-child(2) .kanban-column-header {
    border-bottom-color: var(--color-processing);
}

.kanban-column:nth-child(3) .kanban-column-header {
    border-bottom-color: var(--accent-color);
}

.kanban-column:nth-child(4) .kanban-column-header {
    border-bottom-color: var(--color-dispatched);
}

.kanban-count {
    background-color: rgba(49, 30, 21, 0.08);
    border-radius: 20px;
    padding: 0.15rem 0.6rem;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

.kanban-cards-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
    overflow-y: auto;
    max-height: 550px;
    padding: 0.2rem;
}

/* Kanban / Trello Card Styling */
.trello-card {
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1rem;
    box-shadow: 0 4px 10px rgba(49, 30, 21, 0.02);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    height: auto !important;
    min-height: fit-content;
}

.trello-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--accent-color);
}

.trello-card:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 15px rgba(49, 30, 21, 0.06);
    border-color: var(--accent-color);
}

.trello-card-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.trello-card-dealer {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary-color);
}

.trello-card-item {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.trello-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.trello-card-actions button {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.35rem;
    font-weight: 600;
    border-radius: 6px;
}

/* Dynamic Alert Sound Effect Button or Interactive Elements */
.badge-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background-color: var(--color-rejected);
    border-radius: 50%;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(211, 58, 76, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(211, 58, 76, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(211, 58, 76, 0);
    }
}

/* Billing Desk Split Screen Layout */
.billing-split {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .billing-split {
        grid-template-columns: 1fr;
    }
}

.billing-item-row {
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: rgba(49, 30, 21, 0.01);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.billing-item-row.active {
    border-color: var(--accent-color);
    background-color: var(--accent-light);
}

/* Driver View Flat Responsive Layout (No virtual phone mockup frame) */
.driver-view-container {
    max-width: 100%;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    min-height: auto;
    position: relative;
    overflow: visible;
    display: block;
}

/* Remove virtual phone camera notch cutout */
.driver-view-container::after {
    display: none;
}

.driver-body {
    padding: 0;
    flex-grow: 1;
    background-color: transparent;
}

.driver-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 1.5rem;
}

.driver-large-btn {
    font-size: 1.2rem;
    font-weight: 700;
    padding: 1.2rem;
    border-radius: 14px;
    box-shadow: 0 6px 15px rgba(29, 163, 86, 0.3);
}

.driver-card {
    background-color: #fff;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: 0 8px 20px rgba(49, 30, 21, 0.03);
    margin-bottom: 1.25rem;
}

/* Custom animations */
.fade-in-section {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sound indicator status text */
.interactive-hint {
    font-size: 0.75rem;
    color: var(--accent-hover);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.table-responsive {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #fff;
}

.table thead {
    background: var(--primary-gradient);
    color: #ffffff;
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
    border: none;
}

.table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    color: var(--text-dark);
}

/* Loader simulation */
.loader-spinner {
    width: 2rem;
    height: 2rem;
    color: var(--accent-color);
}

/* ========================================================
   Mobile Responsiveness Enhancements (Media Queries)
   ======================================================== */

/* Adapt tables for small screens to prevent squishing */
@media (max-width: 767px) {

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    /* Convert horizontal borders to vertical bottom borders when stacked */
    .border-end {
        border-right: none !important;
        border-bottom: 1px solid var(--border-color) !important;
        padding-bottom: 1.25rem;
        margin-bottom: 1.25rem;
    }
}

/* Tablet & Mobile Specific Enhancements */
@media (max-width: 768px) {
    body {
        font-size: 0.9rem;
    }

    /* Transform header into a solid responsive mobile grid */
    .brand-header {
        display: grid !important;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 0.75rem !important;
        padding: 0.75rem 1rem !important;
    }

    /* Logo container on grid top-left */
    .brand-header>div:first-child {
        grid-column: 1;
        grid-row: 1;
        display: flex;
        align-items: center;
        gap: 0.5rem !important;
    }

    /* Lift layout restriction from sub-container so children act as direct grid cells */
    .brand-header>div:last-child {
        display: contents !important;
    }

    /* Sound button on grid top-right */
    #sound-toggle {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        width: 38px;
        height: 38px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin: 0;
    }

    /* Transform role selector bar into horizontally swipeable navigation spanning both grid columns */
    .role-pills {
        grid-column: 1 / span 2;
        grid-row: 2;
        width: 100%;
        margin-top: 0.25rem;
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        max-width: 100%;
        border-radius: 20px;
        padding: 0.25rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Firefox */
    }

    .role-pills::-webkit-scrollbar {
        display: none;
        /* Safari / Chrome */
    }

    .role-pill-btn {
        flex: 0 0 auto;
        padding: 0.4rem 0.8rem;
        font-size: 0.78rem;
        gap: 0.35rem;
    }

    .keshari-card {
        padding: 1.25rem 1rem;
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    .keshari-card-title {
        font-size: 1.05rem;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
    }
}

/* Smartphone Specific Enhancements */
@media (max-width: 576px) {

    /* Scale down the circular logo icon wrapper to preserve title horizontal spacing */
    .brand-header div.rounded-circle[style*="width: 50px"] {
        width: 40px !important;
        height: 40px !important;
        padding: 0.35rem !important;
    }

    .brand-header div.rounded-circle i.fs-3 {
        font-size: 1.25rem !important;
    }

    .brand-logo-text {
        font-size: 1rem;
        letter-spacing: 0.5px;
    }

    .brand-tagline {
        font-size: 0.58rem;
        letter-spacing: 0.5px;
    }

    .size-option-wrapper {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .size-radio-label {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    /* Compress empty spaces in stacked Kanban Columns */
    .kanban-column {
        min-height: auto;
        gap: 0.75rem;
        padding: 1rem 0.75rem;
    }

    /* Make Driver App mockup native and border-less on physical phone screen */
    .driver-view-container {
        max-width: 100%;
        border: none !important;
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
    }

    .driver-view-container::after {
        display: none !important;
        /* Hide phone notch */
    }

    .driver-body {
        padding: 1.25rem 1rem;
    }
}

/* ========================================================
   Portal Gateway & Workspace Card Visual Styles
   ======================================================== */

.portal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(49, 30, 21, 0.02);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-radius: 16px !important;
}

.portal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(49, 30, 21, 0.08);
    border-color: var(--accent-color) !important;
}

.portal-icon {
    transition: all 0.3s ease;
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.portal-card:hover .portal-icon {
    background-color: var(--accent-light) !important;
    color: var(--primary-color) !important;
    border-color: var(--accent-color) !important;
}

/* Header active workspace tweaks */
#active-workspace-badge {
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.15);
    font-size: 0.82rem;
    letter-spacing: 0.5px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

#btn-switch-portal {
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.1);
    transition: all 0.2s ease;
    font-size: 0.82rem;
}

#btn-switch-portal:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

/* ========================================================
   Mobile-Responsive Table-to-Card Stacking pattern
   ======================================================== */
@media (max-width: 768px) {

    /* Hide the flat header row completely */
    .responsive-table thead {
        display: none;
    }

    /* Convert all table structures to standard responsive block grids */
    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    /* Convert each table row into an individual luxury card with wood accent borders */
    .responsive-table tr {
        background-color: var(--bg-card);
        border: 1.5px solid var(--border-color);
        border-radius: 14px;
        padding: 1.25rem 1rem;
        margin-bottom: 1.25rem;
        box-shadow: 0 4px 15px rgba(49, 30, 21, 0.03);
        position: relative;
        overflow: hidden;
        transition: all 0.25s ease;
    }

    .responsive-table tr:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(49, 30, 21, 0.06);
        border-color: var(--accent-color);
    }

    /* Gold indicator stripe at the left margin of each stacked row card */
    .responsive-table tr::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
        background: var(--primary-gradient);
    }

    /* Style the table cells as clean flex rows with left labels and right values */
    .responsive-table td {
        border: none !important;
        padding: 0.6rem 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        border-bottom: 1px dashed rgba(49, 30, 21, 0.06) !important;
        font-size: 0.9rem;
    }

    /* Strip border from the final cell in the card to keep margins crisp */
    .responsive-table td:last-child {
        border-bottom: none !important;
        padding-bottom: 0;
        margin-bottom: 0;
        justify-content: center;
        /* Center action items at the bottom */
        width: 100%;
        margin-top: 0.5rem;
    }

    /* Inject headers dynamically using data-label labels */
    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.72rem;
        letter-spacing: 0.5px;
        text-align: left;
        margin-right: 1rem;
    }
}