/* Colorful & Dynamic Theme */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0');

:root {
    /* Core Colors */
    --primary: #4F46E5;
    /* Indigo 600 */
    --primary-light: #818CF8;
    --primary-bg: #EEF2FF;
    --text-main: #1F2937;
    --text-sub: #6B7280;
    --bg-body: #F3F4F6;
    --card-bg: #FFFFFF;
    --border: #E5E7EB;

    /* Category Colors - Vivid & Playful */
    --cat-main: #3B82F6;
    /* Blue */
    --cat-main-bg: #EFF6FF;
    --cat-side: #F59E0B;
    /* Amber */
    --cat-side-bg: #FFFBEB;
    --cat-dessert: #EC4899;
    /* Pink */
    --cat-dessert-bg: #FDF2F8;
    --cat-special: #8B5CF6;
    /* Violet */
    --cat-special-bg: #F5F3FF;

    /* Status Colors */
    --status-pending: #EF4444;
    --status-progress: #F59E0B;
    --status-completed: #10B981;

    /* Gradients */
    --grad-header: linear-gradient(135deg, #4F46E5 0%, #9333EA 100%);

    /* Radius & Shadows */
    --radius-card: 20px;
    --radius-btn: 12px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    /* Reduced shadow opacity for cleaner look */
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    padding-bottom: 80px;
    /* Space for floating elements */
}

/* Material Icons Helper */
.ms {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
}

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

.container-narrow {
    max-width: 900px;
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

/* Header - Modern Gradient */
.header {
    background: var(--grad-header);
    color: white;
    padding: 3rem 2rem;
    border-radius: 0 0 40px 40px;
    margin-bottom: 3rem;
    position: relative;
    text-align: center;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.2);
    margin-top: -2rem;
    /* Pull up to top */
    margin-left: -2rem;
    /* Pull left */
    width: calc(100% + 4rem);
    /* Full width fix */
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.header p.subtitle {
    color: rgba(255, 255, 255, 1);
    /* Full opacity for better visibility */
    font-size: 1.1rem;
    font-weight: 500;
    /* Slightly bolder */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.header-right {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
}

/* Common Card */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    padding: 2.5rem;
    /* Increased padding */
    box-shadow: var(--shadow-md);
    border: 1px solid white;
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    background: var(--primary);
    color: white;
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius-btn);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.3);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn.full {
    width: 100%;
    font-size: 1.1rem;
    padding: 1rem;
}

.admin-access-btn,
.tool-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.admin-access-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Admin View Header Overrides (Since admin page doesn't have the gradient header structure by default) */
#adminContent .header {
    background: white;
    /* Reset for admin content inner header if needed, or keep unified */
    /* Let's keep the admin dashboard clean but colorful headers */
    color: var(--text-main);
    background: transparent;
    box-shadow: none;
    margin: 0;
    padding: 1rem 0;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

#adminContent .header h1 {
    color: var(--text-main);
    font-size: 2rem;
    text-shadow: none;
}

#adminContent .admin-access-btn {
    /* In admin view white background context */
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

#adminContent .admin-access-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Menu Grid System */
.menu-section {
    margin-bottom: 2.5rem;
}

.menu-category-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

/* Category Specific Title Colors */
[data-category="main"] .menu-category-title {
    color: var(--cat-main);
}

[data-category="side"] .menu-category-title {
    color: var(--cat-side);
}

[data-category="dessert"] .menu-category-title {
    color: var(--cat-dessert);
}

[data-category="special"] .menu-category-title {
    color: var(--cat-special);
}

.subcategory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* Dynamic Cards */
.subcategory-card {
    background: white;
    border-radius: 24px;
    padding: 1.8rem;
    border: 2px solid transparent;
    /* Prepare for border transition */
    box-shadow: var(--shadow-sm);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy transition */
    position: relative;
    overflow: hidden;
}

.subcategory-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

/* Category Specific Card Styles (Border & Icon Bg) */
.subcategory-card[data-category="main"]:hover {
    border-color: var(--cat-main);
}

.subcategory-card[data-category="side"]:hover {
    border-color: var(--cat-side);
}

.subcategory-card[data-category="dessert"]:hover {
    border-color: var(--cat-dessert);
}

.subcategory-card[data-category="special"]:hover {
    border-color: var(--cat-special);
}

/* Icon Circle */
.subcategory-card .item-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: 0.3s;
}

.subcategory-card[data-category="main"] .item-icon {
    background: var(--cat-main-bg);
    color: var(--cat-main);
}

.subcategory-card[data-category="side"] .item-icon {
    background: var(--cat-side-bg);
    color: var(--cat-side);
}

.subcategory-card[data-category="dessert"] .item-icon {
    background: var(--cat-dessert-bg);
    color: var(--cat-dessert);
}

.subcategory-card[data-category="special"] .item-icon {
    background: var(--cat-special-bg);
    color: var(--cat-special);
}

/* Selected State */
.subcategory-card.selected {
    background: var(--primary-bg);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.subcategory-card.selected .item-icon {
    background: var(--primary);
    color: white;
    transform: rotate(10deg) scale(1.1);
}

.subcategory-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: block;
}

.subcategory-desc {
    font-size: 0.9rem;
    color: var(--text-sub);
    display: block;
    line-height: 1.4;
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}

label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--text-main);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: 0.2s;
    background: #F9FAFB;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Floating Selected Count */
.selected-count {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-main);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 100;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
}

.selected-count[style*="block"] {
    transform: translateX(-50%) translateY(0) !important;
}

/* Success Toast */
.success-message {
    position: fixed;
    top: 30px;
    right: 30px;
    background: #10B981;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
    transform: translateX(200%);
    transition: 0.4s;
    z-index: 200;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.success-message.show {
    transform: translateX(0);
}

/* --- Admin Specific Styles --- */
.login-wrap {
    max-width: 420px;
    margin: 80px auto;
}

.tabs-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    padding: 5px;
    background: white;
    border-radius: 16px;
    width: fit-content;
    border: 1px solid var(--border);
}

.page-tab {
    background: transparent;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    color: var(--text-sub);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: 0.2s;
}

.page-tab:hover {
    color: var(--primary);
    background: var(--primary-bg);
}

.page-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.req-item {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-left: 6px solid #ccc;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: 0.2s;
}

.req-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

/* Status Colors for Borders & Text */
.req-item[style*="danger"] {
    border-left-color: var(--status-pending) !important;
}

.req-item[style*="warn"] {
    border-left-color: var(--status-progress) !important;
}

.req-item[style*="success"] {
    border-left-color: var(--status-completed) !important;
}

/* Request Status Select */
.status-select {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-sub);
    font-weight: 500;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-card {
    background: white;
    width: 500px;
    max-width: 90%;
    padding: 2rem;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 640px) {
    .header {
        margin: -1rem;
        width: calc(100% + 2rem);
        border-radius: 0 0 30px 30px;
        padding: 2rem 1.5rem;
    }

    .header-right {
        position: relative;
        top: 0;
        right: 0;
        text-align: center;
        margin-bottom: 1rem;
    }

    .container {
        padding: 1rem;
    }

    .req-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .req-status {
        width: 100%;
        text-align: left;
        margin: 0;
    }
}

/* Panel Visibility */
.pane {
    display: none;
    animation: fadeIn 0.3s;
}

.pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Button Text Contrast Fix */
.admin-access-btn,
.tool-btn {
    color: var(--text-main) !important;
    /* Force dark text for visibility */
    background: white;
    border-color: var(--border);
}

.admin-access-btn:hover,
.tool-btn:hover {
    background: var(--bg-body);
}

/* Modal Cancel Button Specific - Ensure it's visible */
button[type="button"].btn.tool-btn {
    color: #4b5563 !important;
    background: #f3f4f6 !important;
    border: 1px solid #d1d5db !important;
}