/* ============================================
   🌾 HayDay Food Selection - Modern Style v2.0
   By @HayDay_FM
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;700&display=swap');

/* ============================================
   CSS Variables - Theme System
   ============================================ */
:root {
    --hayday-green: #74b844;
    --hayday-green-dark: #5a9434;
    --hayday-green-light: #8fce5f;
    --hayday-brown: #8c5a2d;
    --hayday-brown-dark: #6b4522;
    --hayday-light-brown: #d4a97d;
    --hayday-blue: #65a9d8;
    --hayday-blue-dark: #4a8ac1;
    --hayday-yellow: #f7e29c;
    --hayday-yellow-bright: #ffd700;
    --hayday-red: #e74c3c;
    --hayday-red-dark: #c0392b;
    --hayday-orange: #f39c12;
    --hayday-purple: #9b59b6;
    
    --bg-primary: #f0f8e6;
    --bg-secondary: #e8f4dc;
    --bg-card: #fffdf5;
    --font-color: #4a3b2a;
    --font-color-light: #6b5a4a;
    --font-color-muted: #8b7a6a;
    
    --shadow-sm: 0 2px 4px rgba(140, 90, 45, 0.1);
    --shadow-md: 0 4px 8px rgba(140, 90, 45, 0.15);
    --shadow-lg: 0 8px 16px rgba(140, 90, 45, 0.2);
    --shadow-xl: 0 12px 24px rgba(140, 90, 45, 0.25);
    --shadow-glow: 0 0 20px rgba(116, 184, 68, 0.4);
    
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 18px;
    --border-radius-xl: 25px;
    --border-radius-full: 50%;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    --font-primary: 'Nunito', 'Baloo 2', sans-serif;
    --font-display: 'Baloo 2', cursive;
}

[data-theme="dark"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #2a2a4a;
    --font-color: #e8e8e8;
    --font-color-light: #b8b8b8;
    --font-color-muted: #888888;
    --hayday-brown: #5a3d1d;
    --hayday-brown-dark: #3d2a14;
    --hayday-light-brown: #8b6914;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.5);
}

/* ============================================
   Base Styles
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--font-color);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(116, 184, 68, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(101, 169, 216, 0.1) 0%, transparent 50%),
        url('https://www.transparenttextures.com/patterns/light-paper-fibers.png');
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* ============================================
   Loading Screen
   ============================================ */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--hayday-green) 0%, var(--hayday-blue) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-logo {
    width: 120px;
    height: 120px;
    animation: bounce 1s infinite;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    margin: 20px auto;
    animation: spin 1s linear infinite;
}

.loader-content p {
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: pulse 1.5s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ============================================
   Scroll to Top Button
   ============================================ */
#scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--hayday-green) 0%, var(--hayday-green-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius-full);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

#scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

#scroll-to-top i {
    font-size: 1.2rem;
}

/* ============================================
   Container
   ============================================ */
.container {
    width: 95%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================
   Header Styles
   ============================================ */
header {
    background: linear-gradient(135deg, var(--hayday-brown) 0%, var(--hayday-brown-dark) 100%);
    background-image: 
        url('https://www.transparenttextures.com/patterns/wood-pattern.png'),
        linear-gradient(135deg, var(--hayday-brown) 0%, var(--hayday-brown-dark) 100%);
    color: white;
    padding: 25px 30px;
    margin-bottom: 25px;
    border-radius: var(--border-radius-lg);
    border: 4px solid var(--hayday-brown-dark);
    box-shadow: var(--shadow-xl), inset 0 0 20px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 10px;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform var(--transition-normal);
}

.header-logo:hover {
    transform: rotate(-10deg) scale(1.1);
}

.title-section h1 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
    line-height: 1.2;
    background: linear-gradient(to right, #fff, var(--hayday-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 45px;
    height: 45px;
    border-radius: var(--border-radius-full);
    border: 3px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.icon-btn i {
    font-size: 1.2rem;
}

.icon-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--hayday-red);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
}

/* Search Section */
.search-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--font-color-muted);
    font-size: 1.1rem;
}

#search-box {
    width: 100%;
    padding: 14px 50px;
    border: 3px solid var(--hayday-light-brown);
    border-radius: var(--border-radius-xl);
    font-size: 1rem;
    font-family: var(--font-primary);
    background: var(--bg-card);
    color: var(--font-color);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

#search-box:focus {
    outline: none;
    border-color: var(--hayday-green);
    box-shadow: var(--shadow-lg), 0 0 0 4px rgba(116, 184, 68, 0.2);
}

#search-box::placeholder {
    color: var(--font-color-muted);
}

.clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--font-color-muted);
    cursor: pointer;
    padding: 5px;
    transition: color var(--transition-fast);
}

.clear-btn:hover {
    color: var(--hayday-red);
}

/* Level Filter */
.level-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
}

.level-filter label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.level-filter input[type="number"] {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.9);
    color: var(--font-color);
    font-family: var(--font-primary);
    font-weight: 600;
    text-align: center;
}

.level-filter input[type="number"]:focus {
    outline: none;
    border-color: var(--hayday-green);
}

.filter-btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:not(.secondary) {
    background: var(--hayday-green);
    color: white;
}

.filter-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.filter-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* Fill Controls Section */
.fill-controls-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.fill-all-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.fill-all-controls label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fill-input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.fill-adjust-btn {
    width: 35px;
    height: 40px;
    border: none;
    background: var(--hayday-light-brown);
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.fill-adjust-btn:hover {
    background: var(--hayday-brown);
}

#fill-all-input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 1.1rem;
    font-family: var(--font-primary);
    font-weight: 700;
    color: var(--font-color);
    -moz-appearance: textfield;
}

#fill-all-input::-webkit-outer-spin-button,
#fill-all-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.primary-btn, .secondary-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius-md);
    font-family: var(--font-primary);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 8px;
}

.primary-btn {
    background: linear-gradient(135deg, var(--hayday-green) 0%, var(--hayday-green-dark) 100%);
    color: white;
    box-shadow: 0 4px 0 var(--hayday-green-dark);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--hayday-green-dark);
}

.primary-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--hayday-green-dark);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Quick Stats */
.quick-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    min-width: 80px;
}

.stat-item i {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: var(--hayday-yellow);
}

.stat-item span {
    font-size: 1.4rem;
    font-weight: 800;
}

.stat-item small {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ============================================
   Tabs Styles - Mobile Optimized
   ============================================ */
.tabs-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    background: var(--bg-card);
    padding: 10px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
}

.tabs-wrapper {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.tabs {
    display: flex;
    gap: 8px;
    padding: 5px;
    width: max-content;
    min-width: 100%;
}

.tab-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--hayday-light-brown) 0%, #c49a6c 100%);
    border: 3px solid #a88562;
    color: var(--font-color);
    border-radius: var(--border-radius-md);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    box-shadow: 0 4px 0 #a88562;
    flex-shrink: 0;
}

.tab-link:hover {
    background: linear-gradient(135deg, var(--hayday-green-light) 0%, var(--hayday-green) 100%);
    color: white;
    border-color: var(--hayday-green-dark);
    box-shadow: 0 4px 0 var(--hayday-green-dark);
    transform: translateY(-2px);
}

.tab-link.active {
    background: linear-gradient(135deg, var(--hayday-green) 0%, var(--hayday-green-dark) 100%);
    color: white;
    border-color: var(--hayday-green-dark);
    box-shadow: 0 2px 0 var(--hayday-green-dark);
    transform: translateY(2px);
}

.tab-link i {
    font-size: 0.9rem;
}

.tab-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    min-width: 24px;
    text-align: center;
}

.tab-link.active .tab-count {
    background: rgba(0, 0, 0, 0.2);
}

.tabs-nav {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.tabs-nav-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--border-radius-full);
    background: var(--hayday-light-brown);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tabs-nav-btn:hover {
    background: var(--hayday-brown);
    transform: scale(1.1);
}

.tabs-nav-btn:active {
    transform: scale(0.95);
}

/* Sort Options */
.sort-options {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.sort-options label {
    font-weight: 600;
    color: var(--font-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

#sort-select {
    padding: 8px 15px;
    border: 2px solid var(--hayday-light-brown);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-primary);
    font-weight: 600;
    background: white;
    color: var(--font-color);
    cursor: pointer;
}

#sort-select:focus {
    outline: none;
    border-color: var(--hayday-green);
}

.view-options {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.view-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--hayday-light-brown);
    border-radius: var(--border-radius-sm);
    background: white;
    color: var(--font-color-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-btn:hover {
    border-color: var(--hayday-green);
    color: var(--hayday-green);
}

.view-btn.active {
    background: var(--hayday-green);
    border-color: var(--hayday-green-dark);
    color: white;
}

/* ============================================
   Food Grid Styles
   ============================================ */
#foods-grid {
    display: grid;
    gap: 20px;
}

#foods-grid.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

#foods-grid.list-view {
    grid-template-columns: 1fr;
}

#foods-grid.list-view .food-card {
    flex-direction: row;
    padding: 15px 20px;
    gap: 20px;
}

#foods-grid.list-view .food-image-wrapper {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

#foods-grid.list-view .food-name {
    flex: 1;
    text-align: left;
    margin: 0;
}

#foods-grid.list-view .quantity-controls {
    margin: 0;
}

#foods-grid.list-view .quick-actions {
    display: flex;
}

#foods-grid.list-view .food-level {
    position: relative;
    top: auto;
    right: auto;
}

#foods-grid.list-view .food-category-badge {
    position: relative;
    top: auto;
    left: auto;
}

/* Food Card */
.food-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 4px solid var(--hayday-light-brown);
    box-shadow: var(--shadow-md);
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: all var(--transition-normal);
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: var(--animation-delay, 0s);
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.food-card:hover {
    transform: translateY(-8px) rotate(1deg);
    box-shadow: var(--shadow-xl);
    border-color: var(--hayday-green);
}

.food-card.selected {
    border-color: var(--hayday-green);
    background: linear-gradient(to bottom, var(--bg-card) 0%, rgba(116, 184, 68, 0.1) 100%);
}

.food-card.hidden {
    display: none !important;
}

/* Favorite Button */
.favorite-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--border-radius-full);
    background: rgba(255, 255, 255, 0.9);
    color: var(--font-color-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.favorite-btn:hover {
    transform: scale(1.2);
    color: var(--hayday-red);
}

.favorite-btn.active {
    color: var(--hayday-red);
    background: #ffe5e5;
}

.favorite-btn.active i {
    font-weight: 900;
}

/* Level Badge */
.food-level {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--hayday-yellow) 0%, var(--hayday-orange) 100%);
    color: var(--font-color);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--hayday-brown);
}

.food-level i {
    color: var(--hayday-orange);
    font-size: 0.7rem;
}

/* Category Badge */
.food-category-badge {
    position: absolute;
    top: 45px;
    left: -5px;
    background: var(--hayday-blue);
    color: white;
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 0 8px 8px 0;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateX(-10px);
    transition: all var(--transition-normal);
}

.food-card:hover .food-category-badge {
    opacity: 1;
    transform: translateX(0);
}

/* Food Image */
.food-image-wrapper {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
}

.food-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform var(--transition-normal);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

.food-card:hover .food-image-wrapper img {
    transform: scale(1.15) rotate(-5deg);
}

/* Food Name */
.food-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--font-color);
    text-align: center;
    margin-bottom: 12px;
    line-height: 1.3;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-full);
    border: 3px solid;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn.plus-btn {
    background: linear-gradient(135deg, var(--hayday-green) 0%, var(--hayday-green-dark) 100%);
    border-color: var(--hayday-green-dark);
    color: white;
    box-shadow: 0 3px 0 var(--hayday-green-dark);
}

.quantity-btn.minus-btn {
    background: linear-gradient(135deg, var(--hayday-red) 0%, var(--hayday-red-dark) 100%);
    border-color: var(--hayday-red-dark);
    color: white;
    box-shadow: 0 3px 0 var(--hayday-red-dark);
}

.quantity-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.quantity-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0;
}

.quantity-input {
    width: 55px;
    height: 36px;
    text-align: center;
    border: 3px solid var(--hayday-light-brown);
    border-radius: var(--border-radius-sm);
    font-size: 1.1rem;
    font-family: var(--font-primary);
    font-weight: 700;
    color: var(--font-color);
    background: white;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.quantity-input:focus {
    outline: none;
    border-color: var(--hayday-green);
}

.quantity-input.has-value {
    background: linear-gradient(to bottom, #e8f8e0 0%, white 100%);
    border-color: var(--hayday-green);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-normal);
}

.food-card:hover .quick-actions {
    opacity: 1;
    transform: translateY(0);
}

.quick-btn {
    padding: 5px 10px;
    background: var(--hayday-blue);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-btn:hover {
    background: var(--hayday-blue-dark);
    transform: scale(1.1);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--font-color-muted);
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--font-color);
}

.no-results p {
    margin-bottom: 20px;
}

/* ============================================
   Footer Styles
   ============================================ */
footer {
    background: linear-gradient(135deg, var(--hayday-brown) 0%, var(--hayday-brown-dark) 100%);
    background-image: 
        url('https://www.transparenttextures.com/patterns/wood-pattern.png'),
        linear-gradient(135deg, var(--hayday-brown) 0%, var(--hayday-brown-dark) 100%);
    color: white;
    padding: 30px;
    margin-top: 30px;
    border-radius: var(--border-radius-lg);
    border: 4px solid var(--hayday-brown-dark);
    box-shadow: var(--shadow-xl), inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: var(--border-radius-md);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.stat-card i {
    font-size: 2rem;
    color: var(--hayday-yellow);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--border-radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--hayday-green) 0%, var(--hayday-green-dark) 100%);
    color: white;
    box-shadow: 0 4px 0 var(--hayday-green-dark);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.action-btn.danger {
    background: linear-gradient(135deg, var(--hayday-red) 0%, var(--hayday-red-dark) 100%);
    color: white;
    box-shadow: 0 4px 0 var(--hayday-red-dark);
}

.action-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}

.action-btn:active {
    transform: translateY(2px);
}

.footer-credits {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.credit-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.credit-link:hover {
    color: var(--hayday-yellow);
    transform: scale(1.05);
}

.credit-link i {
    font-size: 1.5rem;
}

.divider {
    opacity: 0.5;
}

.version {
    opacity: 0.7;
    font-size: 0.85rem;
}

/* ============================================
   Modal Styles
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.modal-content {
    background: linear-gradient(135deg, var(--hayday-brown) 0%, var(--hayday-brown-dark) 100%);
    background-image: 
        url('https://www.transparenttextures.com/patterns/wood-pattern.png'),
        linear-gradient(135deg, var(--hayday-brown) 0%, var(--hayday-brown-dark) 100%);
    color: white;
    padding: 30px;
    border-radius: var(--border-radius-lg);
    border: 5px solid var(--hayday-brown-dark);
    box-shadow: var(--shadow-xl), inset 0 0 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalAppear 0.4s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: all var(--transition-fast);
}

.modal-close-btn:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.modal-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
}

.modal-header h2 {
    font-size: 1.8rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.modal-subtitle {
    opacity: 0.8;
    font-size: 0.95rem;
}

.modal-body {
    margin-bottom: 20px;
}

.list-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.list-stat {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--hayday-yellow);
}

.stat-text {
    font-size: 0.85rem;
    opacity: 0.8;
}

#modal-food-list {
    background: var(--bg-card);
    color: var(--font-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    max-height: 250px;
    overflow-y: auto;
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.8;
    border: 3px solid var(--hayday-light-brown);
    white-space: pre-wrap;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-md);
    font-family: var(--font-primary);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--hayday-blue) 0%, var(--hayday-blue-dark) 100%);
    color: white;
    box-shadow: 0 4px 0 var(--hayday-blue-dark);
}

.modal-btn.secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.modal-btn.danger {
    background: linear-gradient(135deg, var(--hayday-red) 0%, var(--hayday-red-dark) 100%);
    color: white;
    box-shadow: 0 4px 0 var(--hayday-red-dark);
}

.modal-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* Confirm Modal */
.confirm-modal {
    max-width: 400px;
    text-align: center;
}

.confirm-icon {
    width: 70px;
    height: 70px;
    background: var(--hayday-orange);
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.confirm-icon i {
    font-size: 2rem;
    color: white;
}

.confirm-modal h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.confirm-modal p {
    opacity: 0.8;
    margin-bottom: 25px;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* ============================================
   Toast Notifications
   ============================================ */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease, slideOut 0.3s ease 2.7s forwards;
    max-width: 350px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast.success {
    border-left: 4px solid var(--hayday-green);
}

.toast.error {
    border-left: 4px solid var(--hayday-red);
}

.toast.info {
    border-left: 4px solid var(--hayday-blue);
}

.toast-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: rgba(116, 184, 68, 0.2);
    color: var(--hayday-green);
}

.toast.error .toast-icon {
    background: rgba(231, 76, 60, 0.2);
    color: var(--hayday-red);
}

.toast.info .toast-icon {
    background: rgba(101, 169, 216, 0.2);
    color: var(--hayday-blue);
}

.toast-message {
    font-weight: 600;
    color: var(--font-color);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .fill-controls-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .fill-all-controls {
        justify-content: center;
    }
    
    .quick-stats {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    header {
        position: relative;
        top: 0;
        padding: 20px 15px;
    }
    
    .header-top {
        flex-direction: column;
        text-align: center;
    }
    
    .logo-section {
        flex-direction: column;
    }
    
    .title-section h1 {
        font-size: 1.8rem;
    }
    
    .level-filter {
        flex-direction: column;
    }
    
    .tabs-container {
        flex-direction: column;
        padding: 8px;
        gap: 8px;
    }
    
    .tabs-wrapper {
        width: 100%;
        order: 2;
    }
    
    .tabs {
        padding: 3px;
        gap: 6px;
    }
    
    .tab-link {
        padding: 8px 12px;
        font-size: 0.85rem;
        border-width: 2px;
        box-shadow: 0 3px 0 #a88562;
    }
    
    .tab-link.active {
        box-shadow: 0 1px 0 var(--hayday-green-dark);
    }
    
    .tab-count {
        padding: 1px 6px;
        font-size: 0.7rem;
    }
    
    .tabs-nav {
        order: 1;
        width: 100%;
        justify-content: center;
    }
    
    .tabs-nav-btn {
        width: 40px;
        height: 32px;
        border-radius: var(--border-radius-sm);
    }
    
    #foods-grid.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .footer-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-btn {
        justify-content: center;
    }
    
    .sort-options {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .view-options {
        margin-left: 0;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        width: 98%;
        padding: 10px;
    }
    
    .title-section h1 {
        font-size: 1.5rem;
    }
    
    .tabs-container {
        padding: 6px;
        border-radius: var(--border-radius-md);
    }
    
    .tabs {
        gap: 5px;
    }
    
    .tab-link {
        padding: 7px 10px;
        font-size: 0.8rem;
        gap: 4px;
        border-radius: var(--border-radius-sm);
    }
    
    .tab-link i {
        display: none;
    }
    
    .tab-count {
        padding: 1px 5px;
        font-size: 0.65rem;
        min-width: 20px;
    }
    
    .tabs-nav-btn {
        width: 36px;
        height: 30px;
    }
    
    #foods-grid.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .food-card {
        padding: 15px 10px;
    }
    
    .food-image-wrapper {
        width: 80px;
        height: 80px;
    }
    
    #scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    #toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        max-width: 100%;
    }
    
    .fill-all-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .quick-stats {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .stat-item {
        padding: 8px 15px;
        min-width: 70px;
    }
    
    .stat-item span {
        font-size: 1.2rem;
    }
}

/* ============================================
   Animations & Effects
   ============================================ */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.3s ease;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.pop {
    animation: pop 0.3s ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--hayday-light-brown);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hayday-brown);
}

/* Selection Styling */
::selection {
    background: var(--hayday-green);
    color: white;
}

/* Focus Visible */
:focus-visible {
    outline: 3px solid var(--hayday-green);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    header, footer, .modal-overlay, #scroll-to-top, #toast-container {
        display: none !important;
    }
    
    .food-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
