:root {
    --primary: #556B2F;
    --primary-light: #6B8E23;
    --secondary: #9ACD32;
    --neutral: #2E2E2E;
    --text-color: #333;
    --bg-color: #F5F5F5;
    --white: #ffffff;
    --accent: #800020;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.06);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Vazirmatn', sans-serif;
}

body {
    background: linear-gradient(135deg, #f8f9fa 0%, #f5f5f5 100%);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.7;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--neutral) 0%, #1a1a1a 100%);
    color: var(--white);
    padding: 1.25rem 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--secondary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.brand:hover {
    color: #b8e64a;
    transform: scale(1.02);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 28px;
}

.nav-links a {
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--secondary);
    background-color: rgba(154, 205, 50, 0.1);
    transform: translateY(-2px);
}

/* Main */
.main-container {
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 0 24px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(85, 107, 47, 0.1);
}

.card:hover::before {
    opacity: 1;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, #7aa028 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(85, 107, 47, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--neutral) 0%, #3a3a3a 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #3a3a3a 0%, var(--neutral) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 46, 46, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent) 0%, #a00028 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #a00028 0%, var(--accent) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(128, 0, 32, 0.4);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Grid System */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

/* Utility */
.text-center {
    text-align: center;
}

.text-muted {
    color: #888;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1.5rem;
}

.mt-2 {
    margin-top: 1.5rem;
}

.p-1 {
    padding: 1.5rem;
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2rem;
    color: var(--neutral);
}

/* Dashboard Specific */
.table-card {
    text-align: center;
    position: relative;
    border: 2px solid transparent;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 24px;
}

.status-empty {
    border-color: var(--secondary);
    background: linear-gradient(135deg, #f8fcf0 0%, #f0f9eb 100%);
    box-shadow: 0 2px 8px rgba(154, 205, 50, 0.15);
}

.status-empty:hover {
    border-color: #8bb82a;
    box-shadow: 0 4px 16px rgba(154, 205, 50, 0.25);
}

.status-occupied {
    border-color: var(--accent);
    background: linear-gradient(135deg, #fff8f8 0%, #fff0f0 100%);
    box-shadow: 0 2px 8px rgba(128, 0, 32, 0.15);
}

.status-occupied:hover {
    border-color: #a00028;
    box-shadow: 0 4px 16px rgba(128, 0, 32, 0.25);
}

.status-payment {
    border-color: #ff9800;
    background: linear-gradient(135deg, #fff8f0 0%, #fff4e6 100%);
}

.table-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--neutral);
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.status-text {
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
    margin-bottom: 16px;
}

/* Order Page */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}

.menu-item-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-sm);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
}

.menu-item-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.menu-item-card h4 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--neutral);
    font-weight: 600;
}

.menu-item-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.15rem;
    margin: 12px 0;
}

.order-summary {
    position: sticky;
    top: 100px;
    background: white;
    padding: 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.order-item-row:hover {
    background-color: #fafafa;
    margin: 0 -12px;
    padding-right: 12px;
    padding-left: 12px;
    border-radius: 8px;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-controls button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #f8f8f8 0%, #f0f0f0 100%);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--neutral);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
}

.qty-controls button:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1);
}

.qty-controls span {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    color: var(--neutral);
}

/* Accordion Styles */
.accordion {
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius);
    background: white;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.3s ease;
}

.accordion:hover {
    box-shadow: var(--shadow);
}

.accordion-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.15rem;
    transition: all 0.3s ease;
    user-select: none;
}

.accordion-header:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, #7aa028 100%);
}

.accordion-header.active {
    background: linear-gradient(135deg, var(--primary-light) 0%, #7aa028 100%);
}

.accordion-header .accordion-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    opacity: 0.9;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-content.active {
    max-height: 5000px;
}

.accordion-body {
    padding: 20px 24px;
    background: #fafafa;
}

/* Category Accordion (nested) */
.category-accordion {
    margin-bottom: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-sm);
    background: white;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.category-accordion:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.category-accordion-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--neutral) 0%, #3a3a3a 100%);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    user-select: none;
}

.category-accordion-header:hover {
    background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
}

.category-accordion-header.active {
    background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
}

.category-accordion-header .accordion-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    opacity: 0.9;
}

.category-accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.category-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-accordion-content.active {
    max-height: 3000px;
}

.category-accordion-body {
    padding: 20px;
    background: #fafafa;
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .order-summary {
        position: static;
        margin-top: 24px;
    }

    .navbar .container {
        flex-direction: column;
        gap: 16px;
    }

    .nav-links {
        gap: 16px;
    }

    .main-container {
        margin: 1.5rem auto;
        padding: 0 16px;
    }

    .card {
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}
