/* Modern Design System & CSS Variables */
:root {
    /* Color Palette */
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    --primary-color: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Status Colors */
    --status-ordered: #64748b;
    --status-preparing: #f59e0b;
    --status-ready: #3b82f6;
    --status-served: #8b5cf6;
    --status-completed: #10b981;
    
    /* Effects */
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Glassmorphism Utilities */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

/* Background Blobs for Visual Aesthetics */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: var(--success);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(30px) scale(1.1); }
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-block {
    width: 100%;
    padding: 12px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Auth Page Specifics */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    padding: 40px 30px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.form-actions a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.form-actions a:hover {
    color: var(--primary-hover);
}

.error-message {
    color: var(--danger);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 15px;
    min-height: 20px;
}

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    background: rgba(15, 23, 42, 0.95);
    border-right: var(--glass-border);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

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

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
}

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

.nav-link.active {
    border-left: 3px solid var(--primary-color);
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
}

.user-profile {
    margin-top: auto;
    padding-top: 20px;
    border-top: var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--success));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Main Content */
.main-content {
    padding: 30px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

/* Orders Grid */
.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.order-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.order-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.order-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.order-card[data-status="Ordered"]::before { background: var(--status-ordered); }
.order-card[data-status="Preparing"]::before { background: var(--status-preparing); }
.order-card[data-status="Ready"]::before { background: var(--status-ready); }
.order-card[data-status="Served"]::before { background: var(--status-served); }
.order-card[data-status="Completed"]::before { background: var(--status-completed); }

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.order-id {
    font-weight: 700;
    font-size: 1.2rem;
}

.order-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.order-status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status Badge Colors */
.badge-Ordered { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.badge-Preparing { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.badge-Ready { background: rgba(59, 130, 246, 0.2); color: var(--info); }
.badge-Served { background: rgba(139, 92, 246, 0.2); color: var(--status-served); }
.badge-Completed { background: rgba(16, 185, 129, 0.2); color: var(--success); }

.order-items {
    margin: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 0;
}

.item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.item-qty {
    color: var(--text-secondary);
    margin-right: 8px;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.order-total {
    font-weight: 700;
    font-size: 1.1rem;
}

/* Action Menu */
.actions-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* Bill Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bill-modal {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    color: #1e293b;
    border-radius: 12px;
    padding: 30px;
    transform: translateY(20px);
    transition: var(--transition);
    position: relative;
}

.modal-overlay.active .bill-modal {
    transform: translateY(0);
}

.bill-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 15px;
}

.bill-header h3 {
    font-size: 1.5rem;
    color: #0f172a;
    margin-bottom: 5px;
}

.bill-body {
    margin-bottom: 20px;
}

.bill-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.bill-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.1rem;
    border-top: 1px dashed #cbd5e1;
    padding-top: 15px;
    margin-top: 10px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.bill-modal .btn-outline {
    color: #1e293b;
    border-color: #cbd5e1;
}

.bill-modal .btn-outline:hover {
    background: #f1f5f9;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--glass-shadow);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.toast-success .toast-icon { background: var(--success); }
.toast-info .toast-icon { background: var(--info); }
.toast-error .toast-icon { background: var(--danger); }
