/* Random Food Generator Styles */

/* Main Container */
.food-generator-tool {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 0;
    margin: 0;
}

.food-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: rgb(32, 30, 30);
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tool-description {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

/* Filter Container */
.filter-container {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.filter-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.filter-group select {
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--white);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

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

/* Submit Button */
#get-recipes {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(50, 146, 109, 0.3);
}

#get-recipes:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(50, 146, 109, 0.4);
}

#get-recipes:active {
    transform: translateY(0);
}

/* Loading Indicator */
#loading-indicator {
    text-align: center;
    padding: 3rem;
    background: var(--white);
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #dc2626;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    border-left: 4px solid #dc2626;
}

/* Welcome Message */
.welcome-message {
    background: var(--white);
    border-radius: 20px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.welcome-content {
    max-width: 600px;
    margin: 0 auto;
}

.welcome-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: block;
}

.welcome-message h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.welcome-message p {
    font-size: 1.125rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 15px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.feature-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.feature-item span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Results Header */
.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.results-header p {
    font-size: 1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Recipes Grid */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Recipe Card */
.recipe-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

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

/* Recipe Image Container */
.recipe-image-container {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.recipe-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.recipe-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.recipe-badge.dessert {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

/* Recipe Info */
.recipe-info {
    padding: 1.5rem;
}

.recipe-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

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

.recipe-category,
.recipe-area,
.recipe-time {
    background: var(--bg-light);
    color: var(--text-light);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

.recipe-category {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white);
}

/* Health Rating */
.recipe-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.health-rating {
    display: flex;
    gap: 0.25rem;
}

.health-rating i {
    color: #ef4444;
    font-size: 0.875rem;
}

.rating-text {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Ingredients Preview */
.recipe-ingredients-preview {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.5;
}

.recipe-ingredients-preview strong {
    color: var(--text-color);
}

/* Recipe Overview */
.recipe-overview {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Recipe Actions */
.recipe-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn:not(.secondary) {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(50, 146, 109, 0.3);
}

.action-btn:not(.secondary):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(50, 146, 109, 0.4);
}

.action-btn.secondary {
    background: var(--bg-light);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.action-btn.secondary:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

/* More Options */
.more-options {
    text-align: center;
    margin-top: 3rem;
}

.refresh-btn,
.new-search-btn {
    margin: 0 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.refresh-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(50, 146, 109, 0.3);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(50, 146, 109, 0.4);
}

.new-search-btn {
    background: var(--white);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.new-search-btn:hover {
    background: var(--bg-light);
    transform: translateY(-2px);
}

/* 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.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--white);
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: var(--white);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

/* Modal Recipe Styles */
.modal-recipe-header {
    position: relative;
    height: 300px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

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

.modal-recipe-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--white);
    padding: 2rem;
}

.modal-recipe-info h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

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

.modal-category,
.modal-area {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.modal-recipe-content {
    padding: 2rem;
}

.modal-ingredients,
.modal-instructions {
    margin-bottom: 2rem;
}

.modal-ingredients h3,
.modal-instructions h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-ingredients-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.5rem;
    list-style: none;
    padding: 0;
}

.modal-ingredients-list li {
    background: var(--bg-light);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    border-left: 3px solid var(--primary-color);
}

.modal-instructions-text {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 10px;
    line-height: 1.7;
    color: var(--text-color);
    font-size: 0.95rem;
    white-space: pre-line;
}

.modal-source {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.source-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.source-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(50, 146, 109, 0.3);
}

/* Utility Classes */
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.mb-10 { margin-bottom: 2.5rem; }
.text-center { text-align: center; }

/* Responsive Design */
@media (max-width: 768px) {
    .food-container {
        padding: 1rem;
    }

    .tool-header h1 {
        font-size: 2rem;
    }

    .filter-container {
        padding: 1.5rem;
    }

    .controls {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .recipes-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .recipe-actions {
        flex-direction: column;
    }

    .action-btn {
        min-width: auto;
    }

    .more-options {
        margin-top: 2rem;
    }

    .refresh-btn,
    .new-search-btn {
        display: block;
        width: 100%;
        max-width: 300px;
        margin: 0.5rem auto;
    }

    /* Modal responsive */
    .modal-content {
        margin: 5% auto;
        width: 95%;
        max-height: 85vh;
    }

    .modal-recipe-header {
        height: 200px;
    }

    .modal-recipe-info {
        padding: 1.5rem;
    }

    .modal-recipe-info h2 {
        font-size: 1.5rem;
    }

    .modal-recipe-content {
        padding: 1.5rem;
    }

    .modal-ingredients-list {
        grid-template-columns: 1fr;
    }

    /* Welcome message responsive */
    .welcome-message {
        padding: 2rem 1.5rem;
    }

    .welcome-features {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .tool-header h1 {
        font-size: 1.75rem;
    }

    .tool-description {
        font-size: 1rem;
    }

    .filter-container {
        padding: 1rem;
    }

    .recipe-card {
        border-radius: 15px;
    }

    .recipe-image-container {
        height: 200px;
    }

    .recipe-info {
        padding: 1rem;
    }

    .recipe-title {
        font-size: 1.125rem;
    }

    .modal-recipe-header {
        height: 180px;
    }

    .modal-recipe-info {
        padding: 1rem;
    }

    .modal-recipe-info h2 {
        font-size: 1.25rem;
    }

    .modal-recipe-content {
        padding: 1rem;
    }

    /* Welcome message mobile */
    .welcome-message {
        padding: 1.5rem 1rem;
    }

    .welcome-icon {
        font-size: 3rem;
    }

    .welcome-message h2 {
        font-size: 1.5rem;
    }

    .welcome-message p {
        font-size: 1rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .food-generator-tool {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }

    .filter-container,
    .recipe-card,
    .modal-content,
    .welcome-message {
        background: #2d3748;
        color: #e2e8f0;
    }

    .recipe-title,
    .filter-title,
    .results-header h2,
    .welcome-message h2 {
        color: #e2e8f0;
    }

    .recipe-area,
    .recipe-time,
    .modal-ingredients-list li,
    .modal-instructions-text,
    .feature-item {
        background: #4a5568;
        color: #e2e8f0;
    }

    .filter-group select {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #4a5568;
    }

    .action-btn.secondary {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #4a5568;
    }

    .new-search-btn {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #4a5568;
    }
}
