/* ==========================================================================
   C&N Money Exchange - POS Terminal Specific CSS (LIGHT THEME)
   ========================================================================== */

.pos-container {
    display: grid;
    grid-template-columns: 480px 1fr; /* Increased slightly for senior spacing */
    height: 100vh;
    overflow: hidden;
    background: var(--bg-primary);
}

@media (max-width: 1200px) {
    .pos-container {
        grid-template-columns: 1fr;
        height: auto;
        overflow: auto;
    }
}

/* ==========================================================================
   Sidebar: Transaction panel (Left Pane)
   ========================================================================== */
.pos-sidebar {
    background: var(--bg-tertiary);
    border-right: 2.5px solid var(--card-border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 1.5rem;
    gap: 1.5rem;
}

.pos-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-bottom: 2px solid var(--card-border);
    padding-bottom: 1rem;
}

.booth-title {
    font-size: 1.35rem; /* Larger */
    color: var(--accent-cyan);
    font-weight: 800;
}

.vault-stats {
    background: #ffffff;
    border: 2px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* Multi-Currency Calculator Box */
.calculator-box {
    background: #ffffff;
    border: 2.5px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.calc-type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-tertiary);
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--card-border);
}

.toggle-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toggle-btn.active.buy {
    background: #059669;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}

.toggle-btn.active.sell {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.calc-display {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: #0f172a; /* Keep display high-contrast dark for senior visibility */
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: right;
}

.calc-display .label {
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: left;
    font-weight: 600;
}

.calc-display .value {
    font-family: var(--font-heading);
    font-size: 2.2rem; /* Gigantic readable font */
    font-weight: 800;
    color: #ffffff;
}

.calc-display .sub-value {
    font-size: 1.15rem;
    color: #cbd5e1;
    font-weight: 700;
}

/* Multi-Currency Cart Table Inside POS Sidebar */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.cart-table th {
    border-bottom: 2px solid var(--card-border);
    padding: 0.5rem 0.25rem;
    text-align: left;
    font-weight: bold;
    color: var(--text-muted);
}

.cart-table td {
    padding: 0.65rem 0.25rem;
    border-bottom: 1.5px solid var(--card-border);
    color: var(--text-main);
}

.cart-delete-btn {
    background: transparent;
    border: none;
    color: var(--accent-rose);
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
}

.cart-delete-btn:hover {
    background: var(--accent-rose-glow);
}

/* Customer Registration & Web OCR */
.customer-section {
    background: #ffffff;
    border: 2.5px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.passport-scan-box {
    border: 2.5px dashed var(--card-border-hover);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-tertiary);
    margin-bottom: 1.25rem;
}

.passport-scan-box:hover {
    border-color: var(--accent-cyan);
    background: var(--accent-cyan-glow);
}

.customer-detail-tag {
    background: var(--bg-tertiary);
    border-left: 5px solid var(--accent-cyan);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--card-border);
    border-right: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}

/* ==========================================================================
   Main Grid: Live rate controller (Right Pane)
   ========================================================================== */
.pos-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--bg-primary);
}

.pos-top-bar {
    background: #ffffff;
    border-bottom: 2.5px solid var(--card-border);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Main POS Tabs Selector Navigation */
.pos-tab-navbar {
    display: flex;
    background: var(--bg-tertiary);
    border: 2px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 0.35rem;
    gap: 0.35rem;
}

.pos-tab-btn {
    border: none;
    background: transparent;
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pos-tab-btn.active {
    background: #ffffff;
    color: var(--accent-cyan);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.search-currency-container {
    width: 350px;
    position: relative;
}

/* Multi-View Pages inside POS */
.pos-page-view {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.pos-page-view.active {
    display: block;
}

/* Currency Grid Card */
.currency-rate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); /* Increased card sizes */
    gap: 1.25rem;
}

.currency-card {
    background: #ffffff;
    border: 2.5px solid var(--card-border); /* Thicker borders */
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 3px 6px rgba(0,0,0,0.02);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.currency-card:hover {
    border-color: var(--accent-cyan);
    background: var(--card-bg-hover);
}

.currency-card.active-selected {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px var(--accent-cyan-glow);
    background: rgba(2, 132, 199, 0.02);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.currency-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.flag-emoji {
    font-size: 2rem; /* Massive readable flags */
}

.currency-code-display {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.3rem; /* Huge readable codes */
    color: var(--text-main);
}

.denomination-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    border: 1.5px solid var(--card-border);
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-tertiary);
}

.card-rates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.rate-box {
    display: flex;
    flex-direction: column;
    background: var(--bg-tertiary);
    border: 2px solid var(--card-border);
    border-radius: 6px;
    padding: 0.65rem;
    align-items: center;
    position: relative;
    transition: all var(--transition-fast);
}

.rate-box:hover {
    border-color: var(--accent-cyan);
    background: #ffffff;
}

.rate-box .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.rate-box .rate-val {
    font-family: var(--font-heading);
    font-size: 1.35rem; /* Larger */
    font-weight: 800;
}

.rate-box.buy .rate-val { color: var(--accent-emerald); }
.rate-box.sell .rate-val { color: var(--accent-rose); }

/* Inline Edit input */
.rate-edit-input {
    width: 100%;
    background: #ffffff;
    border: 2.5px solid var(--accent-cyan);
    color: var(--text-main);
    text-align: center;
    padding: 4px;
    font-size: 1.25rem; /* Large font size */
    font-weight: 800;
    border-radius: 4px;
    display: none; /* toggled via JS */
}

.card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-top: 2px dashed var(--card-border);
    padding-top: 0.75rem;
}

.card-footer .stock-val {
    font-weight: 800;
    color: var(--text-main);
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45); /* Soft light dim overlay */
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-window {
    background: #ffffff;
    border: 3px solid var(--card-border);
    border-radius: var(--radius-lg);
    width: 650px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.2);
}

.modal-overlay.active .modal-window {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--card-border);
    padding-bottom: 1rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--accent-rose);
}

/* Receipt Selector */
.receipt-type-selector {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.receipt-type-radio {
    flex: 1;
    border: 2.5px solid var(--card-border);
    background: #ffffff;
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.receipt-type-radio.selected {
    border-color: var(--accent-cyan);
    background: var(--accent-cyan-glow);
    color: var(--accent-cyan);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    background: #ffffff;
    border-left: 6px solid var(--accent-cyan);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
    border-top: 2px solid var(--card-border);
    border-right: 2px solid var(--card-border);
    border-bottom: 2px solid var(--card-border);
    padding: 1.25rem 2rem;
    z-index: 2000;
    transform: translateY(150%);
    transition: transform var(--transition-normal);
}

.toast.active {
    transform: translateY(0);
}

/* OCR Scanning Animation & Passport Viewer Styles */
.ocr-scan-line {
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    box-shadow: 0 0 8px var(--accent-cyan);
    position: relative;
    animation: scanLineAnim 2s infinite linear;
}

@keyframes scanLineAnim {
    0% { top: -10px; }
    50% { top: 10px; }
    100% { top: -10px; }
}

.passport-badge-uploaded {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-cyan-glow);
    color: var(--accent-cyan);
    border: 1px solid rgba(2, 132, 199, 0.25);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.passport-badge-uploaded:hover {
    background: var(--accent-cyan);
    color: #ffffff;
}
