/* ==========================================
   ATHERIOT TRAVEL — CUSTOMER VIEW
   Responsive, scrollable customer directory
   Theme-aware: Light / Dark / AMOLED
========================================== */

/* ==========================================
   THEME VARIABLES
========================================== */

.customer-modal {
    --customer-dialog-bg: var(--surface-primary, var(--bg-primary, #ffffff));
    --customer-text: var(--text-primary, #1e293b);
    --customer-text-secondary: var(--text-secondary, #64748b);

    --customer-border: var(--border-color, #e2e8f0);
    --customer-item-bg: var(--surface-secondary, #f8fafc);

    --customer-accent: var(--primary-color, #2563eb);
    --customer-accent-soft: #dbeafe;

    --customer-close-bg: var(--surface-secondary, #f1f5f9);
    --customer-close-text: var(--text-primary, #334155);

    --customer-scrollbar: #cbd5e1;
}

/* ==========================================
   DARK THEME
========================================== */

[data-theme="dark"] .customer-modal,
[data-theme="amoled"] .customer-modal {
    --customer-dialog-bg: var(--surface-primary, #1e293b);
    --customer-text: var(--text-primary, #f8fafc);
    --customer-text-secondary: var(--text-secondary, #94a3b8);

    --customer-border: var(--border-color, #334155);
    --customer-item-bg: var(--surface-secondary, #0f172a);

    --customer-accent: var(--primary-color, #60a5fa);
    --customer-accent-soft: #1e3a5f;

    --customer-close-bg: var(--surface-secondary, #334155);
    --customer-close-text: var(--text-primary, #f8fafc);

    --customer-scrollbar: #475569;
}

/* ==========================================
   MODAL VISIBILITY
========================================== */

.customer-modal[hidden] {
    display: none !important;
}

.customer-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
    padding: 16px;

    background: rgba(0, 0, 0, 0.5);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ==========================================
   MAIN DIALOG
========================================== */

.customer-dialog {
    box-sizing: border-box;

    width: min(100%, 700px);
    max-height: min(85dvh, 750px);

    min-width: 0;
    min-height: 0;

    display: flex;
    flex-direction: column;

    padding: 24px;

    background: var(--customer-dialog-bg);
    color: var(--customer-text);

    border: 1px solid var(--customer-border);
    border-radius: 22px;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);

    overflow: hidden;

    color-scheme: light;
}

[data-theme="dark"] .customer-dialog,
[data-theme="amoled"] .customer-dialog {
    color-scheme: dark;
}

/* AMOLED background */

[data-theme="amoled"] .customer-modal {
    --customer-dialog-bg: #000000;
    --customer-item-bg: #080808;
    --customer-border: #262626;
    --customer-close-bg: #171717;
    --customer-scrollbar: #404040;
}

/* ==========================================
   HEADER
========================================== */

.customer-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 16px;
    flex-shrink: 0;
    min-width: 0;
}

.customer-dialog-header>div {
    min-width: 0;
}

.customer-dialog-header h2 {
    margin: 0;

    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;

    color: var(--customer-text);

    overflow-wrap: anywhere;
}

.customer-dialog-header p {
    margin: 8px 0 0;

    font-size: 13px;
    line-height: 1.5;

    color: var(--customer-text-secondary);
}

/* ==========================================
   CLOSE BUTTON
========================================== */

.customer-close {
    display: grid;
    place-items: center;

    flex: 0 0 44px;

    width: 44px;
    height: 44px;

    padding: 0;

    border: none;
    border-radius: 12px;

    background: var(--customer-close-bg);
    color: var(--customer-close-text);

    font-size: 26px;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.customer-close:hover {
    filter: brightness(0.95);
}

.customer-close:focus-visible {
    outline: 2px solid var(--customer-accent);
    outline-offset: 3px;
}

/* ==========================================
   CUSTOMER COUNT
========================================== */

.customer-count {
    flex-shrink: 0;

    margin-top: 20px;
    padding-bottom: 14px;

    border-bottom: 1px solid var(--customer-border);

    font-size: 14px;
    font-weight: 700;

    color: var(--customer-accent);
}

/* ==========================================
   SCROLLABLE CUSTOMER LIST
========================================== */

.customer-list {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    align-content: start;
    gap: 12px;

    min-width: 0;
    min-height: 0;

    flex: 0 1 auto;

    margin-top: 18px;
    padding-right: 6px;

    overflow-y: auto;
    overflow-x: hidden;

    overscroll-behavior: contain;

    scrollbar-width: thin;
    scrollbar-color: var(--customer-scrollbar) transparent;
}

/* Chrome, Edge and Safari scrollbar */

.customer-list::-webkit-scrollbar {
    width: 6px;
}

.customer-list::-webkit-scrollbar-track {
    background: transparent;
}

.customer-list::-webkit-scrollbar-thumb {
    background: var(--customer-scrollbar);
    border-radius: 10px;
}

.customer-list::-webkit-scrollbar-thumb:hover {
    filter: brightness(0.85);
}

/* ==========================================
   CUSTOMER TILE
========================================== */

.customer-item {
    box-sizing: border-box;

    display: flex;
    align-items: center;

    gap: 12px;

    min-width: 0;
    min-height: 76px;

    padding: 12px 15px;

    background: var(--customer-item-bg);
    color: var(--customer-text);

    border: 1px solid var(--customer-border);
    border-radius: 16px;
}

/* ==========================================
   CUSTOMER AVATAR
========================================== */

.customer-avatar {
    display: grid;
    place-items: center;

    flex: 0 0 46px;

    width: 46px;
    height: 46px;

    border-radius: 50%;

    background: var(--customer-accent-soft);
    color: var(--customer-accent);

    font-size: 18px;
    font-weight: 700;
}

/* ==========================================
   CUSTOMER NAME
========================================== */

.customer-name {
    min-width: 0;

    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;

    color: var(--customer-text);

    overflow-wrap: anywhere;
    word-break: normal;
}

/* ==========================================
   EMPTY STATE
========================================== */

.customer-empty {
    grid-column: 1 / -1;

    margin: 0;
    padding: 32px 12px;

    text-align: center;

    font-size: 14px;
    line-height: 1.6;

    color: var(--customer-text-secondary);
}

/* ==========================================
   FOOTER
========================================== */

.customer-note {
    flex-shrink: 0;

    margin: 18px 0 0;
    padding-top: 4px;

    font-size: 12px;
    line-height: 1.5;

    text-align: center;

    color: var(--customer-text-secondary);
}

/* ==========================================
   TABLET
========================================== */

@media (max-width: 768px) {

    .customer-dialog {
        width: min(100%, 620px);
        padding: 22px;
    }

    .customer-item {
        padding: 12px;
    }
}

/* ==========================================
   MOBILE
========================================== */

@media (max-width: 480px) {

    .customer-modal {
        padding: 12px;
    }

    .customer-dialog {
        width: 100%;
        max-height: 90dvh;

        padding: 18px;

        border-radius: 18px;
    }

    .customer-dialog-header h2 {
        font-size: 19px;
    }

    .customer-dialog-header p {
        font-size: 12px;
    }

    .customer-count {
        margin-top: 16px;
        padding-bottom: 12px;
    }

    .customer-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;

        margin-top: 14px;
        padding-right: 4px;
    }

    .customer-item {
        min-height: 66px;
        padding: 10px 12px;
        gap: 10px;

        border-radius: 14px;
    }

    .customer-avatar {
        flex-basis: 40px;
        width: 40px;
        height: 40px;

        font-size: 16px;
    }

    .customer-name {
        font-size: 14px;
    }

    .customer-note {
        margin-top: 14px;
        font-size: 11px;
    }
}

/* ==========================================
   VERY SMALL SCREENS
========================================== */

@media (max-width: 320px) {

    .customer-modal {
        padding: 6px;
    }

    .customer-dialog {
        padding: 12px;
        border-radius: 14px;
    }

    .customer-dialog-header {
        gap: 8px;
    }

    .customer-dialog-header h2 {
        font-size: 17px;
    }

    .customer-close {
        flex-basis: 34px;
        width: 34px;
        height: 34px;

        font-size: 22px;
    }

    .customer-item {
        padding: 8px;
    }

    .customer-avatar {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }

    .customer-name {
        font-size: 12px;
    }
}

/* ==========================================
   SHORT SCREENS
========================================== */

@media (max-height: 450px) {

    .customer-dialog {
        max-height: 94dvh;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .customer-count {
        margin-top: 10px;
        padding-bottom: 8px;
    }

    .customer-list {
        margin-top: 10px;
    }

    .customer-note {
        margin-top: 10px;
    }
}

/* ==========================================
   REDUCED MOTION
========================================== */

@media (prefers-reduced-motion: reduce) {

    .customer-close {
        transition: none;
    }

    .customer-modal {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}



/* ==========================================
   ATHERIOT TRAVEL — CUSTOMER VIEW
   Integrated with global theme variables
========================================== */

/* MAIN DIALOG */

.customer-dialog {
    background: var(--surface);
    color: var(--text);

    border: 1px solid var(--border);

    box-shadow: var(--shadow);
}

/* HEADER */

.customer-dialog-header h2 {
    color: var(--heading);
}

.customer-dialog-header p {
    color: var(--muted);
}

/* CLOSE BUTTON */

.customer-close {
    background: var(--surface-secondary);
    color: var(--text);
}

.customer-close:hover {
    background: var(--hover-bg);
    color: var(--heading);
}

.customer-close:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

/* CUSTOMER COUNT */

.customer-count {
    color: var(--primary);
    border-bottom-color: var(--border);
}

/* CUSTOMER LIST */

.customer-list {
    scrollbar-color: var(--input-border) transparent;
}

.customer-list::-webkit-scrollbar-thumb {
    background: var(--input-border);
}

/* CUSTOMER TILE */

.customer-item {
    background: var(--surface-secondary);
    color: var(--text);

    border-color: var(--border);
}

/* CUSTOMER AVATAR */

.customer-avatar {
    background: var(--empty-icon-bg);
    color: var(--empty-icon-color);
}

/* CUSTOMER NAME */

.customer-name {
    color: var(--text);
}

/* EMPTY STATE */

.customer-empty {
    color: var(--muted);
}

/* FOOTER */

.customer-note {
    color: var(--muted);
}