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

:root {
    /* Premium Vibrant Color Palette */
    --primary: #10b981; /* Emerald green */
    --primary-light: #34d399; /* Light emerald */
    --primary-dark: #059669; /* Dark emerald */
    --primary-glow: rgba(16, 185, 129, 0.5);
    
    --secondary: #ff3838; /* Red */
    --secondary-glow: rgba(255, 56, 56, 0.4);
    
    --accent: #29b6f6; /* Blue */
    --accent-glow: rgba(41, 182, 246, 0.4);
    
    /* Backgrounds */
    --bg-dark: #0f1411; /* Grayish dark background */
    --bg-card: rgba(30, 35, 33, 0.7); /* Lighter gray card */
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-border-hover: rgba(255, 255, 255, 0.3);
    
    /* Text */
    --text-main: #ffffff;
    --text-muted: #d1d5db;
    
    /* Status Colors */
    --status-pending: #f59e0b;
    --status-accepted: #3b82f6;
    --status-cooking: #8b5cf6;
    --status-ready: #10b981;
    --status-served: #64748b;
    
    /* Shadows & Transitions */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.8);
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); /* Smoother, spring-like transition */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    letter-spacing: -0.01em;
}

/* Animated Ambient Background */
.ambient-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background-color: var(--bg-dark);
}

.ambient-bg::before, .ambient-bg::after {
    content: '';
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.2;
    animation: float 20s infinite ease-in-out alternate;
}

.ambient-bg::before {
    background: radial-gradient(circle, var(--primary) 0%, rgba(16, 185, 129, 0.5) 40%, transparent 80%);
    top: -20%;
    left: -10%;
}

.ambient-bg::after {
    background: radial-gradient(circle, var(--secondary) 0%, var(--accent) 60%, transparent 80%);
    bottom: -20%;
    right: -10%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 10%) scale(1.1); }
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.05);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.glass-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
    pointer-events: none;
}

.glass-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--glass-border-hover);
    box-shadow: 0 25px 40px -10px rgba(0,0,0,0.7), 0 0 20px rgba(16, 185, 129, 0.1);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-main);
    letter-spacing: -0.03em;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--secondary), var(--accent));
    background-size: 300% 300%;
    animation: gradientShift 6s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.text-muted {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.75rem;
    border-radius: 14px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    text-decoration: none;
    gap: 0.6rem;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}

.btn:hover::after {
    left: 100%;
    animation: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #000; /* Dark text on bright button for maximum contrast/pop */
    font-weight: 700;
    box-shadow: 0 8px 25px var(--primary-glow), inset 0 1px 1px rgba(255,255,255,0.4);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px var(--primary-glow), inset 0 1px 1px rgba(255,255,255,0.5);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5), 0 0 0 3px var(--primary-glow);
    background: rgba(0, 0, 0, 0.6);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

/* Global Tables Premium Styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 600px; /* Prevents tables from squishing too much on mobile */
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
    text-align: left;
    table-layout: auto;
}

th {
    padding: 1.2rem 1rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: var(--text-main);
    vertical-align: middle;
    transition: var(--transition);
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* App Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    z-index: 1;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.5rem 2rem 1.5rem 0;
    transition: var(--transition);
}

/* Mobile Topbar */
.mobile-topbar {
    display: none;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    align-items: center;
    justify-content: space-between;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

/* Desktop Navbar */
.desktop-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Modern Island Sidebar */
.sidebar {
    width: 280px;
    margin: 1.5rem;
    height: calc(100vh - 3rem);
    background: var(--bg-card);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 100;
    flex-shrink: 0;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.05);
}

.sidebar.collapsed {
    width: 88px;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-brand {
    font-size: 1.15rem;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s ease;
    letter-spacing: -0.02em;
}

.sidebar.collapsed .nav-brand span {
    opacity: 0;
    display: none;
}

.toggle-btn {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.toggle-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--primary);
    transform: scale(1.05);
}

.nav-links {
    list-style: none;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}
/* Scrollbar for nav-links */
.nav-links::-webkit-scrollbar { width: 4px; }
.nav-links::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

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

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.2rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-radius: 16px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link-content {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.nav-link i {
    font-size: 1.5rem;
    min-width: 24px;
    text-align: center;
    transition: transform 0.3s ease;
}

.sidebar.collapsed .nav-link {
    padding: 0.9rem 0;
    justify-content: center;
}

.sidebar.collapsed .nav-link-content {
    justify-content: center;
}

.sidebar.collapsed .nav-link-content span,
.sidebar.collapsed .nav-link .bx-chevron-down {
    display: none;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
    background: rgba(16, 185, 129, 0.1);
    transform: translateX(4px);
    box-shadow: inset 3px 0 0 var(--primary);
}

.nav-link:hover i, .nav-link.active i {
    color: var(--primary);
}

.sidebar.collapsed .nav-link:hover {
    transform: none;
}

/* Submenu */
.submenu {
    list-style: none;
    padding-left: 3.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.submenu.open {
    max-height: 1000px;
    margin-top: 0.5rem;
}

.submenu .submenu {
    padding-left: 1.5rem;
}

.submenu-link {
    display: block;
    padding: 0.6rem 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    position: relative;
    transition: var(--transition);
}

.submenu-link::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: var(--transition);
}

.submenu-link:hover {
    color: var(--text-main);
    transform: translateX(3px);
}

.submenu-link:hover::before {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    transform: translateY(-50%) scale(1.5);
}

/* Collapsed Hover Modal Submenu */
.sidebar.collapsed .nav-item:hover .submenu-modal {
    display: block;
    animation: slideIn 0.3s ease forwards;
}

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

.submenu-modal {
    display: none;
    position: absolute;
    left: calc(100% + 15px);
    top: 0;
    background: rgba(20, 25, 22, 0.9);
    backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.2rem;
    min-width: 220px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    z-index: 200;
}

.submenu-modal-title {
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-main);
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 95;
    backdrop-filter: blur(8px);
}

@media (min-width: 993px) {
    .sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 992px) {
    .grid[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .main-content {
        padding: 1.5rem;
    }
    
    .desktop-navbar {
        display: none;
    }
    
    .mobile-topbar {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        left: -320px;
        margin: 0;
        height: 100vh;
        border-radius: 0 28px 28px 0;
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .sidebar.collapsed {
        width: 280px;
    }
    .sidebar.collapsed .nav-link-content span,
    .sidebar.collapsed .nav-link .bx-chevron-down {
        display: block;
    }
    .sidebar.collapsed .nav-link {
        justify-content: space-between;
        padding: 0.9rem 1.2rem;
    }
}

/* Alerts & Badges */
.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.badge-pending { background: rgba(245, 158, 11, 0.15); color: var(--status-pending); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-accepted { background: rgba(59, 130, 246, 0.15); color: var(--status-accepted); border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-cooking { background: rgba(139, 92, 246, 0.15); color: var(--status-cooking); border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-ready { background: rgba(16, 185, 129, 0.15); color: var(--status-ready); border: 1px solid rgba(16, 185, 129, 0.3); box-shadow: 0 0 10px rgba(16, 185, 129, 0.2); }
.badge-served { background: rgba(100, 116, 139, 0.15); color: var(--status-served); border: 1px solid rgba(100, 116, 139, 0.3); }

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

.animate-fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Global Alert styling */
.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.1);
}
