:root {
    /* Color Palette */
    --primary-color: #2e7d32; /* Deep Organic Green */
    --primary-light: #4caf50; /* Vibrant Green */
    --primary-dark: #1b5e20;
    --accent-color: #ffca28; /* Warm Harvest Yellow */
    --accent-hover: #ffc107;
    --text-dark: #1a1a1a;
    --text-medium: #4a4a4a;
    --text-light: #7a7a7a;
    --bg-body: #f4f7f6;
    --bg-card: #ffffff;
    --bg-input: #f8f9fa;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
    --shadow-hover: 0 12px 32px rgba(46, 125, 50, 0.15);

    /* BorderRadius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

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

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Navbar Modernization */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.nav-link {
    color: var(--text-medium) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color) !important;
    background-color: rgba(46, 125, 50, 0.05);
}

.btn-header-add {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    border: none;
    color: var(--text-dark) !important;
    box-shadow: var(--shadow-sm);
}

.btn-header-add:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Hero Section */
.hero-search {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-search::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

/* Form Elements */
.form-control, .form-select {
    background-color: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    background-color: #fff;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

.input-group-text {
    background-color: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--text-light);
}

/* Buttons */
.btn-success {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: var(--transition-normal);
}

.btn-success:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Product Cards */
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    height: 100%;
    overflow: hidden;
}

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

.card-img-wrapper {
    position: relative;
    height: 240px;
    background-color: #f0f0f0;
    overflow: hidden;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.08);
}

.price-badge {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    color: var(--primary-dark);
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 0.95rem;
}

.card-body {
    padding: 1.5rem;
}

.card-title a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.card-title a:hover {
    color: var(--primary-color);
}

.category-badge {
    background-color: rgba(46, 125, 50, 0.1);
    color: var(--primary-dark);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: 0.75rem;
}

.product-meta {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-bottom: 1rem;
}

.product-meta i {
    width: 18px;
    color: var(--primary-light);
}

/* Footer & Mobile Nav */
footer {
    background-color: #263238 !important;
    border-top: none;
    color: rgba(255,255,255,0.7) !important;
}

.mobile-nav {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-bottom: env(safe-area-inset-bottom);
}

.add-btn-fab {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.4);
    border: 3px solid #fff;
}

.mobile-nav-item.active {
    color: var(--primary-color);
}

/* Login/Register Specifics */
.auth-card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    background: #fff;
}

.auth-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    overflow: hidden;
}

.auth-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 100%;
    height: 40px;
    background: white;
    border-radius: 50% 50% 0 0;
    transform: scaleX(1.5);
}

.auth-body {
    padding: 2.5rem;
}

.brand-icon-lg {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: rgba(255,255,255,0.9);
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

/* Utility */
.text-primary-custom { color: var(--primary-color); }
.bg-gradient-custom { background: linear-gradient(135deg, #e0f2f1 0%, #a5d6a7 100%); }

/* Add Product Page Specifics */
.file-input-wrapper {
    border: 2px dashed var(--primary-light);
    padding: 2rem;
    text-align: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    background-color: rgba(76, 175, 80, 0.05);
    transition: var(--transition-normal);
    position: relative;
    margin-bottom: 1rem;
}

.file-input-wrapper:hover {
    background-color: rgba(76, 175, 80, 0.1);
    border-color: var(--primary-color);
}

.file-input-wrapper input[type="file"] { display: none; }

.file-input-text {
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 500;
    display: block;
    margin-bottom: 0.5rem;
}

.image-preview-container {
    margin-top: 1rem;
    text-align: center;
}

.image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    display: none;
    margin: 0 auto;
}

.quantity-input-group {
    display: flex;
    gap: 1rem;
}

.quantity-input-group input[type="number"] { flex: 2; }
.quantity-input-group select { flex: 1; }

/* Loading Overlay */
.loading-global {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.loading-global.active { display: flex; }

.loading-spinner {
    text-align: center;
    color: var(--primary-color);
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

/* Message Boxes */
.message-box {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.error-messages {
    background-color: #fdecea;
    color: #c0392b;
    border-color: #e74c3c;
}

.success-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-color: #4caf50;
}
