/* ==========================================================================
   A Vos Fourneaux - Modern Culinary UI Kit
   ========================================================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Playfair+Display:wght@400;600;700&family=Pacifico:wght@400&display=swap');

/* Color Palette Variables */
:root {
    /* A Vos Fourneaux Culinary Palette */
    --af-red: #B5482D;           /* Warm terracotta red */
    --af-cream: #F5E3C8;         /* Creamy beige */
    --af-green: #7A9B5F;         /* Sage green */
    --af-brown: #A3734C;         /* Rich brown */
    --af-text: #3B342E;          /* Dark chocolate text */
    --af-white: #FFFFFF;         /* Pure white */
    
    /* Derived colors */
    --af-red-hover: #9A3D26;     /* Darker red for hover */
    --af-green-hover: #6A8555;   /* Darker green for hover */
    --af-brown-hover: #926442;   /* Darker brown for hover */
    --af-cream-light: #FAF0E2;   /* Lighter cream */
    --af-text-light: #6B6155;    /* Lighter text for subtitles */
    
    /* Status colors */
    --success: #7A9B5F;
    --warning: #D4A574;
    --danger: #B5482D;
    --info: #A3734C;
    
    /* Shadows and borders - Simplified for better mobile performance */
    --shadow-sm: 0 1px 3px rgba(59, 52, 46, 0.08);
    --shadow-md: 0 2px 6px rgba(59, 52, 46, 0.1);
    --shadow-lg: 0 3px 12px rgba(59, 52, 46, 0.12);
    --border-radius: 6px;
    --border-radius-lg: 12px;
}

/* ==========================================================================
   Base Elements
   ========================================================================== */

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(180deg, var(--af-cream), var(--af-white) 60%);
    color: var(--af-text);
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    margin: 0;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: var(--af-text);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

/* Accent text */
.accent-text {
    font-family: 'Pacifico', cursive;
    color: var(--af-white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

p, li {
    line-height: 1.7;
    color: var(--af-text);
}

a {
    color: var(--af-red);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--af-red-hover);
}

/* ==========================================================================
   Layout Components
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Grid System */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Button Components
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-family: 'Lato', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    line-height: 1;
}

/* Primary Button */
.btn-primary, .btn.btn-primary {
    background-color: var(--af-red);
    color: var(--af-white);
    border: 2px solid var(--af-red);
}

.btn-primary:hover, .btn.btn-primary:hover {
    background-color: var(--af-red-hover) !important;
    border-color: var(--af-red-hover) !important;
    color: var(--af-white) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.btn-outline-light {
    border-color: var(--af-white) !important;
    color: var(--af-white) !important;
    background-color: transparent !important;
}

.btn-outline-light:hover {
    background-color: var(--af-white) !important;
    border-color: var(--af-white) !important;
    color: var(--af-red) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

/* Ensure buttons are clickable and not blocked by overlay elements */
.hero .btn {
    position: relative;
    z-index: 10;
    display: inline-block;
    cursor: pointer;
    pointer-events: auto;
}

/* Remove any potential pseudo-element overlays that might block clicks */
.hero::before,
.hero::after {
    pointer-events: none;
}

.hero-section::before,
.hero-section::after {
    pointer-events: none;
}

/* Outline Button */
.btn-outline, .btn-outline-primary {
    background-color: transparent;
    color: var(--af-red);
    border: 2px solid var(--af-red);
}

.btn-outline:hover, .btn-outline-primary:hover {
    background-color: var(--af-red);
    color: var(--af-white);
    transform: translateY(-2px);
}

/* Ghost Button */
.btn-ghost {
    background-color: transparent;
    color: var(--af-text);
    border: none;
    box-shadow: none;
}

.btn-ghost:hover {
    background-color: var(--af-cream);
    transform: translateY(-1px);
}

/* Secondary Button */
.btn-secondary {
    background-color: var(--af-green);
    color: var(--af-white);
    border: 2px solid var(--af-green);
}

.btn-secondary:hover {
    background-color: var(--af-green-hover);
    border-color: var(--af-green-hover);
    color: var(--af-white);
}

/* Button sizes */
.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ==========================================================================
   Badge Components
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background-color: var(--af-red);
    color: var(--af-white);
}

.badge-accent {
    background-color: var(--af-green);
    color: var(--af-white);
}

.badge-neutral {
    background-color: var(--af-cream);
    color: var(--af-text);
}

/* ==========================================================================
   Card Components
   ========================================================================== */

.card {
    background: var(--af-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(181, 72, 45, 0.1);
}

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

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--af-cream);
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    background: linear-gradient(135deg, var(--af-cream), var(--af-cream-light));
}

.card-body {
    padding: 0;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--af-cream);
    margin: 1.5rem -1.5rem -1.5rem -1.5rem;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    background: var(--af-cream-light);
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--af-text);
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Form Components
   ========================================================================== */

.input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--af-cream);
    border-radius: var(--border-radius);
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    background-color: var(--af-white);
    color: var(--af-text);
    transition: all 0.2s ease;
}

.input:focus {
    outline: none;
    border-color: var(--af-red);
    box-shadow: 0 0 0 3px rgba(181, 72, 45, 0.1);
}

/* Override Bootstrap form controls */
.form-control {
    border: 2px solid var(--af-cream);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--af-red);
    box-shadow: 0 0 0 3px rgba(181, 72, 45, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--af-text);
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Navigation Components
   ========================================================================== */

.nav {
    background: var(--af-white);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: 'Pacifico', cursive;
    font-size: 1.5rem;
    color: var(--af-red);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    height: 40px;
    width: auto;
}

.menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu a {
    color: var(--af-text);
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
    position: relative;
}

.menu a:hover {
    color: var(--af-red);
}

.menu a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--af-red);
    transition: width 0.2s ease;
}

.menu a:hover::after,
.menu a.active::after {
    width: 100%;
}

/* Override Bootstrap navbar */
.navbar {
    background: var(--af-white) !important;
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
}

.navbar-brand {
    font-family: 'Pacifico', cursive;
    font-size: 1.5rem;
    color: var(--af-red) !important;
}

.nav-link {
    color: var(--af-text) !important;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--af-red) !important;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    background: linear-gradient(135deg, var(--af-red), var(--af-brown));
    color: var(--af-white);
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--af-white);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Override Bootstrap hero section */
.hero-section {
    background: linear-gradient(135deg, var(--af-red), var(--af-brown)) !important;
}

.hero-section h1 {
    color: var(--af-white) !important;
}

.hero-section p {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/* Margins */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

/* Gaps */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.gap-5 { gap: 3rem; }

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--af-red); }
.text-secondary { color: var(--af-green); }
.text-muted { color: var(--af-text-light); }
.text-white { color: var(--af-white); }

/* Background utilities */
.bg-primary { background-color: var(--af-red); }
.bg-secondary { background-color: var(--af-green); }
.bg-cream { background-color: var(--af-cream); }
.bg-white { background-color: var(--af-white); }

/* ==========================================================================
   Recipe-specific Components
   ========================================================================== */

.recipe-card {
    transition: all 0.3s ease;
}

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

.recipe-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.recipe-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--af-text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.recipe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* ==========================================================================
   Profile Components
   ========================================================================== */

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--af-cream);
    box-shadow: var(--shadow-md);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: center;
}

.stat-item {
    padding: 1rem;
    background: var(--af-cream-light);
    border-radius: var(--border-radius);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--af-red);
    display: block;
}

/* ==========================================================================
   List Components
   ========================================================================== */

.list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-item {
    padding: 1rem;
    border-bottom: 1px solid var(--af-cream);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.list-item:last-child {
    border-bottom: none;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .menu {
        display: none; /* Will be handled by Bootstrap mobile menu */
    }
    
    .profile-stats {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    /* Reduce button sizes on mobile */
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Simplified cards for mobile */
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .card-header {
        margin: -1rem -1rem 1rem -1rem;
        padding: 0.75rem 1rem;
    }
    
    /* Recipe grid adjustments */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Reduce excessive spacing */
    .recipe-card {
        margin-bottom: 1rem;
    }
    
    .recipe-image {
        height: 150px;
    }
    
    /* Better mobile navigation */
    .accent-text {
        font-size: 1.2rem;
    }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

/* Ensure proper contrast ratios */
@media (prefers-contrast: high) {
    :root {
        --af-text: #000000;
        --af-cream: #F0F0F0;
    }
}

/* Focus indicators */
.btn:focus,
.input:focus,
.form-control:focus {
    outline: 2px solid var(--af-red);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   Custom Bootstrap Overrides
   ========================================================================== */

/* Ensure our styles take precedence over Bootstrap */
.btn.btn-primary {
    background-color: var(--af-red) !important;
    border-color: var(--af-red) !important;
}

.btn.btn-primary:hover {
    background-color: var(--af-red-hover) !important;
    border-color: var(--af-red-hover) !important;
}

.card {
    border: 1px solid rgba(181, 72, 45, 0.1) !important;
}

.badge.bg-primary {
    background-color: var(--af-red) !important;
}

/* Logo styles */
.logo-large {
    height: 35px;
    width: auto;
    transition: transform 0.2s ease;
}

.logo-large:hover {
    transform: scale(1.02);
}

/* Footer logo styles */
.footer-logo {
    height: 40px;
    width: auto;
    transition: transform 0.2s ease;
}

.footer-logo:hover {
    transform: scale(1.02);
}

/* Mobile logo size */
@media (max-width: 768px) {
    .logo-large {
        height: 30px;
    }
    
    .footer-logo {
        height: 30px;
    }
}

/* Background custom utility */
.bg-light-custom {
    background-color: var(--af-cream-light) !important;
}

/* ==========================================================================
   Pagination Components
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination .page-item {
    list-style: none;
}

.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    min-width: 40px;
    height: 40px;
    border: 2px solid var(--af-cream);
    border-radius: var(--border-radius);
    color: var(--af-text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination .page-link:hover {
    background-color: var(--af-red);
    border-color: var(--af-red);
    color: var(--af-white);
}

.pagination .page-item.active .page-link {
    background-color: var(--af-red);
    border-color: var(--af-red);
    color: var(--af-white);
}

.pagination .page-item.disabled .page-link {
    color: var(--af-text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Mobile pagination */
@media (max-width: 768px) {
    .pagination {
        gap: 0.25rem;
        margin: 1rem 0;
    }
    
    .pagination .page-link {
        padding: 0.4rem 0.6rem;
        min-width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
}