:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --accent-color: #45b7d1;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --border-color: #e9ecef;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Header */
.header-main {
    background: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand .logo {
    height: 40px;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--text-dark) !important;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

/* Search */
.search-container {
    position: relative;
    display: flex;
}

.search-input {
    border-radius: 25px 0 0 25px;
    border: 2px solid var(--border-color);
    border-right: none;
    padding-left: 1rem;
}

.search-btn {
    border-radius: 0 25px 25px 0;
    border: 2px solid var(--primary-color);
    background: var(--primary-color);
    color: white;
    border-left: none;
    padding: 0 1rem;
}

.search-btn:hover {
    background: #ff5252;
    border-color: #ff5252;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 4rem 0;
    color: white;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Recipe Grid */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.recipe-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.recipe-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recipe-card:hover .recipe-image img {
    transform: scale(1.1);
}

.recipe-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.recipe-content {
    padding: 1.5rem;
}

.recipe-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    text-decoration: none;
}

.recipe-title:hover {
    color: var(--primary-color);
}

.recipe-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-light);
}

.recipe-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.recipe-views {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Sidebar */
.sidebar {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 15px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

/* Popular Recipes */
.popular-recipe-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.popular-recipe-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.popular-recipe-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.popular-recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-recipe-content h6 {
    margin-bottom: 0.25rem;
}

.popular-recipe-content a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.3;
}

.popular-recipe-content a:hover {
    color: var(--primary-color);
}

/* Categories */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.category-link:hover {
    background: #f1f3f4;
    transform: translateX(5px);
    color: var(--text-dark);
}

.category-count {
    background: var(--bg-light);
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Ads */
.ad-container {
    text-align: center;
    margin: 2rem 0;
}

.ad-header-container {
    background: var(--bg-light);
    padding: 1rem 0;
    margin: 0;
}

.ad-footer-container {
    background: var(--bg-light);
    padding: 1rem 0;
    margin: 0;
}

/* Footer */
.footer-main {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-main h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Newsletter */
.newsletter-form .input-group {
    margin-bottom: 1rem;
}

.newsletter-form .form-control {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
}

.newsletter-form .form-control::placeholder {
    color: rgba(255,255,255,0.7);
}

.newsletter-form .btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Social Links */
.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.social-link:hover {
    transform: translateY(-2px);
    color: white;
}

/* Recipe Detail Page */
.recipe-header {
    background: white;
    padding: 2rem 0;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.recipe-main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 15px;
}

.recipe-info {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.recipe-ingredients,
.recipe-instructions {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.ingredients-list {
    list-style: none;
    padding: 0;
}

.ingredients-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    padding-left: 2rem;
}

.ingredients-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.instructions-list {
    counter-reset: step-counter;
    list-style: none;
    padding: 0;
}

.instructions-list li {
    counter-increment: step-counter;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    padding-left: 3rem;
}

.instructions-list li:before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 1rem;
    background: var(--primary-color);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .recipes-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sidebar {
        margin-top: 2rem;
        position: static;
    }
    
    .recipe-main-image {
        height: 250px;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .search-form {
        margin-top: 1rem;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .recipe-content {
        padding: 1rem;
    }
    
    .recipe-info,
    .recipe-ingredients,
    .recipe-instructions {
        padding: 1rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pagination */
.pagination {
    justify-content: center;
    margin: 2rem 0;
}

.pagination .page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
}

.pagination .page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
