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

:root {
    --primary-color: #4f46e5; /* Indigo 600 */
    --primary-dark: #4338ca; /* Indigo 700 */
    --accent-color: #f43f5e; /* Rose 500 */
    --success-color: #10b981; /* Emerald 500 */
    --danger-color: #ef4444; /* Red 500 */
    --warning-color: #f59e0b; /* Amber 500 */
    
    /* Glassmorphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    
    --text-main: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */
}

/* Base styling */
body {
    background: #f8fafc;
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,0) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0.05) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0.05) 0, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Outfit', 'Segoe UI', Tahoma, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

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

@keyframes pulse-ring {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.container {
    animation: fadeIn 0.5s ease-out;
}

/* Glass Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 800;
    color: var(--primary-color) !important;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted) !important;
    transition: all 0.3s ease;
    margin: 0 0.25rem;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    background: rgba(79, 70, 229, 0.05);
}

/* Premium Cards */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Interactive Table Grid */
.table-card {
    cursor: pointer;
    text-align: center;
    padding: 2.5rem 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.table-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.1) 100%);
    z-index: -1;
}

.table-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.table-status-empty {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.table-status-occupied {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    animation: pulse-ring 2s infinite;
}

.table-icon {
    font-size: 3.5rem;
    margin-bottom: 1.2rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.table-card:hover .table-icon {
    transform: scale(1.1);
}

.table-name {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.badge-status {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4em 0.8em;
    border-radius: 12px;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.3);
}

/* Beautiful Buttons */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
    color: white;
}

/* Modal Styling */
.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.5rem 2rem;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 1.5rem 2rem;
}

/* Inputs & Forms */
.form-control {
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    padding: 0.6rem 1rem;
    transition: all 0.3s ease;
}

.form-control.form-control-sm {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Login specific */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.8);
}

/* Print UI cho K80 (80mm) */
@media print {
    @page {
        margin: 0; /* Bỏ margin trình duyệt */
        size: 80mm auto; /* Chiều rộng 80mm, chiều dài tự động */
    }

    body * {
        visibility: hidden;
    }

    #print-section, #print-section * {
        visibility: visible;
        color: #000 !important; /* Máy in nhiệt in đen trắng */
    }

    #print-section {
        position: absolute;
        left: 0;
        top: 0;
        width: 76mm; /* Chừa lề một chút để không bị lẹm biên */
        padding: 2mm;
        font-family: monospace; /* Font chữ cho máy in hóa đơn */
        font-size: 11px !important;
    }

    .navbar, .btn {
        display: none !important;
    }

    #print-section h3 {
        font-size: 16px !important;
        margin-bottom: 2px;
    }

    #print-section p {
        margin-bottom: 2px;
        font-size: 11px !important;
    }

    #print-section h4 {
        font-size: 14px !important;
        margin-top: 10px;
        margin-bottom: 5px;
    }

    #print-section table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 10px;
        margin-bottom: 10px;
    }

    /* Ghi đè border của Bootstrap */
    #print-section .table-bordered > :not(caption) > * > * {
        border: none !important;
        border-bottom: 1px dashed #000 !important;
    }

    #print-section th, #print-section td {
        padding: 4px 2px !important;
        font-size: 11px !important;
    }

    #print-section th {
        border-top: 1px dashed #000 !important;
        border-bottom: 1px dashed #000 !important;
    }

    /* Ghi đè các class fs-* của Bootstrap */
    #print-section .fs-5 {
        font-size: 14px !important;
    }

    /* Định dạng cho Phiếu Báo Bếp */
    body.print-kitchen .hide-on-kitchen {
        display: none !important;
    }
    body.print-kitchen #qr-container,
    body.print-kitchen tfoot {
        display: none !important;
    }
    body.print-kitchen #print-section th, 
    body.print-kitchen #print-section td {
        font-size: 14px !important; /* Phóng to chữ cho bếp dễ nhìn */
    }
    body.print-kitchen #print-section .fs-6 {
        font-size: 16px !important;
    }
}
