:root {
    --primary-color: #2c3e50;
    --accent-color: #e74c3c;
    --secondary-color: #3498db;
    --bg-color: #f5f6fa;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --border-radius: 12px;
}

@font-face {
    font-family: 'Doran';
    src: url('fonts/Doran.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Doran', 'Vazir', 'Tahoma', sans-serif;
}

body {
    background-color: #ffffff;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(to right, var(--accent-color), var(--secondary-color));
    border-radius: 3px;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    position: relative;
    display: inline-block;
}

h1::before, h1::after {
    content: '🍽️';
    font-size: 1.8rem;
    margin: 0 15px;
    opacity: 0.7;
}

.search-box {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto 1.5rem;
    animation: fadeIn 1s ease-out;
    position: relative;
    z-index: 1;
    align-items: center;
}

.suggest-btn {
    background-color: #2196F3;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s;
}

.suggest-btn:hover {
    background-color: #1976D2;
}

.search-history {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    animation: fadeIn 0.8s ease-out;
}

.search-history h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.history-list li {
    background-color: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(44, 62, 80, 0.1);
}

.history-list li:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
}

input[type="text"] {
    flex: 1;
    padding: 1.2rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    border-color: var(--accent-color);
    outline: none;
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(231, 76, 60, 0.15);
}

.search-btn {
    padding: 1.2rem 2.5rem;
    background: linear-gradient(45deg, var(--accent-color), #d35400);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-weight: bold;
    letter-spacing: 1px;
}

.search-btn:hover {
    background-color: #c0392b;
    transform: translateY(-3px);
}

.search-btn:active {
    transform: translateY(0);
}

.search-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.search-btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

.loading {
    text-align: center;
    padding: 2rem;
    animation: fadeIn 0.5s ease-out;
}

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

.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    text-align: center;
    z-index: 1000;
    animation: fadeInUp 0.8s ease-out;
    border: 1px solid rgba(44, 62, 80, 0.1);
    backdrop-filter: blur(8px);
    transform-origin: bottom;
}

.install-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.install-btn {
    background: linear-gradient(45deg, var(--accent-color), #d35400);
    padding: 0.8rem 2rem;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
}

.install-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.4);
    background: linear-gradient(45deg, #e74c3c, #c0392b);
}

.install-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

.cancel-btn {
    background: linear-gradient(45deg, #95a5a6, #7f8c8d);
    padding: 0.8rem 2rem;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(127, 140, 141, 0.2);
}

.cancel-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(127, 140, 141, 0.4);
    background: linear-gradient(45deg, #7f8c8d, #6c7a7d);
}

.cancel-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(127, 140, 141, 0.3);
}
   
.install-btn {
    background: linear-gradient(45deg, var(--accent-color), #d35400);
    padding: 0.8rem 2rem;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.cancel-btn {
    background: linear-gradient(45deg, #95a5a6, #7f8c8d);
    padding: 0.8rem 2rem;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.error {
    background: linear-gradient(45deg, #ff7675, #d63031);
    color: white;
    padding: 1.2rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    text-align: center;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    box-shadow: 0 5px 15px rgba(255, 118, 117, 0.4);
    border-left: 5px solid #d63031;
}

.recipe-container {
    display: none;
    transition: all 0.3s ease;
    margin-top: 2rem;
}

.recipe-container.active {
    display: block;
    animation: fadeInUp 0.8s ease-out;
}

.food-images {
    padding: 1rem;
}

/* Slideshow styles */
.slideshow-container {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.slide {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    animation: fadeIn 0.8s ease-out;
}

.food-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius);
    transition: all 0.4s ease;
    filter: brightness(0.95);
}

.slideshow-controls {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 10;
}

.dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background-color: white;
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

/* YouTube redirect button */
.youtube-redirect {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.youtube-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(45deg, #FF0000, #CC0000);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(204, 0, 0, 0.3);
}

.youtube-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(204, 0, 0, 0.4);
}

.youtube-btn:active {
    transform: translateY(-1px);
}

.youtube-icon {
    font-size: 1.2rem;
}

.recipe-content {
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.ingredients-section, .instructions-section, .nutrition-section, .serving-section {
    margin-bottom: 2rem;
    animation: fadeInRight 0.8s ease-out;

    animation-fill-mode: both;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border-bottom: 2px solid rgba(44, 62, 80, 0.1);
}

.ingredients-section:hover, .instructions-section:hover, .nutrition-section:hover, .serving-section:hover {
    transform: translateY(-5px);
}

.ingredients-section {
    animation-delay: 0.3s;
}

.instructions-section {
    animation-delay: 0.4s;
}

.nutrition-section {
    animation-delay: 0.5s;
}

.serving-section {
    animation-delay: 0.6s;
}

.history-section {
    animation-delay: 0.7s;
    grid-column: 1 / -1;
}

.preparation-section,
.alternatives-section,
.serving-suggestions-section,
.pairings-section,
.seasonal-section,
.storage-section,
.health-benefits-section {
    margin-bottom: 2rem;
    animation: fadeInRight 0.8s ease-out;
    animation-fill-mode: both;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border-bottom: 2px solid rgba(44, 62, 80, 0.1);
    grid-column: 1 / -1;
}

.preparation-section { animation-delay: 0.8s; }
.alternatives-section { animation-delay: 0.9s; }
.serving-suggestions-section { animation-delay: 1s; }
.pairings-section { animation-delay: 1.1s; }
.seasonal-section { animation-delay: 1.2s; }
.storage-section { animation-delay: 1.3s; }
.health-benefits-section { animation-delay: 1.4s; }

.preparation-list,
.alternatives-list,
.serving-suggestions-list,
.pairings-list,
.seasonal-list,
.storage-list,
.health-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.preparation-list li,
.alternatives-list li,
.serving-suggestions-list li,
.pairings-list li,
.seasonal-list li,
.storage-list li,
.health-benefits-list li {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.preparation-list li:hover,
.alternatives-list li:hover,
.serving-suggestions-list li:hover,
.pairings-list li:hover,
.seasonal-list li:hover,
.storage-list li:hover,
.health-benefits-list li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

.history-origin, .history-background, .history-regional {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 1.2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.history-origin:hover, .history-background:hover, .history-regional:hover {
    transform: translateY(-3px);
}

.history-section h3 {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

.history-section p {
    line-height: 1.8;
    color: var(--text-color);
    text-align: justify;
}

h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    position: relative;
    display: inline-block;
    font-weight: bold;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--accent-color), var(--secondary-color));
    border-radius: 3px;
    transform: scaleX(0.3);
    transform-origin: left;
    transition: transform 0.5s ease;
}

h2:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.ingredients-list {
    list-style: none;
}

.ingredients-list, .instructions-list {
    list-style-position: inside;
    padding: 0;
}

.ingredients-list li {
    padding: 0.8rem 0;
    border-bottom: 1px dashed rgba(44, 62, 80, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.ingredients-list li:hover {
    transform: translateX(5px);
    color: var(--accent-color);
}

.ingredients-list li:last-child {
    border-bottom: none;
}

.instructions-list li {
    margin: 1rem 0;
    padding-right: 1rem;
    position: relative;
    transition: transform 0.3s;
}

.instructions-list li:hover {
    transform: translateX(5px);
}

.tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    background: linear-gradient(45deg, var(--secondary-color), #2980b9);
    color: white;
    margin-right: 0.5rem;
    opacity: 0.8;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.hidden {
    display: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 1;
    }
    20% {
        transform: scale(25, 25);
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
        margin: 1rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    h1::before, h1::after {
        font-size: 1.4rem;
        margin: 0 10px;
    }

    .search-box {
        flex-direction: column;
    }

    .recipe-content {
        padding: 1rem;
    }
    
    .slideshow-container {
        height: 250px;
    }
    
    .youtube-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.8rem;
        margin: 0.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h1::before, h1::after {
        font-size: 1.2rem;
        margin: 0 5px;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .search-btn {
        padding: 1rem 1.5rem;
    }
    
    input[type="text"] {
        padding: 1rem;
    }
}