/* Biradisyon - Touch POS & Hardware UI */
:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --border-color: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --danger: #ef4444;
    --accent: #8b5cf6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* TOP HEADER & HARDWARE STATUS BAR */
.top-header {
    background: #090d16;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand h1 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #60a5fa, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-badge {
    background: #1e293b;
    color: #94a3b8;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid #334155;
    font-weight: 600;
}

.hardware-status-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.status-badge.online {
    background: var(--success-bg);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

.status-badge.offline {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-header {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-header:hover {
    background: #334155;
    color: #ffffff;
    border-color: #475569;
}

.btn-header:active {
    transform: scale(0.97);
}

/* MAIN LAYOUT */
.main-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* LEFT: Salon & Masa Seçimi */
.sidebar-tables {
    width: 280px;
    background: #131c2e;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.salon-tabs {
    display: flex;
    background: #090d16;
    padding: 6px;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.salon-tab {
    flex: 1;
    padding: 8px 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    transition: all 0.2s;
}

.salon-tab.active {
    background: var(--primary);
    color: #ffffff;
}

.tables-grid {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    align-content: start;
}

.table-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 80px;
}

.table-card:hover {
    background: var(--bg-card-hover);
    border-color: #64748b;
}

.table-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.table-card.occupied {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.5);
}

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

.table-card-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.table-card-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.table-card-price {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fbbf24;
    margin-top: 6px;
}

.table-card-status {
    font-size: 0.72rem;
    color: #94a3b8;
}

/* CENTER: Menü ve Ürünler */
.center-content {
    flex: 1;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.category-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: #111a2d;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.cat-btn {
    background: #1e293b;
    border: 1px solid var(--border-color);
    color: #cbd5e1;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-btn:hover {
    background: #334155;
    color: #ffffff;
}

.cat-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary-hover);
}

.products-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    align-content: start;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100px;
    cursor: pointer;
    transition: all 0.15s;
}

.product-card:hover {
    background: var(--bg-card-hover);
    border-color: #64748b;
    transform: translateY(-2px);
}

.product-card:active {
    transform: scale(0.96);
}

.product-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.25;
}

.product-price {
    margin-top: 10px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #38bdf8;
}

/* RIGHT: Adisyon Sepeti & Ödeme */
.sidebar-cart {
    width: 360px;
    background: #111927;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.cart-header {
    padding: 14px 16px;
    background: #0b111e;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff;
}

.cart-order-badge {
    background: #1e293b;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #94a3b8;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item {
    background: #1a2333;
    border: 1px solid #2d3b50;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.cart-item-price {
    font-weight: 700;
    font-size: 0.95rem;
    color: #38bdf8;
}

.cart-item-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #0f172a;
    border-radius: 6px;
    padding: 2px 4px;
}

.qty-btn {
    width: 26px;
    height: 26px;
    background: #334155;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:active {
    background: #475569;
}

.qty-text {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 24px;
    text-align: center;
}

.item-delete-btn {
    background: transparent;
    color: #ef4444;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 6px;
}

.cart-footer {
    background: #0b111e;
    border-top: 1px solid var(--border-color);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.totals-row.grand-total {
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
    padding-top: 6px;
    border-top: 1px dashed var(--border-color);
}

.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 6px;
}

.btn-action {
    padding: 12px 8px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s;
}

.btn-kitchen {
    background: #475569;
    color: #f1f5f9;
}

.btn-kitchen:hover {
    background: #64748b;
}

.btn-print-bill {
    background: #0284c7;
    color: #ffffff;
}

.btn-print-bill:hover {
    background: #0369a1;
}

.btn-pay {
    grid-column: span 2;
    background: #059669;
    color: #ffffff;
    font-size: 1.05rem;
    padding: 14px;
}

.btn-pay:hover {
    background: #10b981;
}

.btn-pay:active {
    transform: scale(0.98);
}

/* MODAL SYSTEM */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

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

.modal-box {
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 14px;
    width: 90%;
    max-width: 520px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
    padding-bottom: 12px;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
}

/* POS ÖDEME MODALİ ANIMASYONU */
.pos-animation-container {
    padding: 24px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.pos-card-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    border: 2px solid #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 16px rgba(59, 130, 246, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.pos-amount-display {
    font-size: 2rem;
    font-weight: 800;
    color: #38bdf8;
}

.pos-status-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: #f1f5f9;
}

/* FİŞ ÖNİZLEME ALANI */
.receipt-preview-box {
    background: #090d16;
    color: #10b981;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.85rem;
    padding: 12px;
    border-radius: 8px;
    max-height: 350px;
    overflow-y: auto;
    white-space: pre-wrap;
    border: 1px solid #334155;
}
