:root {
    --color-bg: #fdfdfd;
    --color-text: #333;
    --color-header-bg: #ff7043;
    --color-controls-bg: #ffe0b2;
    --color-card-bg: #ffffff;
    --color-modal-bg: #ffffff;
}

.dark-mode {
    --color-bg: #121212;
    --color-text: #f0f0f0;
    --color-header-bg: #d35400;
    --color-controls-bg: #333333;
    --color-card-bg: #2a2a2a;
    --color-modal-bg: #2a2a2a;
}

.dark-mode .favorite-btn {
    color: white;
}

.dark-mode .modal-content {
    background: #1e1e1e; /* fondo oscuro */
    color: #f0f0f0; /* texto claro y legible */
}

.dark-mode .modal-content h3 {
    color: #ff7043; /* rojito/anaranjado que ya tenías */
}

.dark-mode .modal-content ul,
.dark-mode .modal-content ol {
    color: #e0e0e0; /* gris claro, legible sobre fondo oscuro */
}



body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--color-bg);
    margin: 0;
    padding: 0;
    color: var(--color-text);
}

body {
    transition: background-color 0.4s, color 0.4s;
}

header {
    background-color: var(--color-header-bg);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    font-size: 1.5rem;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.recipe-card {
    background: var(--color-card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 1rem;
    padding: 1rem;
    max-width: 300px;
    transition: transform 0.2s, background-color 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.recipe-card .favorite-btn {
    margin-top: auto;
    align-self: flex-start;
}

.modal-content {
    transition: background-color 0.4s, color 0.4s;
    background: var(--color-modal-bg);
    padding: 20px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.controls {
    background-color: var(--color-controls-bg);
    border-radius: 12px;
    margin: 1rem auto;
    max-width: 900px;
}

.recipe-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.recipe-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
}

.recipe-card {
    animation: fadeInUp 0.5s ease both;
}

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

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal.show .modal-content {
    animation: zoomIn 0.3s ease;
}

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

button {
    transition: transform 0.2s, background-color 0.3s;
}

button:hover {
    transform: scale(1.1);
    background-color: #ff7043;
    color: white;
}

button.favorite-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

.favorite-btn {
    transition: transform 0.2s;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.fav-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.fav-btn.active {
    color: #e91e63;
    transform: scale(1.2);
}

.modal.hidden {
    display: none;
}

.modal-content img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.modal-content h2 {
    margin: 0.5rem 0;
    font-size: 1.8rem;
    color: var(--color-text);
}

.modal-content h3 {
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    color: #ff7043;
}

.modal-content ul,
.modal-content ol {
    padding-left: 1.5rem;
    line-height: 1.6;
}

body.modal-open {
    overflow: hidden;
}

.close {
    position: sticky;
    top: 10px;
    right: 10px;
    font-size: 28px;
    cursor: pointer;
    color: #333;
    transition: color 0.2s;
    z-index: 1000;
    background: rgba(0,0,0,0.4);
    border-radius: 50%;
    padding: 4px 8px;
}

.close:hover {
    color: #ff7043;
}

.dark-mode .close {
    color: #f0f0f0;
    background: rgba(255,255,255,0.1);
}

.dark-mode .close:hover {
    color: #ffb74d;
}

.filters {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filters select,
.filters input{
    padding: 0.6rem 1rem;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    background-color: #fff;
    color: #333;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;

}

.filters select:focus,
.filters input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 112, 67, 0.4);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background-color: #ffe0b2;
    border-radius: 12px;
    margin: 1rem auto;
    max-width: 900px;
}

.controls select,
.controls input {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    min-width: 200px;
}

.controls select:focus,
.controls input:focus {
    outline: none;
    border-color: #ff7043;
    box-shadow: 0 0 5px rgba(255, 112, 67, 0.5);
}

#detalle-receta {
    max-width: 800px;
    margin: auto;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background-color: white;
}

#detalle-receta img {
    max-width: 100%;
    border-radius: 10px;
}

#recipes-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    padding: 1rem;
    gap: 16px;
    justify-content: center;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    margin: 0 0.3rem;
    line-height: 1;
    transition: transform 0.2s;
}

#theme-toggle:hover {
    transform: scale(1.2);
}
