
/* ============================================
   MesRecettes - CSS Moderne et Responsive
   Design épuré, professionnel et accessible
   ============================================ */

/* ============================================
   VARIABLES CSS GLOBALES
   Palette de couleurs sobre avec accent vert
   ============================================ */
:root {
    /* Couleurs principales */
    --primary: #059669;
    --primary-light: #10B981;
    --primary-dark: #047857;
    --primary-50: #ECFDF5;
    --primary-100: #D1FAE5;
    
    /* Couleurs secondaires */
    --secondary: #3B82F6;
    --danger: #DC2626;
    --danger-light: #FEE2E2;
    --warning: #F59E0B;
    --success: #10B981;
    
    /* Nuances de gris */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    /* Couleurs de base */
    --white: #FFFFFF;
    --black: #000000;
    
    /* Ombres */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Rayons de bordure */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Typographie */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Plus Jakarta Sans', var(--font-sans);
}

/* ============================================
   RESET ET BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input, textarea, select {
    font-family: inherit;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 640px) {
    .container {
        padding: 0 2rem;
    }
}

.main-content {
    min-height: calc(100vh - 200px);
    padding: 3rem 0;
}

/* ============================================
   HEADER - Navigation moderne et sticky
   ============================================ */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    transition: transform var(--transition-fast);
}

.logo:hover {
    transform: scale(1.02);
    color: var(--primary);
}

.logo i {
    font-size: 1.75rem;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-600);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-50);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-50);
}

.nav-link.btn-primary {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
}

.nav-link.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
}

/* Menu mobile */
.mobile-menu-btn {
    display: none;
    padding: 0.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-700);
}

@media (max-width: 900px) {
    .nav {
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        gap: 0.25rem;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: var(--shadow-lg);
        display: none;
    }
    
    .nav.active {
        display: flex;
    }
    
    .nav-link {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ============================================
   HERO SECTION - Design moderne avec gradient
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #065F46 100%);
    color: var(--white);
    padding: 5rem 0;
    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%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1.25rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    margin-bottom: 2.5rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   BUTTONS - Styles modernes avec états
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn i {
    font-size: 1.125rem;
    width: 1.125rem;
    height: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary-50);
    border-color: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #B91C1C;
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.btn-full {
    width: 100%;
}

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

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

/* ============================================
   CARDS - Design épuré avec ombres subtiles
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* ============================================
   CATEGORIES SECTION
   ============================================ */
.categories-section {
    padding: 5rem 0;
    background: var(--white);
}

.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-align: center;
    color: var(--gray-900);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    text-align: center;
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.category-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.category-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-800);
}

.category-card p {
    color: var(--gray-500);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ============================================
   RECIPES SECTION & GRID
   ============================================ */
.recipes-section {
    padding: 5rem 0;
    background: var(--gray-50);
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.recipe-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: all var(--transition-base);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

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

.recipe-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--gray-100);
    position: relative;
}

.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform var(--transition-slow);
}

.recipe-card:hover .recipe-image img {
    transform: scale(1.05);
}

.recipe-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: var(--white);
}

.recipe-image-placeholder i {
    font-size: 3.5rem;
    opacity: 0.9;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recipe-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.recipe-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
    line-height: 1.4;
}

.recipe-description {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    flex: 1;
}

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

.recipe-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.recipe-meta-item i {
    color: var(--primary);
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.difficulty-facile { color: var(--success) !important; }
.difficulty-moyen { color: var(--warning) !important; }
.difficulty-difficile { color: var(--danger) !important; }

.recipe-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
    margin-top: auto;
}

.recipe-author {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.recipe-category {
    background: var(--primary-50);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================
   RECIPE DETAIL PAGE
   ============================================ */
.recipe-detail {
    max-width: 1000px;
    margin: 0 auto;
}

.recipe-detail-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
    align-items: start;
}

.recipe-detail-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--gray-900);
    line-height: 1.2;
}

.recipe-detail-description {
    font-size: 1.0625rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

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

.tag {
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
}

.recipe-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
}

.meta-item i {
    font-size: 1.5rem;
    color: var(--primary);
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.meta-item div {
    display: flex;
    flex-direction: column;
}

.meta-item strong {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.meta-item span {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
}

.recipe-detail-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.recipe-detail-image {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 4/3;
}

.recipe-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-detail-content {
    display: grid;
    gap: 2rem;
}

.recipe-section {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.recipe-section-title {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--gray-900);
}

.recipe-section-title i {
    color: var(--primary);
    font-size: 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ingredients-list {
    display: grid;
    gap: 0.625rem;
}

.ingredient-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.ingredient-item:hover {
    background: var(--gray-100);
}

.ingredient-item i {
    color: var(--primary);
    font-size: 0.5rem;
    flex-shrink: 0;
}

.ingredient-item span {
    font-size: 0.9375rem;
    color: var(--gray-700);
}

.ingredient-item strong {
    color: var(--primary-dark);
    font-weight: 600;
}

.instructions-list {
    display: grid;
    gap: 1.25rem;
}

.instruction-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.instruction-number {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.instruction-item p {
    flex: 1;
    padding-top: 0.375rem;
    line-height: 1.7;
    color: var(--gray-700);
}

.recipe-author-section {
    background: var(--gray-50);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
}

.recipe-author-section h3 {
    font-size: 0.875rem;
    margin-bottom: 1rem;
    color: var(--gray-500);
    font-weight: 500;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 3rem;
    height: 3rem;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.author-details strong {
    display: block;
    font-size: 1rem;
    color: var(--gray-800);
}

.author-details span {
    display: block;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ============================================
   FORMS - Design moderne et accessible
   ============================================ */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    color: var(--gray-900);
}

.page-subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 2rem;
    font-size: 1.0625rem;
}

.recipe-form {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.625rem;
    color: var(--gray-700);
    font-size: 0.9375rem;
}

.form-label i {
    color: var(--primary);
    font-size: 1.125rem;
    width: 1.125rem;
    height: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--gray-800);
    background: var(--white);
    transition: all var(--transition-fast);
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
    border-color: var(--gray-300);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-50);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--gray-400);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    cursor: pointer;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    appearance: none;
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

/* ============================================
   DYNAMIC INGREDIENTS & STEPS
   ============================================ */
#ingredients-container,
#steps-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ingredient-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
    transition: all var(--transition-fast);
}

.ingredient-row:hover {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

.step-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: start;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
    transition: all var(--transition-fast);
}

.step-row:hover {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

.step-number {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.step-input {
    min-height: 80px;
}

.btn-remove {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    background: var(--danger-light);
    color: var(--danger);
    border: none;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1.25rem;
}

.btn-remove:hover {
    background: var(--danger);
    color: var(--white);
    transform: scale(1.05);
}

/* Autocomplete pour ingrédients */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9375rem;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--primary-50);
    color: var(--primary);
}

/* ============================================
   SHOPPING LIST - Liste de courses
   ============================================ */
.shopping-list-container {
    max-width: 1100px;
    margin: 0 auto;
}

.shopping-list-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.shopping-list-section {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.shopping-list-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--gray-900);
}

.shopping-list-section h2 i {
    color: var(--primary);
    font-size: 1.375rem;
    width: 1.375rem;
    height: 1.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recipe-select-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-height: 450px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.recipe-select-list::-webkit-scrollbar {
    width: 6px;
}

.recipe-select-list::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

.recipe-select-list::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.recipe-select-list::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.recipe-select-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.recipe-select-item:hover {
    background: var(--primary-50);
    border-color: var(--primary-100);
}

.recipe-select-item:has(input:checked) {
    background: var(--primary-50);
    border-color: var(--primary);
}

.recipe-select-item input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.recipe-select-info {
    flex: 1;
    min-width: 0;
}

.recipe-select-info strong {
    display: block;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recipe-select-info small {
    color: var(--gray-500);
    font-size: 0.8125rem;
}

.ingredients-result {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.ingredient-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.ingredient-result-item:hover {
    background: var(--gray-100);
}

.ingredient-result-item i {
    color: var(--primary);
    font-size: 0.625rem;
    flex-shrink: 0;
}

.ingredient-result-item span {
    font-size: 0.9375rem;
    color: var(--gray-700);
}

.ingredient-result-item strong {
    color: var(--primary-dark);
    font-weight: 600;
    margin-right: 0.25rem;
}

.empty-shopping-list {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray-500);
}

.empty-shopping-list i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.4;
    display: block;
}

.empty-shopping-list p {
    font-size: 0.9375rem;
    line-height: 1.6;
}

.shopping-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
}

/* ============================================
   AUTH PAGES - Connexion / Inscription
   ============================================ */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 300px);
    padding: 2rem 0;
}

.auth-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
    width: 100%;
    max-width: 440px;
}

.auth-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.auth-subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 2rem;
    font-size: 0.9375rem;
}

.auth-form {
    display: grid;
    gap: 1.25rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--gray-500);
    font-size: 0.9375rem;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   ALERTS - Messages d'alerte
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
}

.alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-error {
    background: var(--danger-light);
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-success {
    background: var(--primary-100);
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* ============================================
   FILTERS - Filtres de recherche
   ============================================ */
.filters-section {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    margin-bottom: 2rem;
}

.filters-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-50);
}

.results-info {
    margin-bottom: 1.5rem;
    color: var(--gray-500);
    font-size: 0.9375rem;
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}

.no-results i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
    display: block;
}

.no-results p {
    font-size: 1.0625rem;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* ============================================
   PROFILE - Page profil
   ============================================ */
.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 5rem;
    height: 5rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}

.profile-fullname {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.profile-email,
.profile-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info strong {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-info span {
    display: block;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.profile-section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gray-900);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
    display: block;
}

.empty-state p {
    font-size: 1.0625rem;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* ============================================
   FOOTER - Pied de page moderne
   ============================================ */
.footer {
    background: var(--gray-900);
    color: var(--white);
    padding: 4rem 0 1.5rem;
    margin-top: 5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-section h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-300);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-section p {
    color: var(--gray-400);
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.footer-section a {
    display: block;
    color: var(--gray-400);
    margin-bottom: 0.625rem;
    font-size: 0.9375rem;
    transition: color var(--transition-fast);
}

.footer-section a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-800);
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.footer-bottom a {
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.875rem;
}

.footer-bottom a:hover {
    color: var(--primary);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .recipe-detail-header {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .recipe-detail-image {
        order: -1;
    }
    
    .shopping-list-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 2rem 0;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .categories-section,
    .recipes-section {
        padding: 3rem 0;
    }
    
    .recipes-grid {
        grid-template-columns: 1fr;
    }
    
    .recipe-detail-meta {
        grid-template-columns: 1fr;
    }
    
    .recipe-form {
        padding: 1.5rem;
    }
    
    .ingredient-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .ingredient-row .btn-remove {
        justify-self: end;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .filters-form {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .shopping-actions {
        flex-direction: column;
    }
    
    .shopping-actions .btn {
        width: 100%;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .shopping-list-section {
        padding: 1.5rem;
    }
    
    .recipe-section {
        padding: 1.5rem;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Animation de chargement */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Impression */
@media print {
    .header,
    .footer,
    .btn,
    .nav {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .main-content {
        padding: 0;
    }
}
</file>
