/* POS Simulator Styles */

/* POS Body */
.pos-body {
    width: var(--device-pos-width);
    max-width: 100%;
    background: linear-gradient(180deg, var(--pos-body) 0%, var(--pos-body-light) 30%, var(--pos-body) 100%);
    border-radius: 24px 24px 40px 40px;
    box-shadow: 
        var(--shadow-xl),
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    padding: var(--space-md);
    position: relative;
    /* Container query support */
    container-type: inline-size;
    container-name: pos-device;
}

.pos-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: var(--accent-gradient-horizontal);
    border-radius: 0 0 3px 3px;
}

/* POS Top Section */
.pos-top {
    margin-bottom: var(--space-md);
}

/* POS Screen Frame - Unified device display */
.pos-screen-frame {
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
    border-radius: var(--radius-lg);
    padding: 8px;
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    border: 1px solid #2a2a2a;
}

/* Screen frame accent line */
.pos-screen-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 2px;
    background: var(--accent-gradient-horizontal);
    border-radius: 0 0 2px 2px;
    z-index: 1;
}

.pos-screen {
    width: 100%;
    height: clamp(160px, 30vw, 220px);
    background: linear-gradient(180deg, #ffffff 0%, var(--bg-secondary) 100%);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: var(--text-sm);
    color: var(--text-primary);
    overflow: hidden;
    position: relative;
    transition: height 0.3s ease;
    box-shadow: inset 0 0 10px rgba(0, 56, 106, 0.05);
}

/* POS Screen Content */
.pos-welcome {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: var(--space-sm);
}

.pos-welcome-logo {
    font-size: var(--text-lg);
    font-weight: 700;
}

.pos-welcome-logo .pay {
    color: var(--pay-orange);
}

.pos-welcome-logo .zillion {
    color: var(--zillion-blue);
}

.pos-welcome p {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin: 0;
}

.pos-idle-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 10px;
    color: var(--success);
}

.pos-idle-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: blink 2s infinite;
}

.pos-menu {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pos-menu-header {
    text-align: center;
    font-weight: 600;
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-sm);
    color: var(--zillion-blue);
}

.pos-menu-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.pos-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm);
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--text-xs);
}

.pos-menu-item:hover {
    background: var(--bg-secondary);
    border-color: var(--zillion-blue);
}

.pos-menu-item .key-hint {
    background: var(--zillion-blue);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
}

.pos-amount-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-md);
}

.pos-amount-label {
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.pos-amount-display {
    background: white;
    border: 2px solid var(--zillion-blue);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.pos-currency {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.pos-amount-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--zillion-blue);
}

.pos-amount-hint {
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
}

.pos-card-prompt {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    text-align: center;
}

.pos-card-icons {
    display: flex;
    gap: var(--space-md);
    font-size: 32px;
}

.pos-card-icon {
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pos-card-icon:hover {
    background: var(--info-light);
    transform: scale(1.1);
}

.pos-card-icon.active {
    background: var(--zillion-blue);
    animation: pulse-icon 1s infinite;
}

@keyframes pulse-icon {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 56, 106, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(0, 56, 106, 0); }
}

.pos-card-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.pos-processing {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
}

.pos-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--zillion-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.pos-processing-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.pos-result {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    text-align: center;
}

.pos-result.success {
    color: var(--success);
}

.pos-result.error {
    color: var(--error);
}

.pos-result-icon {
    font-size: 40px;
}

.pos-result-text {
    font-size: var(--text-base);
    font-weight: 600;
}

.pos-result-amount {
    font-size: var(--text-lg);
    font-weight: 700;
}

.pos-result-details {
    font-size: 10px;
    color: var(--text-muted);
}

.pos-pin-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
}

.pos-pin-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.pos-pin-display {
    display: flex;
    gap: var(--space-sm);
}

.pos-pin-dot {
    width: 20px;
    height: 20px;
    border: 2px solid var(--zillion-blue);
    border-radius: 50%;
    background: transparent;
    transition: background var(--transition-fast);
}

.pos-pin-dot.filled {
    background: var(--zillion-blue);
}

/* POS Middle Section */
.pos-middle {
    margin-bottom: var(--space-md);
}

.pos-function-keys {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.pos-func-key {
    width: 50px;
    height: 28px;
    background: linear-gradient(180deg, #4a5568 0%, #3a4558 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.pos-func-key:hover {
    background: linear-gradient(180deg, #5a6578 0%, #4a5568 100%);
}

.pos-func-key:active {
    transform: translateY(1px);
}

.pos-keypad {
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    border: 1px solid #333;
}

.pos-keypad .keypad-row {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-xs);
}

.pos-keypad .keypad-row:last-child {
    margin-bottom: 0;
}

.pos-key {
    flex: 1;
    height: 40px;
    background: linear-gradient(180deg, #4a4a4a 0%, #3a3a3a 100%);
    border: 1px solid #2a2a2a;
    border-radius: var(--radius-sm);
    color: white;
    font-size: var(--text-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.pos-key:hover {
    background: linear-gradient(180deg, #5a5a5a 0%, #4a4a4a 100%);
}

.pos-key:active {
    transform: translateY(2px);
    box-shadow: none;
}

.pos-key.cancel {
    background: linear-gradient(180deg, var(--error) 0%, #DC2626 100%);
}

.pos-key.cancel:hover {
    background: linear-gradient(180deg, #F87171 0%, var(--error) 100%);
}

.pos-key.enter {
    background: linear-gradient(180deg, var(--success) 0%, #059669 100%);
}

.pos-key.enter:hover {
    background: linear-gradient(180deg, #34D399 0%, var(--success) 100%);
}

.pos-key.pressed {
    animation: keyPress 0.15s ease;
}

/* POS Bottom Section */
.pos-bottom {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.pos-card-slots {
    display: flex;
    gap: var(--space-sm);
}

/* Chip Slot */
.pos-chip-slot {
    flex: 1;
    height: 45px;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}

.chip-slot-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* Chip slot label */
.chip-slot-label {
    font-size: 8px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.pos-chip-slot:hover .chip-slot-label {
    color: var(--success);
}

.chip-reader-light {
    width: 30px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    transition: all var(--transition-fast);
}

.pos-chip-slot.active .chip-reader-light {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: blink 0.5s infinite;
}

.pos-chip-slot.reading .chip-reader-light {
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
    animation: blink 0.2s infinite;
}

.inserted-chip-card {
    position: absolute;
    width: 70%;
    height: 45px;
    background: linear-gradient(180deg, #e8e8e8 0%, #d0d0d0 100%);
    border-radius: 6px 6px 0 0;
    bottom: -50px;
    transition: bottom 0.5s ease;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
}

.inserted-chip-card::before {
    content: '';
    width: 30px;
    height: 20px;
    background: linear-gradient(135deg, #ffd700 0%, #daa520 100%);
    border-radius: 3px;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.inserted-chip-card.inserting {
    animation: chipInsert 0.8s ease forwards;
}

.inserted-chip-card.reading {
    bottom: -15px;
}

.inserted-chip-card.ejecting {
    animation: chipEject 0.8s ease forwards;
}

@keyframes chipInsert {
    0% { bottom: -50px; }
    100% { bottom: -15px; }
}

@keyframes chipEject {
    0% { bottom: -15px; }
    100% { bottom: -50px; }
}

/* Contactless Area */
.pos-contactless {
    flex: 1;
    height: 45px;
    background: linear-gradient(180deg, #1a1a2e 0%, #2d2d44 100%);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.pos-contactless:hover {
    background: linear-gradient(180deg, #2d2d44 0%, #3d3d54 100%);
}

.pos-contactless.active {
    background: linear-gradient(180deg, var(--zillion-blue) 0%, var(--zillion-blue-light) 100%);
}

.contactless-icon {
    position: relative;
    width: 24px;
    height: 24px;
}

.wave {
    position: absolute;
    border: 2px solid #666;
    border-radius: 50%;
    border-left-color: transparent;
    border-bottom-color: transparent;
    transform: rotate(-45deg);
}

.wave1 {
    width: 8px;
    height: 8px;
    bottom: 0;
    left: 0;
}

.wave2 {
    width: 12px;
    height: 12px;
    bottom: 0;
    left: 0;
}

.wave3 {
    width: 16px;
    height: 16px;
    bottom: 0;
    left: 0;
}

.wave4 {
    width: 20px;
    height: 20px;
    bottom: 0;
    left: 0;
}

.pos-contactless.active .wave {
    border-color: white;
    border-left-color: transparent;
    border-bottom-color: transparent;
    animation: waveAnim 1.5s infinite;
}

.pos-contactless.active .wave1 { animation-delay: 0s; }
.pos-contactless.active .wave2 { animation-delay: 0.2s; }
.pos-contactless.active .wave3 { animation-delay: 0.4s; }
.pos-contactless.active .wave4 { animation-delay: 0.6s; }

@keyframes waveAnim {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.pos-contactless span {
    font-size: 8px;
    color: #888;
    font-weight: 600;
    letter-spacing: 1px;
}

.pos-contactless.active span {
    color: white;
}

/* POS Receipt Slot */
.pos-receipt-slot {
    display: none;
    height: 20px;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: visible;
}

#pos-receipt-paper {
    position: absolute;
    width: fit-content;
    max-width: 92%;
    left: 50%;
    transform: translateX(-50%) translateY(50%);
    min-height: 0;
    background: #f5f5f0;
    top: -5px;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.5s ease;
    font-family: 'Courier New', monospace;
    font-size: 7px;
    color: #333;
    padding: 4px 6px;
    cursor: pointer;
    z-index: 10;
}

.pos-receipt-slot.printing #pos-receipt-paper {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    animation: posReceiptPrint 1s ease forwards;
}

@keyframes posReceiptPrint {
    0% { 
        max-height: 0;
        opacity: 0;
        overflow: hidden;
    }
    50% {
        opacity: 1;
    }
    100% { 
        max-height: 300px;
        opacity: 1;
        overflow: auto;
    }
}

#pos-receipt-paper:hover {
    transform: translateX(-50%) translateY(-5px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Receipt text styling */
#pos-receipt-paper .receipt-text {
    margin: 0;
    padding: 0;
    font-family: 'Courier New', monospace;
    font-size: 6px;
    line-height: 1.3;
    white-space: pre;
    color: #333;
}

/* POS Receipt Popup - Industry Standard Merchant Receipt */
.pos-receipt-popup {
    display: none;
    position: absolute;
    width: 280px;
    max-width: 100%;
    margin: 0;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    background: #f8f8f5;
    max-height: 55vh;
    overflow-y: auto;
    border-radius: var(--radius-md);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    animation: receiptSlideIn 0.4s ease;
}

.pos-receipt-popup.active {
    display: block;
}

@keyframes receiptSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pos-receipt-popup .receipt-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--zillion-blue) 0%, #004d8a 100%);
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.pos-receipt-popup .receipt-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-receipt-popup .receipt-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pos-receipt-popup .receipt-popup-content {
    padding: 16px;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 11px,
            rgba(0, 0, 0, 0.02) 11px,
            rgba(0, 0, 0, 0.02) 12px
        );
}

.pos-receipt-popup .receipt-popup-content pre {
    margin: 0;
    padding: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    line-height: 1.5;
    white-space: pre;
    color: #333;
    text-align: center;
}

/* Thermal printer edge effect */
.pos-receipt-popup .receipt-popup-content::after {
    content: '';
    display: block;
    height: 8px;
    background: 
        linear-gradient(135deg, transparent 25%, #f8f8f5 25%) -10px 0,
        linear-gradient(225deg, transparent 25%, #f8f8f5 25%) -10px 0;
    background-size: 10px 8px;
    margin-top: 12px;
}

/* POS Branding */
.pos-branding {
    text-align: center;
    padding: var(--space-sm) 0;
    font-size: var(--text-base);
    font-weight: 700;
}

.pos-brand-pay {
    color: var(--pay-orange);
}

.pos-brand-zillion {
    color: white;
}

/* POS Touchscreen Button Styles */
.pos-display-title {
    text-align: center;
    font-weight: 600;
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-sm);
    color: var(--zillion-blue);
    font-size: var(--text-sm);
}

.pos-display-line {
    text-align: center;
    font-size: var(--text-sm);
    padding: 2px 0;
    color: var(--text-primary);
}

/* PIN hint - subtle note for simulator users */
.pos-pin-hint {
    display: inline-block;
    font-size: 10px;
    color: #888;
    font-style: italic;
    background: rgba(0,0,0,.04);
    padding: 1px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.pos-button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 3px;
    padding: 3px;
}

.pos-touch-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%);
    border: 1.5px solid var(--zillion-blue);
    border-radius: var(--radius-sm);
    font-size: clamp(9.5px, 3.8cqi, 13px);
    font-weight: 600;
    color: var(--zillion-blue);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    min-height: 32px;
    padding: 3px 2px;
    position: relative;
    overflow: hidden;
}

.pos-touch-btn u {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pos-btn-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
}

.pos-touch-btn:hover {
    background: linear-gradient(180deg, var(--zillion-blue) 0%, var(--zillion-blue-light) 100%);
    color: white;
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.pos-touch-btn:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Magnetic Stripe Swipe Slot */
.pos-swipe-slot {
    flex: 0 0 35px;
    height: 45px;
    background: linear-gradient(180deg, #1a1a2e 0%, #2d2d44 100%);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pos-swipe-slot:hover {
    background: linear-gradient(180deg, #2d2d44 0%, #3d3d54 100%);
    border-color: rgba(255, 255, 255, 0.2);
}

.pos-swipe-slot.active {
    background: linear-gradient(180deg, #c17900 0%, #e8a020 100%);
    border-color: #f0b030;
}

.swipe-slot-track {
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, #333 0%, #666 50%, #333 100%);
    border-radius: 1px;
    position: relative;
}

.pos-swipe-slot.active .swipe-slot-track {
    background: linear-gradient(90deg, #fff3 0%, #fff8 50%, #fff3 100%);
    animation: swipeGlow 1s ease-in-out;
}

@keyframes swipeGlow {
    0% { box-shadow: none; }
    50% { box-shadow: 0 0 8px rgba(255, 200, 50, 0.6); }
    100% { box-shadow: none; }
}

.swipe-slot-label {
    font-size: 6px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

