/* Styles personnalisés pour le site de recettes */

:root {
    /* Palette inspirée de Dribbble - tons neutres et modernes */
    --primary-color: #ea4c89;
    --primary-hover: #d73578;
    --primary-border-hover: #c42d6b;
    --primary-light: #ea4c891c;
    --primary-medium: #d735783b;
    --secondary-color: #8e8e93;
    --success-color: #34c759;
    --danger-color: #ff3b30;
    --warning-color: #ff9500;
    --info-color: #007aff;
    
    /* Couleurs neutres modernes */
    --light-color: #f2f2f7;
    --dark-color: #1c1c1e;
    --text-primary: #1c1c1e;
    --text-secondary: #8e8e93;
    --text-tertiary: #c7c7cc;
    
    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f2f2f7;
    --bg-tertiary: #ffffff;
    
    /* Borders */
    --border-color: #e5e5ea;
    --border-hover: #d1d1d6;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    font-size: 16px;
    font-weight: 400;
}

/* Navigation */
.navbar {
    background-color: var(--bg-primary) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
}

/* Override Bootstrap navbar-dark bg-primary */
.navbar-dark {
    background-color: var(--bg-primary) !important;
}

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

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--text-primary) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    height: 100%;
}

.navbar-brand img {
    height: 100% !important;
    max-height: 60px;
    width: auto;
    object-fit: contain;
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
    background-color: var(--light-color);
}

.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    background-color: var(--light-color);
}

/* Navbar toggler (hamburger menu) */
.navbar-toggler {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    background-color: var(--bg-primary);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 4px rgba(234, 76, 137, 0.1);
    border-color: var(--primary-color);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%231c1c1e' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    width: 1.5em;
    height: 1.5em;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-medium) 50%, var(--primary-light) 100%);
    color: var(--text-primary);
    padding: 100px 0;
    margin-bottom: 60px;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Image de fond du hero si définie */
.hero-section.has-bg-image {
    background-image: url('');
}

/* Masque rose transparent par-dessus l'image */
.hero-section.has-bg-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(234, 76, 137, 0.3) 0%, rgba(215, 53, 120, 0.4) 50%, rgba(234, 76, 137, 0.3) 100%);
    z-index: 1;
}

/* Pattern de grain par-dessus le masque */
.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    z-index: 2;
}

.hero-section .container {
    position: relative;
    z-index: 3;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.hero-section p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    opacity: 0.9;
    font-weight: 400;
}

.hero-logo-container {
    text-align: center;
}

.hero-logo {
    max-width: 100%;
    max-height: 250px;
    width: auto;
    height: auto;
    opacity: 0.9;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}

.hero-logo:hover {
    opacity: 1;
    transform: scale(1.05);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
}

/* Cards */
.recipe-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    background-color: var(--bg-primary);
    overflow: hidden;
}

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

.recipe-card img {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.recipe-card .card-body {
    padding: 24px;
}

.recipe-card .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.recipe-card .card-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

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

.recipe-meta i {
    color: var(--primary-color);
    width: 16px;
}

/* Badges */
.difficulty-badge {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge {
    border-radius: 20px;
    font-weight: 500;
    padding: 6px 12px;
}

/* Profile */
.profile-avatar {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
}

.profile-stats {
    background: var(--light-color);
    border-radius: 10px;
    padding: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Forms */
.form-control {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: var(--bg-primary);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(234, 76, 137, 0.1);
    background-color: var(--bg-primary);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-select {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    background-color: var(--bg-primary);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(234, 76, 137, 0.1);
}

/* Buttons */
.btn {
    border-radius: 12px;
    font-weight: 500;
    padding: 12px 24px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 0.95rem;
}

/* Style général pour les boutons au hover - bordure rose plus foncée */
.btn:hover {
    border-color: var(--primary-border-hover);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

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

/* Bouton favori actif - icône blanche sur fond rouge */
.btn-outline-danger.active {
    background-color: var(--danger-color) !important;
    border-color: var(--danger-color) !important;
    color: white !important;
}

.btn-outline-danger.active i {
    color: white !important;
}

/* Badges avec fond rose et texte blanc */
.badge.bg-primary {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.badge.bg-primary i {
    color: white !important;
}

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

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

.btn-secondary {
    background-color: var(--text-tertiary);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-secondary {
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    background-color: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--text-secondary);
    color: white;
    border-color: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 12px;
    padding: 16px 20px;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(52, 199, 89, 0.08);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: rgba(255, 59, 48, 0.08);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: rgba(255, 149, 0, 0.08);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: rgba(0, 122, 255, 0.08);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

/* Containers */
.container, .container-fluid {
    background-color: var(--bg-primary);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* Espacement entre header et contenu principal */
.container.py-5 {
    margin-top: 20px;
}

/* Cards générales */
.card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    background-color: var(--bg-primary);
    transition: all 0.3s ease;
}

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

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
    
    .profile-avatar {
        width: 100px;
        height: 100px;
    }
    
    .container, .container-fluid {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .recipe-card .card-body {
        padding: 16px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .hero-logo {
        max-height: 180px;
    }
}

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

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

.slide-in-up {
    animation: slideInUp 0.8s ease-out;
}

.scale-in {
    animation: scaleIn 0.5s ease-out;
}

/* Smooth transitions for all interactive elements */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

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

p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.text-muted {
    color: var(--text-tertiary) !important;
}

/* Utilities */
.text-primary { color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }

/* Spacing utilities */
.mb-section { margin-bottom: 4rem; }
.mt-section { margin-top: 4rem; }
.py-section { padding: 4rem 0; }

/* Modern spacing */
.section-padding {
    padding: 80px 0;
}

.content-padding {
    padding: 40px 0;
}

/* Recipe details */
.recipe-ingredients {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
}

.recipe-instructions {
    line-height: 1.8;
    color: var(--text-secondary);
}

.recipe-instructions ol {
    counter-reset: step-counter;
    padding-left: 0;
}

.recipe-instructions li {
    counter-increment: step-counter;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    position: relative;
    list-style: none;
}

.recipe-instructions li::before {
    content: counter(step-counter);
    position: absolute;
    left: -2px;
    top: 16px;
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Avatar Upload Zone */
.avatar-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: var(--bg-secondary);
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-upload-zone:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.avatar-upload-zone.dragover {
    border-color: var(--primary-color);
    background: var(--primary-medium);
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.avatar-upload-content {
    pointer-events: none;
}

.avatar-upload-zone .text-primary {
    pointer-events: auto;
}

.avatar-preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
}

.avatar-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.avatar-preview-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.avatar-preview:hover .avatar-preview-overlay {
    opacity: 1;
}

/* Recipe Image Upload Zone */
.recipe-image-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: var(--bg-secondary);
    position: relative;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Step Image Upload Zone */
.step-image-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: var(--bg-secondary);
    position: relative;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-image-upload-zone:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.step-image-upload-zone.dragover {
    border-color: var(--primary-color);
    background: var(--primary-medium);
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.step-image-upload-content {
    pointer-events: none;
}

.step-image-preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
}

.step-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.step-image-preview-overlay {
    position: absolute;
    top: 5px;
    right: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.step-image-preview:hover .step-image-preview-overlay {
    opacity: 1;
}

/* Step Items */
.step-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.step-item:hover {
    border-color: var(--primary-color) !important;
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

/* Recipe Steps Display */
.recipe-steps .step-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.recipe-steps .step-item:hover {
    border-color: var(--primary-color) !important;
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.step-number {
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-color) !important;
    color: white !important;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.step-content {
    flex: 1;
    line-height: 1.6;
}

.step-image {
    text-align: center;
}

.step-image img {
    max-height: 200px;
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .recipe-steps .step-item .row {
        flex-direction: column;
    }
    
    .recipe-steps .step-item .col-md-4 {
        margin-top: 15px;
    }
    
    .step-image img {
        max-height: 150px;
    }
}

.recipe-image-upload-zone:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.recipe-image-upload-zone.dragover {
    border-color: var(--primary-color);
    background: var(--primary-medium);
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.recipe-image-upload-content {
    pointer-events: none;
}

.recipe-image-upload-zone .text-primary {
    pointer-events: auto;
}

.recipe-image-preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
}

.recipe-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.recipe-image-preview-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.recipe-image-preview:hover .recipe-image-preview-overlay {
    opacity: 1;
}

