/* ============================================
   Tab POS - Hospitality Management System
   Custom Styles
   ============================================ */

/* Base Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

input, select, textarea {
    font-size: 16px !important;
}

/* View Management */
.view-section {
    display: none;
}

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

/* Product Cards */
.product-card {
    min-height: 100px;
    transition: all 0.2s;
    touch-action: manipulation;
    cursor: pointer;
}

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

.product-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Table Cards */
.table-card {
    transition: all 0.2s;
    cursor: pointer;
}

.table-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.table-card.free {
    background-color: #f0fdf4;
    border-color: #86efac;
}

.table-card.occupied {
    background-color: #fef3c7;
    border-color: #fcd34d;
}

.table-card.to-pay {
    background-color: #fee2e2;
    border-color: #fca5a5;
}

.table-card.reserved {
    background-color: #dbeafe;
    border-color: #60a5fa;
}

/* Floor Canvas */
.floor-canvas {
    background-color: #f9fafb;
    background-image: 
        linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    position: relative;
    min-height: 400px;
    overflow: hidden;
}

.floor-table {
    position: absolute;
    background: white;
    border: 2px solid #3b82f6;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #1f2937;
    transition: all 0.2s;
    padding: 8px;
    user-select: none;
}

.floor-table:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.floor-table.selected {
    border-color: #10b981;
    background-color: #d1fae5;
}

.floor-table.round {
    border-radius: 50%;
}

.floor-table.free {
    background-color: #f0fdf4;
    border-color: #86efac;
}

.floor-table.occupied {
    background-color: #fef3c7;
    border-color: #fcd34d;
}

.floor-table.to-pay {
    background-color: #fee2e2;
    border-color: #fca5a5;
}

.floor-table.reserved {
    background-color: #dbeafe;
    border-color: #60a5fa;
}

/* Table Info Overlays */
.table-info {
    font-size: 0.65rem;
    line-height: 1.2;
    text-align: center;
    width: 100%;
}

.table-name {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.table-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.65rem;
    color: #6b7280;
}

.table-amount {
    font-weight: 700;
    color: #1f2937;
    font-size: 0.75rem;
}

.table-guests {
    font-size: 0.65rem;
    color: #6b7280;
    font-weight: 600;
}

.table-time {
    font-size: 0.65rem;
    color: #6b7280;
}

.table-course-status {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: #e5e7eb;
    color: #374151;
    font-weight: 600;
    margin-top: 2px;
}

/* Auth Indicator */
.auth-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 4px;
}

.auth-indicator.green {
    background-color: #10b981;
}

.auth-indicator.orange {
    background-color: #f59e0b;
}

.auth-indicator.red {
    background-color: #ef4444;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.ok {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.low {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.out {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.active {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-badge.inactive {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* Progress Bars */
.progress-bar {
    width: 100%;
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s;
}

.progress-fill.full {
    background-color: #10b981;
}

.progress-fill.high {
    background-color: #3b82f6;
}

.progress-fill.medium {
    background-color: #f59e0b;
}

.progress-fill.low {
    background-color: #ef4444;
}

/* Turn Time Progress */
.turn-time-bar {
    width: 100%;
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.turn-time-fill {
    height: 100%;
    transition: width 0.3s;
    background-color: #10b981;
}

.turn-time-fill.warning {
    background-color: #f59e0b;
}

.turn-time-fill.critical {
    background-color: #ef4444;
}

/* Tabs */
.tab-btn {
    padding: 0.75rem 1.5rem;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
    cursor: pointer;
}

.tab-btn:hover {
    color: #374151;
    border-bottom-color: #d1d5db;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 50;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s;
}

.modal-content {
    animation: slideUp 0.3s;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Toast */
.toast {
    animation: slideInRight 0.3s ease-out;
    min-width: 250px;
}

.toast.removing {
    animation: slideOutRight 0.15s ease-out;
}

/* Navigation */
.nav-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.nav-btn.active {
    background-color: #3b82f6;
    color: white;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Pre-auth Warning */
.preauth-warning {
    animation: pulse 1s infinite;
}

/* Dropdown Menu */
.dropdown-menu {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 10;
    min-width: 200px;
}

.dropdown-menu.active {
    display: block;
    animation: slideUp 0.2s;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
}

.dropdown-item:first-child {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.dropdown-item:last-child {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* Reservation Status */
.reservation-card {
    transition: all 0.2s;
    cursor: pointer;
}

.reservation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.reservation-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.reservation-status.pending {
    background-color: #fef3c7;
    color: #92400e;
}

.reservation-status.confirmed {
    background-color: #d1fae5;
    color: #065f46;
}

.reservation-status.seated {
    background-color: #dbeafe;
    color: #1e40af;
}

.reservation-status.completed {
    background-color: #f3f4f6;
    color: #6b7280;
}

.reservation-status.cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Waitlist */
.waitlist-item {
    transition: all 0.2s;
}

.waitlist-item:hover {
    background-color: #f9fafb;
}

/* Course Status Colors */
.course-appetizers {
    background-color: #fef3c7;
    color: #92400e;
}

.course-mains {
    background-color: #fed7aa;
    color: #7c2d12;
}

.course-desserts {
    background-color: #fecaca;
    color: #991b1b;
}

.course-paying {
    background-color: #fee2e2;
    color: #991b1b;
}
