/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
    transition: all 0.3s ease;
}

body {
    background-color: #121212; /* Fondo oscuro */
    color: #f8f8f8; /* Texto claro */
    padding: 20px;
    font-size: 16px;
}

/* Loader Styles */
#loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 50px;
    color: #8A2BE2;
    display: none; /* Hidden by default */
    animation: fadeIn 1s ease-in-out;
}

/* Fade In Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Container Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: 20px;
}

h1 {
    font-size: 2.5rem;
    color: #8A2BE2;
    margin-bottom: 20px;
    animation: slideIn 0.5s ease-out forwards;
}

/* Slide In Animation */
@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Search Section */
.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.search-container input[type="text"] {
    width: 400px;
    padding: 12px;
    border: 2px solid #8A2BE2;
    border-radius: 30px;
    outline: none;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-container input[type="text"]:focus {
    border-color: #6f239d;
    box-shadow: 0 0 5px rgba(106, 54, 156, 0.5);
}

.search-container button {
    background-color: #8A2BE2;
    border: none;
    color: white;
    padding: 12px 25px;
    font-size: 16px;
    cursor: pointer;
    margin-left: 10px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.search-container button i {
    margin-right: 5px;
}

.search-container button:hover {
    background-color: #6f239d;
    transform: translateY(-3px);
}

/* Dark Mode Toggle Button */
#toggleDarkMode {
    background-color: #8A2BE2;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-size: 16px;
    margin-bottom: 20px; /* Space below the button */
}

#toggleDarkMode:hover {
    background-color: #6f239d;
    transform: translateY(-3px);
}

/* Search Results Styles */
#searchResults {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.card {
    background-color: #1e1e1e; /* Fondo oscuro para las tarjetas */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
    margin: 20px;
    width: 300px;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2); /* Sombra más clara al pasar el mouse */
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: brightness(0.8); /* Oscurecer ligeramente las imágenes */
}

.card img:hover {
    transform: scale(1.05);
    filter: brightness(1); /* Restaurar brillo al pasar el mouse */
}

.card-info {
    padding: 15px;
}

.title {
    font-size: 1.5rem;
    color: #f8f8f8; /* Texto claro */
    margin-bottom: 10px;
}

.subtitle {
    color: #8A2BE2; /* Mantener el color del subtítulo */
    font-weight: bold;
    margin-top: 10px;
}

.toggle-instructions {
    background-color: #8A2BE2;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.toggle-instructions:hover {
    background-color: #6f239d;
    transform: scale(1.05);
}

/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Fondo oscuro */
    animation: fadeIn 0.5s ease;
}

.modal-content {
    background-color: #222; /* Fondo del modal */
    margin: 10% auto;
    padding: 20px;
    border-radius: 20px;
    max-width: 80%;
    text-align: left;
    animation: slideIn 0.5s ease-out forwards;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: #8A2BE2;
    cursor: pointer;
}

/* Modal Title */
#modalMealTitle {
    font-size: 1.8rem;
    color: #f8f8f8; /* Texto claro */
    animation: fadeIn 0.5s ease;
}

#modalMealInstructions {
    font-size: 1rem;
    margin-top: 20px;
    color: #ddd; /* Color del texto en el modal */
}

/* Footer */
footer {
    text-align: center;
    margin-top: 50px;
    font-size: 14px;
    color: #f8f8f8; /* Texto claro en el footer */
}

footer a {
    text-decoration: none;
    color: #8A2BE2;
    transition: color 0.3s ease;
}

footer a:hover {
    text-decoration: underline;
    color: #6f239d;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .search-container input[type="text"] {
        width: 70%;
    }

    .search-container button {
        padding: 10px 12px;
    }

    .card {
        width: 100%;
    }

    .modal-content {
        margin: 20% auto;
    }
}
