/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    min-height: 100vh;
}

/* Header */
header {
    background: linear-gradient(135deg, #2c5530, #4a7c59);
    color: white;
    padding: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    transition: opacity 0.3s ease;
}

.header-title {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    transition: opacity 0.3s ease;
}

.header-title:hover {
    opacity: 0.8;
}

.chef-hat-logo {
    height: 40px;
    width: auto;
    margin-right: 15px;
    filter: brightness(0) invert(1); /* Makes the logo white */
    transition: transform 0.3s ease;
}

.header-title:hover .chef-hat-logo {
    transform: scale(1.1);
}

header h1:hover {
    opacity: 0.8;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main content layout */
.main-content {
    display: flex;
    min-height: calc(100vh - 160px);
}

/* Sidebar */
.sidebar {
    width: 300px;
    background-color: #f1f3f4;
    border-right: 1px solid #ddd;
    overflow-y: auto;
}

/* Accordion */
.accordion {
    padding: 1rem 0;
}

.accordion-item {
    border-bottom: 1px solid #e0e0e0;
}

.accordion-header {
    padding: 1rem 1.5rem;
    background-color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #2c5530;
    transition: background-color 0.3s ease;
}

.accordion-header:hover {
    background-color: #f8f9fa;
}

.accordion-icon {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #f9f9f9;
}

.accordion-content.active {
    max-height: 500px;
}

.accordion-content ul {
    list-style: none;
    padding: 0.5rem 0;
}

.accordion-content li {
    margin: 0;
}

.accordion-content a {
    display: block;
    padding: 0.75rem 2rem;
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
}

.accordion-content a:hover {
    background-color: #e9ecef;
    color: #2c5530;
    padding-left: 2.5rem;
}

/* Active recipe styling */
.accordion-content a.active-recipe {
    background-color: #e9ecef !important;
    color: #2c5530 !important;
    font-weight: 600 !important;
    border-radius: 4px;
    margin: 2px 4px;
    padding: 8px 12px !important;
    border-left: 4px solid #4a7c59;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.accordion-content a.active-recipe:hover {
    background-color: #dee2e6 !important;
    padding-left: 12px !important;
    transform: none;
}

/* Content area */
.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

#recipe-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Welcome content */
.welcome-content h2 {
    color: #2c5530;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.welcome-content p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #666;
}

.featured-recipes {
    margin-top: 2rem;
}

.featured-recipes h3 {
    color: #2c5530;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.recipe-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.recipe-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.recipe-card-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.recipe-category-tag {
    background: #4a7c59;
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recipe-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #4a7c59;
}

.recipe-card:hover .recipe-card-image {
    transform: scale(1.02);
}

.recipe-card h4 {
    color: #2c5530;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.recipe-card p {
    color: #666;
    font-size: 0.9rem;
}

/* Recipe content styling */
.recipe-content h1 {
    color: #2c5530;
    margin-bottom: 1rem;
    font-size: 2.2rem;
    border-bottom: 2px solid #4a7c59;
    padding-bottom: 0.5rem;
}

.recipe-content h2 {
    color: #4a7c59;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.recipe-content h3 {
    color: #2c5530;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.recipe-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.recipe-content ul, .recipe-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.recipe-content li {
    margin-bottom: 0.5rem;
}

.recipe-content a {
    color: #4a7c59;
    text-decoration: none;
}

.recipe-content a:hover {
    text-decoration: underline;
}

/* Recipe images */
.recipe-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Video styling */
.video-container {
    text-align: center;
    margin: 2rem 0;
}

.video-container video {
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.video-container figcaption {
    margin-top: 0.5rem;
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
    }
    
    .content-area {
        order: 1;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .recipe-cards {
        grid-template-columns: 1fr;
    }
    
    .content-area {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .accordion-header {
        padding: 0.75rem 1rem;
    }
    
    .accordion-content a {
        padding: 0.5rem 1.5rem;
    }
}

/* Category-specific styles */
.recipe-category {
    background: #4a7c59;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 10px;
    font-weight: 500;
}

.recipe-category-tag {
    background: #e9ecef;
    color: #2c5530;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.category-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4a7c59;
    transition: all 0.3s ease;
}

.category-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.category-card h4 {
    margin: 0 0 10px 0;
    color: #2c5530;
    font-size: 1.1rem;
}

.category-card p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.category-card a {
    display: block;
    color: #007bff;
    text-decoration: none;
    font-size: 13px;
    margin: 2px 0;
    transition: color 0.2s ease;
}

.category-card a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Loading Panel Styles */
.loading-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-width: 300px;
    max-width: 400px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4a7c59;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h3 {
    color: #2c5530;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.loading-content p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a7c59, #2c5530);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    font-size: 0.9rem;
    color: #4a7c59;
    font-weight: 600;
}

/* Hidden state for loading panel */
.loading-panel.hidden {
    display: none;
}
