/* Categories Page Styles */

/* Hero Section */
.categories-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.categories-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1.5" fill="rgba(255,255,255,0.05)"/><circle cx="50" cy="10" r="1" fill="rgba(255,255,255,0.08)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.categories-hero .hero-content {
    position: relative;
    z-index: 2;
}

.categories-hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.categories-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Filter Tabs */
.filter-tabs-section {
    background: white;
    padding: 30px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Search Container */
.search-container {
    margin-bottom: 40px;
    text-align: center;
}

.search-bar {
    display: inline-flex;
    max-width: 500px;
    width: 100%;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.search-input {
    flex: 1;
    padding: 15px 25px;
    border: none;
    font-size: 1rem;
    outline: none;
}

.search-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #5a67d8;
}

/* Categories Grid */
.categories-grid-section {
    padding: 60px 0;
    background: #f8f9fa;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 10px;
}

.section-header p {
    color: #666;
    font-size: 1.1rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.category-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.category-header {
    padding: 30px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.category-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.category-count {
    font-size: 0.9rem;
    opacity: 0.8;
}

.category-body {
    padding: 25px;
}

.category-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.category-tag {
    background: #f1f3f4;
    color: #666;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.category-actions {
    display: flex;
    gap: 10px;
}

.btn-view-recipes {
    flex: 1;
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.btn-view-recipes:hover {
    background: #5a67d8;
}

.btn-explore {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-explore:hover {
    background: #667eea;
    color: white;
}

/* Popular Categories */
.popular-categories-section {
    padding: 60px 0;
    background: white;
}

.popular-categories-section h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 50px;
}

.popular-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.popular-category-card {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.popular-category-card:hover {
    transform: scale(1.05);
}

.popular-category-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.popular-category-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.popular-category-count {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Featured by Category */
.featured-by-category {
    padding: 60px 0;
    background: #f8f9fa;
}

.featured-by-category h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 50px;
}

.category-showcase {
    display: grid;
    gap: 40px;
}

.category-showcase-item {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.showcase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.showcase-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.showcase-icon {
    font-size: 2rem;
}

.showcase-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.showcase-count {
    color: #666;
    font-size: 1rem;
}

.showcase-recipes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.showcase-recipe-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.showcase-recipe-card:hover {
    background: #e9ecef;
}

.showcase-recipe-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.showcase-recipe-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.showcase-recipe-info p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

/* Loading and No Results */
.loading-state, .no-results {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 10px;
}

.no-results p {
    color: #666;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .categories-hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 30px;
    }
    
    .filter-tabs {
        gap: 10px;
    }
    
    .tab-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .categories-grid .category-card {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .categories-grid .category-actions {
        margin-top: auto;
        padding: 0 10px 10px 10px;
    }
    
    .categories-grid .category-image {
        height: 100px;
    }
    
    .categories-grid .category-content {
        padding: 10px;
    }
    
    .categories-grid .category-title {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    .categories-grid .category-description {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    .btn-explore {
        display: none; /* 移动端隐藏 explore 按钮 */
    }
    
    .showcase-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .showcase-recipes {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .categories-hero {
        padding: 80px 0 60px;
    }
    
    .categories-hero h1 {
        font-size: 2rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .popular-categories {
        grid-template-columns: repeat(2, 1fr);
    }
}