/**
 * Ledech Kiosk - Checkout, Payment & Complete Screen Styles
 */

/* ========== Checkout Screen ========== */
/* ========== Checkout Screen (New Design) ========== */

:root {
    --primary-color: #258cf4;
    --primary-dark: #1a75d2;
    --background-light: #f5f7f8;
    --background-dark: #101922;
    --surface-dark: #1e293b;
    --surface-light: #ffffff;
    --text-slate-900: #0f172a;
    --text-slate-600: #475569;
    --text-slate-500: #64748b;
    --text-slate-400: #94a3b8;
    --text-slate-200: #e2e8f0;
    --font-display: var(--font-primary, 'Poppins', sans-serif);
}

#checkout-screen {
    font-family: var(--font-display);
    background-color: var(--background-light);
    color: var(--text-slate-900);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Reset default flex/padding from old design */
    padding: 0;
}

/* --- Layout Builders (Tailwind Replicas) --- */

.checkout-main-container {
    flex: 1;
    overflow-y: auto;
    padding-left: 2rem;
    /* px-8 */
    padding-right: 2rem;
    padding-bottom: 8rem;
    /* pb-32 */
}

.max-w-2xl {
    max-width: 42rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.pt-12 {
    padding-top: 3rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-5 {
    gap: 1.25rem;
}

.p-6 {
    padding: 1.5rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.rounded-2xl {
    border-radius: 1rem;
}

.rounded-3xl {
    border-radius: 1.5rem;
}

.rounded-full {
    border-radius: 9999px;
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* --- Texts --- */
.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.md\:text-5xl {
    font-size: 3rem;
    line-height: 1;
}

.font-black {
    font-weight: 900;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.leading-tight {
    line-height: 1.25;
}

.tracking-tight {
    letter-spacing: -0.025em;
}

.text-primary {
    color: var(--primary-color);
}

.text-slate-900 {
    color: var(--text-slate-900);
}

.text-slate-600 {
    color: var(--text-slate-600);
}

.text-slate-500 {
    color: var(--text-slate-500);
}

.text-slate-400 {
    color: var(--text-slate-400);
}

.text-white {
    color: white;
}

/* --- Components --- */

/* Glass Panel */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* Background Icons */
.bg-primary\/10 {
    background-color: rgba(37, 140, 244, 0.1);
}

.bg-blue-50 {
    background-color: #eff6ff;
}

.bg-white {
    background-color: white;
}

/* Inputs */
.input-group label {
    margin-left: 1rem;
    margin-bottom: 0.5rem;
    display: block;
    transition: color 0.15s ease;
}

.input-group:focus-within label {
    color: var(--primary-color);
}

.input-group:focus-within .material-icons-round {
    color: var(--primary-color) !important;
}

.input-group input,
.input-group textarea {
    width: 100%;
    background-color: white;
    border: 1px solid var(--text-slate-200);
    border-radius: 9999px;
    /* full */
    padding-top: 1.25rem;
    /* py-5 */
    padding-bottom: 1.25rem;
    padding-left: 3.5rem;
    /* pl-14 */
    padding-right: 3rem;
    /* pr-12 */
    font-size: 1.125rem;
    /* text-lg */
    color: var(--text-slate-900);
    outline: none;
    transition: all 0.2s;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    /* USER REQUEST: Allow vertical scrolling and text selection */
    touch-action: pan-y !important;
}

.input-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: grab;
    background: transparent;
}

.input-group textarea {
    border-radius: 1.5rem;
    /* rounded-3xl */
    padding-top: 1rem;
    padding-right: 1rem;
    height: 8rem;
    /* h-32 */
    resize: none;
    line-height: 1.625;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 140, 244, 0.1);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: var(--text-slate-400);
}

/* Absolute Icons in Inputs */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.left-5 {
    left: 1.25rem;
}

.top-5 {
    top: 1.25rem;
}

/* Dividers */
.h-px {
    height: 1px;
}

.bg-slate-200 {
    background-color: var(--text-slate-200);
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

/* Buttons */
.fixed {
    position: fixed;
}

.bottom-10 {
    bottom: 2.5rem;
}

.left-10 {
    left: 2.5rem;
}

.right-10 {
    right: 2.5rem;
}

.z-50 {
    z-index: 50;
}

.custom-nav-btn {
    height: 4rem;
    /* h-16 */
    padding-left: 2rem;
    padding-right: 2rem;
    border-radius: 9999px;
    background-color: white;
    color: #334155;
    border: 1px solid var(--text-slate-200);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.custom-nav-btn:hover {
    background-color: #f8fafc;
    /* slate-50 */
    transform: translateY(-1px);
}

.custom-nav-btn:active {
    transform: scale(0.95);
}

.custom-action-btn {
    height: 4rem;
    padding-left: 2rem;
    padding-right: 2rem;
    border-radius: 9999px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    box-shadow: 0 20px 25px -5px rgba(37, 140, 244, 0.3), 0 8px 10px -6px rgba(37, 140, 244, 0.2);
    transition: all 0.15s ease;
    border: none;
}

.custom-action-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.custom-action-btn:active {
    transform: scale(0.95);
}

.custom-action-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Background Glow Blobs */
.glow-effect-1 {
    width: 500px;
    height: 500px;
    background-color: rgba(147, 197, 253, 0.2);
    border-radius: 9999px;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
    mix-blend-mode: multiply;
    position: fixed;
    top: 0;
    right: 0;
}

.glow-effect-2 {
    width: 400px;
    height: 400px;
    background-color: rgba(216, 180, 254, 0.2);
    border-radius: 9999px;
    filter: blur(100px);
    z-index: 0;
    pointer-events: none;
    mix-blend-mode: multiply;
    position: fixed;
    bottom: 0;
    left: 0;
}

/* Utility Flex */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-1 {
    flex: 1 1 0%;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-center {
    justify-content: center;
}

.shrink-0 {
    flex-shrink: 0;
}

/* --- Scrollbar Customization --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* ========== Payment Screen ========== */
#payment-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    text-align: center;
    padding: var(--space-2xl);
}

.payment-content {
    max-width: 600px;
}

.payment-icon {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-2xl);
    animation: pulse 2s ease-in-out infinite;
}

.payment-icon .material-icons-round {
    font-size: 80px;
    color: var(--primary-color);
}

.payment-title {
    font-size: var(--font-3xl);
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-md);
}

.payment-instruction {
    font-size: var(--font-xl);
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
}

.payment-amount-box {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.payment-amount-label {
    font-size: var(--font-md);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.payment-amount {
    font-size: var(--font-4xl);
    font-weight: 800;
    color: var(--primary-color);
}

.payment-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    font-size: var(--font-xl);
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
}

.payment-status .spinner {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

.payment-cancel-btn {
    padding: var(--space-md) var(--space-2xl);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: var(--font-lg);
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.payment-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Payment Error State */
.payment-error {
    background: rgba(231, 76, 60, 0.1);
    border: 2px solid var(--error-color);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.payment-error-icon {
    font-size: 64px;
    color: var(--error-color);
    margin-bottom: var(--space-md);
}

.payment-error-title {
    font-size: var(--font-xl);
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-sm);
}

.payment-error-message {
    color: var(--text-secondary);
}

.payment-retry-btn {
    padding: var(--space-md) var(--space-2xl);
    background: var(--primary-color);
    color: white;
    font-size: var(--font-lg);
    font-weight: 600;
    border-radius: var(--radius-lg);
    margin-top: var(--space-lg);
}

/* ========== Complete Screen ========== */
#complete-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    text-align: center;
    padding: var(--space-2xl);
}

.complete-content {
    max-width: 600px;
}

.success-animation {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--success-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-2xl);
    animation: scale-in-bounce 0.6s ease;
}

.success-animation .material-icons-round {
    font-size: 80px;
    color: white;
}

.complete-title {
    font-size: var(--font-3xl);
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-2xl);
}

.queue-number-box {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    margin-bottom: var(--space-xl);
}

.queue-label {
    font-size: var(--font-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.queue-number {
    font-size: 120px;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1;
    text-shadow: 0 8px 32px rgba(255, 107, 53, 0.4);
}

/* ========== Multi-Restaurant Queue Numbers ========== */
.multi-queue-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto var(--space-xl);
}

.multi-queue-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: var(--font-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.multi-queue-header .material-icons-round {
    color: var(--primary-color);
}

.multi-queue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
}

.queue-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.queue-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.queue-card-restaurant {
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-card-number {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1.1;
    text-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
}

.multi-queue-hint {
    margin-top: var(--space-lg);
    font-size: var(--font-sm);
    color: var(--text-secondary);
    opacity: 0.8;
    text-align: center;
}

.estimated-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    font-size: var(--font-xl);
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.estimated-time .material-icons-round {
    font-size: 28px;
    color: var(--primary-color);
}

.kitchen-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: var(--font-lg);
    color: var(--success-color);
    margin-bottom: var(--space-2xl);
}

.complete-message {
    font-size: var(--font-2xl);
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-xl);
}

.thank-you-message {
    font-size: var(--font-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
}

.auto-close-timer {
    font-size: var(--font-md);
    color: var(--text-secondary);
    opacity: 0.7;
    margin-bottom: var(--space-xl);
}

.new-order-btn {
    padding: var(--space-lg) var(--space-3xl);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-size: var(--font-xl);
    font-weight: 700;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.new-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* ========== Responsive ========== */
@media screen and (max-width: 1280px) {
    .checkout-content {
        flex-direction: column;
    }

    .checkout-summary {
        width: 100%;
        order: -1;
    }

    .queue-number {
        font-size: 80px;
    }
}

/* Virtual Keyboard */
.checkout-keyboard {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0.5rem 1.75rem;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    pointer-events: none;
}

.checkout-keyboard.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.checkout-keyboard-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.checkout-keyboard-row:last-child {
    margin-bottom: 0;
}

.checkout-key {
    flex: 1;
    max-width: 4.25rem;
    height: 4rem;
    border-radius: 0.6rem;
    background: #1e293b;
    border: none;
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    box-shadow: 0 2px 0 #0f172a;
}

.checkout-key:active {
    background: #0055ff;
    transform: translateY(2px);
    box-shadow: none;
}

.checkout-key-wide {
    max-width: none;
    flex: 1.5;
}

.checkout-key-space {
    flex: 4;
    max-width: none;
}

.checkout-key-action {
    background: linear-gradient(135deg, #0055ff 0%, #00ccff 100%);
    flex: 1.5;
    max-width: none;
}

.checkout-key-action:active {
    background: #00ccff;
}

.checkout-key-secondary {
    background: #334155;
}

/* Eco klavye Shift/Caps Lock tuşu - üç görsel durum: kapalı / tek seferlik / kilitli */
.checkout-key-shift {
    background: #334155;
}

.checkout-key-shift.active {
    background: linear-gradient(135deg, #0055ff 0%, #00ccff 100%);
}

.checkout-key-shift.locked {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
}

.checkout-key .material-symbols-outlined {
    font-size: 1.5rem;
}

/* Keyboard close button (X) - red tint */
.checkout-key-close {
    background: rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(239, 68, 68, 0.4);
    flex: 1;
    max-width: 4.75rem;
}

.checkout-key-close:active {
    background: #ef4444;
}

/* Keyboard hide button */
.checkout-key-hide {
    background: linear-gradient(135deg, #0055ff 0%, #00ccff 100%);
    flex: 1;
    max-width: 4.75rem;
}

.checkout-key-hide:active {
    background: #00ccff;
}

/* ========== RTL Button Positioning ========== */

/* Flip fixed positions for Checkout Buttons in RTL */
[dir="rtl"] .checkout-back-container {
    left: auto !important;
    right: 2.5rem !important;
    /* bottom-10 left-10 translates to ~2.5rem */
}

[dir="rtl"] .checkout-proceed-container {
    right: auto !important;
    left: 2.5rem !important;
}

/* Fix hover directions for RTL */
[dir="rtl"] #checkout-back-btn:hover .material-symbols-outlined {
    transform: translateX(4px) scaleX(-1);
    /* Move Right instead of Left */
}

[dir="rtl"] #proceed-payment-btn:hover .material-symbols-outlined {
    transform: translateX(-4px) scaleX(-1);
    /* Move Left instead of Right */
}