* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #27AE60;
    --secondary-color: #16A085;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background-color: white;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4rem 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin: 2rem 0;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.search-box input,
.category-filter select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    flex: 1;
    min-width: 200px;
}

.search-box input:focus,
.category-filter select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

/* Recipes Grid */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.recipe-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.recipe-card-body {
    padding: 1.5rem;
}

.recipe-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.recipe-card .category {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.recipe-card p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.recipe-card .servings {
    color: #999;
    font-size: 0.9rem;
}

/* Forms */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-width: 700px;
    margin: 2rem auto;
}

.form-container h2 {
    margin-bottom: 2rem;
    color: var(--primary-color);
}

fieldset {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

legend {
    padding: 0 0.5rem;
    color: var(--dark-color);
    font-weight: bold;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #ff5252;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    margin-right: 0.5rem;
}

.btn-secondary:hover {
    background-color: #45b8ae;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Admin */
.admin-container {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.login-form {
    max-width: 400px;
    margin: 2rem auto;
}

.login-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-tabs {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    border-bottom: 2px solid #ddd;
}

.tab-btn {
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #999;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.recipe-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
}

.recipe-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.recipe-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.recipe-item-actions button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.pagination button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Tableaux admin */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-top: 1.5rem;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.admin-table thead {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table tbody tr:hover {
    background-color: #f9f9f9;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* Actions dans le tableau */
.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-actions button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit {
    background-color: #4ECDC4;
    color: white;
}

.btn-edit:hover {
    background-color: #45b8ae;
}

.btn-delete {
    background-color: #FF6B6B;
    color: white;
}

.btn-delete:hover {
    background-color: #ff5252;
}

/* Modales de formulaire */
.form-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.form-modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s;
}

.form-modal-content h4 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.form-modal-content .form-group {
    margin-bottom: 1rem;
}

.form-modal-content .form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Barre de recherche et filtres */
.admin-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.search-filter-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Formulaire multi-étapes */
.form-modal-content-large {
    width: 90%;
    max-width: 900px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

.form-steps-header {
    margin-bottom: 2rem;
    text-align: center;
}

.form-steps-indicator {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.form-steps-indicator .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    color: #666;
}

.form-steps-indicator .step .step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f0f0f0;
    border: 3px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    transition: all 0.3s;
}

.form-steps-indicator .step:hover .step-number {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.form-steps-indicator .step.active .step-number {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E72 100%);
    color: white;
    border-color: #FF6B6B;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.form-steps-indicator .step.active {
    color: var(--primary-color);
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: slideUp 0.3s ease-out;
}

.form-step h5 {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    font-size: 1.3rem;
}

/* Barre de recherche d'ingrédients */
.ingredients-search-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.ingredients-search {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.ingredients-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.ingredients-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.ingredient-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ingredient-option:hover {
    background-color: #f5f5f5;
}

.ingredient-option-label {
    flex: 1;
}

.ingredient-option-unit {
    color: #999;
    font-size: 0.85rem;
    margin-left: 1rem;
}

/* Liste des ingrédients ajoutés */
.ingredients-list {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: 200px;
}

.ingredient-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    transition: box-shadow 0.2s;
}

.ingredient-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ingredient-item-name {
    font-weight: 500;
    color: var(--dark-color);
}

.ingredient-item-unit {
    font-size: 0.9rem;
    color: #666;
}

.ingredient-quantity-input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    width: 70px;
}

.ingredient-remove-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.ingredient-remove-btn:hover {
    background: #ff5252;
}

/* Liste des étapes */
.steps-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    position: relative;
}

.step-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    margin-right: 0.5rem;
    font-size: 0.85rem;
}

.step-content {
    margin-top: 0.75rem;
}

.step-content textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 80px;
}

.step-duration-input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    width: 100px;
}

.step-remove-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.step-remove-btn:hover {
    background: #ff5252;
}

/* Navigation des étapes */
.form-steps-navigation {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
    border-top: 1px solid #e0e0e0;
    padding-top: 1.5rem;
}

.form-steps-navigation button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-success {
    background: #28A745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination button,
.pagination a {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all 0.3s;
}

.pagination button:hover,
.pagination a:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .recipes-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .admin-tabs {
        flex-wrap: wrap;
    }
}

/* Style pour la page de création de recette */
.form-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-card h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.form-step {
    animation: slideUp 0.3s ease;
}

.image-upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.image-upload-wrapper input[type="file"] {
    padding: 1rem;
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
}

.image-upload-wrapper input[type="file"]:hover {
    background: #f5f5f5;
}

.image-preview {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview img {
    max-width: 100%;
    border-radius: var(--border-radius);
}

