@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.1);
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Layout */
#app {
    display: flex;
    height: 100vh;
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
}

/* Sidebar */
aside {
    width: var(--sidebar-width);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    transition: all 0.3s ease;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    background: linear-gradient(to right, #60a5fa, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--accent);
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.lang-btn.active {
    border-color: var(--accent);
    color: var(--text-primary);
}

/* Main Content */
main {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.floor-tabs {
    display: flex;
    background: var(--bg-card);
    padding: 0.4rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.tab-btn {
    padding: 0.6rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Floor Map Area */
.floor-map-container {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    height: calc(100vh - 180px);
    position: relative;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 2px 2px, rgba(255,255,255,0.05) 1px, transparent 0);
    background-size: 40px 40px;
}

/* Table Elements */
.table-element {
    position: absolute;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 12px;
}

.table-element:hover {
    transform: scale(1.05);
}

.table-shape {
    width: 60px;
    height: 60px;
    background: #1e293b;
    border: 3px solid var(--success);
    border-radius: 50%; /* Default round */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
    position: relative;
}

.table-element.square .table-shape {
    border-radius: 8px; /* Square with slight round corners */
}

.table-element.reserved .table-shape {
    border-color: var(--warning);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.table-element.occupied .table-shape {
    border-color: var(--danger);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

.table-element.vip .table-shape {
    border-color: var(--accent); /* Göy / Blue */
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.table-label {
    font-size: 0.8rem;
    font-weight: 600;
}

.table-info {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Reserved Badge */
.reserved-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--warning);
    color: #000;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.5);
    border: 2px solid var(--bg-dark);
}

/* View Navigation */
.view-container {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-container.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Edit Mode Styling */
.edit-mode .table-element {
    cursor: move;
    outline: 2px dashed var(--accent);
    outline-offset: 4px;
}

.edit-indicator {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    display: none;
    align-items: center;
    gap: 1rem;
    z-index: 100;
    box-shadow: 0 10px 25px var(--accent-glow);
}

/* List Table */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: 1rem;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.data-table td {
    padding: 1rem;
    background: var(--bg-card);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.data-table tr td:first-child {
    border-left: 1px solid var(--glass-border);
    border-radius: 12px 0 0 12px;
}

.data-table tr td:last-child {
    border-right: 1px solid var(--glass-border);
    border-radius: 0 12px 12px 0;
}

/* Badges */
.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-paid { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.badge-unpaid { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

/* Report Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 20px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
    color: var(--accent);
}

.stat-card.clickable {
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--accent);
}

.stat-card.clickable:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.2);
}

/* WhatsApp Button */
.whatsapp-btn {
    background: #25D366;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: none; /* Controlled by JS (flex) */
    align-items: flex-start;
    justify-content: center;
    z-index: 9999;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.modal {
    background: #1e293b;
    border: 2px solid var(--accent);
    border-radius: 24px;
    width: 90%;
    max-width: 450px;
    max-height: none;
    padding: 2.5rem;
    box-shadow: 0 0 50px rgba(0,0,0,0.5), 0 0 20px var(--accent-glow);
    animation: modalSlide 0.3s ease-out;
    margin: auto;
}

@keyframes modalSlide {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

input, select, textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.8rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

select option {
    background-color: #1e293b;
    color: var(--text-primary);
}

input:focus {
    border-color: var(--accent);
}

.modal-footer {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    flex: 1;
    padding: 0.8rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
}

.toast {
    background: #ef4444;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ── Albom (Landscape) Müştəri Modalı ── */
.cust-modal-landscape {
    max-width: 1150px;
    width: 96vw;
    max-height: 90vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cust-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.8rem;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.cust-modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.cust-modal-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.cust-modal-left {
    width: 550px;
    flex-shrink: 0;
    padding: 1.4rem 1.6rem;
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.cust-modal-right {
    flex: 1;
    padding: 1.4rem 1.6rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.1);
}

.tag-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 0.3rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    user-select: none;
    margin-bottom: 0;
}

.tag-check:hover {
    background: rgba(255,255,255,0.1);
}

.tag-check input[type="checkbox"] {
    margin: 0;
    accent-color: currentColor;
}

/* ── Menu View ────────────────────────────────────── */
.menu-cat-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1rem;
}
.menu-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.menu-cat-header h3 { font-size: 1rem; }
.menu-items-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.menu-item-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}
.menu-item-price { color: var(--success); font-weight: 600; }
.pill-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 2px 4px;
    line-height: 1;
    transition: color 0.2s;
}
.pill-btn:hover { color: var(--text-primary); }

/* ── Order Picker Modal ───────────────────────────── */
.res-modal-landscape {
    max-width: 1000px;
    width: 96vw;
    max-height: 90vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.order-picker-modal {
    max-width: 950px;
    width: 96vw;
    max-height: 88vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.order-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}
.order-picker-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.order-picker-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--glass-border);
    overflow: hidden;
}
.order-cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}
.order-cat-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}
.order-cat-btn.active, .order-cat-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.order-items-grid {
    flex: 1;
    overflow-y: auto;
    padding: 0.8rem 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.6rem;
    align-content: start;
}
.picker-item-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.9rem 0.7rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.18s;
    position: relative;
}
.picker-item-card:hover {
    background: rgba(59,130,246,0.12);
    border-color: var(--accent);
    transform: translateY(-2px);
}
.picker-item-name { font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; }
.picker-item-price { font-size: 0.78rem; color: var(--success); }
.picker-item-add {
    position: absolute;
    top: 6px; right: 6px;
    color: var(--accent);
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.18s;
}
.picker-item-card:hover .picker-item-add { opacity: 1; }

.order-picker-right {
    width: 280px;
    flex-shrink: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.12);
}
.cart-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.85rem;
}
.cart-item-name { flex: 1; font-weight: 500; }
.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.cart-item-controls button {
    background: rgba(255,255,255,0.08);
    border: none;
    color: var(--text-primary);
    width: 22px;
    height: 22px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.cart-item-controls button:hover { background: var(--accent); }
.cart-item-controls span { font-weight: 700; min-width: 16px; text-align: center; }
.cart-item-price { font-weight: 600; color: var(--success); font-size: 0.82rem; white-space: nowrap; }

/* ── Context Menu ───────────────────────────── */
.context-menu {
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    min-width: 180px;
}
.context-menu .menu-item {
    padding: 0.8rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.context-menu .menu-item:hover {
    background: rgba(255,255,255,0.1);
}

/* ── Custom Autocomplete Search Dropdowns ── */
.custom-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(30, 41, 59, 0.98); /* Matching cards dark shade */
    border: 1px solid var(--accent);
    border-radius: 10px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 10000;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-glow);
    backdrop-filter: blur(12px);
    margin-top: 5px;
}

.custom-autocomplete-item {
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-autocomplete-item:last-child {
    border-bottom: none;
}

.custom-autocomplete-item:hover {
    background: rgba(59, 130, 246, 0.2);
    padding-left: 1.5rem; /* Zərif sağa sürüşmə effekti */
}

.custom-autocomplete-item .cust-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}
