/**
 * ============================================================================
 * RESTAURANT OWNERS UNCORKED - STYLESHEET
 * ============================================================================
 * 
 * This stylesheet contains all visual styling for the podcast website.
 * It follows a mobile-first, responsive design approach with clean,
 * modern aesthetics aligned with Schedulefly's brand guidelines.
 * 
 * ORGANIZATION:
 * 1. CSS Variables (Brand Colors)
 * 2. Reset & Base Styles
 * 3. Layout Components (Container, Header, Hero, etc.)
 * 4. Episode Components (Cards, Player)
 * 5. Interactive Elements (Buttons, Filters, Forms)
 * 6. Responsive Media Queries
 * 7. Utility Classes
 * 
 * DESIGN PRINCIPLES:
 * - Consistent spacing using rem units
 * - Smooth transitions for interactivity
 * - Mobile-first responsive breakpoints
 * - Accessibility-friendly focus states
 * - Brand color consistency throughout
 * 
 * BREAKPOINTS:
 * - Mobile: < 768px
 * - Tablet: 768px - 1024px
 * - Desktop: > 1024px
 * 
 * AUTHOR: Schedulefly Team
 * LAST UPDATED: 2025
 * ============================================================================
 */

/* ============================================================================
   CSS CUSTOM PROPERTIES (CSS VARIABLES)
   ============================================================================
   Brand colors and reusable values defined as CSS variables for
   consistency and easy theming across the entire application.
============================================================================ */

:root {
    /* Primary Brand Colors - Schedulefly Blue Theme */
    --primary: #009bd7;        /* Main brand blue - used for buttons, links, accents */
    --primary-dark: #1977cc;   /* Darker blue - hover states, emphasis */
    --primary-light: #33b3e6;  /* Light blue - subtle backgrounds, borders */
    
    /* Text Colors */
    --heading: #2c4964;        /* Navy blue - section headings */
    --text-primary: #444444;   /* Dark gray - body text */
    --text-secondary: #6c757d; /* Medium gray - secondary text, metadata */
    
    /* Background Colors */
    --bg-light: #f8f9fa;       /* Light gray - section backgrounds */
    --white: #ffffff;          /* Pure white - cards, header */
}

/* ============================================================================
   RESET AND BASE STYLES
   ============================================================================
   Normalize browser defaults and establish consistent base styling
============================================================================ */

/**
 * Universal box-sizing reset
 * Makes width/height calculations include padding and border
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/**
 * Body styles
 * Sets default font, line-height, and colors for entire page
 */
body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #ffffff;
}

/**
 * Container utility
 * Centers content and sets max-width for readability
 * Used throughout the site for consistent content width
 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================================
   HEADER COMPONENT
   ============================================================================
   Sticky navigation header with logo and action buttons.
   Stays visible at top of viewport during scroll.
============================================================================ */

.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
}

.logo-placeholder {
    width: 60px;
    height: 60px;
    background: transparent;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.logo-text p {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

.subscribe-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subscribe-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 155, 215, 0.3);
}

.partner-btn {
    background: var(--heading);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.partner-btn:hover {
    background: #1d4a5c;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(44, 73, 100, 0.3);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* ============================================================================
   HERO SECTION
   ============================================================================
   Primary banner with gradient background, statistics, and carousel.
   Features Schedulefly brand colors and eye-catching design.
============================================================================ */

.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0;
}

.hero-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-text h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-text p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/**
 * Hero image carousel
 * Auto-rotating image slideshow with fade transitions
 */
.hero-carousel {
    position: relative;
    width: 100%;
    max-width: 600px;
    min-height: 400px;
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    border-radius: 15px;
}

/* ============================================================================
   LATEST EPISODE SECTION
   ============================================================================
   Featured section highlighting the most recent podcast episode
============================================================================ */

.latest-episode {
    padding: 4rem 0;
    background: white;
}

.latest-episode h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--heading);
}

/* ============================================================================
   REVIEWS SECTION
   ============================================================================
   Social proof section with customer testimonials and ratings.
   Grid layout with hover effects for engagement.
============================================================================ */

.reviews-section {
    padding: 4rem 0;
    background: var(--bg-light);
    border-top: 3px solid var(--primary);
    border-bottom: 3px solid var(--primary);
}

.reviews-section h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--heading);
}

.reviews-intro {
    text-align: center;
    font-size: 1.125rem;
    color: #666;
    margin-bottom: 3rem;
    font-style: italic;
}

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

.review-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.review-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 155, 215, 0.15);
    border-color: var(--primary);
}

.review-stars {
    color: #FFC107;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.review-text {
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.review-author {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 1rem;
    border-top: 2px solid #f0f0f0;
}

.review-author strong {
    color: #1a1a1a;
    font-size: 0.95rem;
}

.review-author span {
    color: #666;
    font-size: 0.85rem;
}

/* ============================================================================
   EPISODES SECTION
   ============================================================================
   Main content area with episode listings, search, filters, and sorting.
   Dynamic grid layout populated via JavaScript.
============================================================================ */

.episodes {
    padding: 4rem 0;
    background: #fafafa;
}

.episodes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.episodes-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--heading);
}

.episodes-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: #666;
}

.search-box input {
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.875rem;
    width: 250px;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

#sort-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}

/**
 * Category filter buttons
 * Pill-shaped buttons for filtering episodes by topic
 */
.category-filters {
    display: flex;
    gap: 0.75rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    background: white;
    color: #666;
    border: 2px solid #e1e5e9;
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 155, 215, 0.3);
}

.filter-btn i {
    font-size: 0.9rem;
}

/**
 * Episodes grid container
 * Responsive grid that adjusts column count based on screen size
 */
.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/**
 * Individual episode card
 * Contains episode metadata, description, and play button
 * Includes hover effects for interactivity
 */
.episode-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #e1e5e9;
}

.episode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.episode-card.featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
    background: var(--bg-light);
    border: 2px solid var(--primary);
}

.episode-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.episode-number {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.episode-date {
    color: #666;
    font-size: 0.875rem;
}

.episode-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    color: #1a1a1a;
}

.episode-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.episode-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.episode-duration {
    color: #666;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.play-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.play-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* ============================================================================
   AUDIO PLAYER
   ============================================================================
   Fixed bottom player with playback controls and progress bar.
   Slides up from bottom when episode is played.
============================================================================ */

.audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e1e5e9;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.audio-player.hidden {
    transform: translateY(100%);
}

.player-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-artwork {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.player-text h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #1a1a1a;
}

.player-text p {
    font-size: 0.8rem;
    color: #666;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.play-btn, .close-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn {
    background: #dc3545;
}

.play-btn:hover, .close-btn:hover {
    transform: scale(1.1);
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: #e1e5e9;
    border-radius: 2px;
    cursor: pointer;
}

.progress {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.1s ease;
}

#current-time, #duration {
    font-size: 0.8rem;
    color: #666;
    min-width: 40px;
}

/**
 * Loading spinner indicator
 * Displayed while fetching episode data from API
 */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

/* ============================================================================
   FOOTER
   ============================================================================
   Site footer with about info, links, and subscription options.
   Dark background with multi-column layout.
============================================================================ */

.footer {
    background: #1a1a1a;
    color: white;
    padding: 3rem 0 1rem;
}

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

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section p {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.social-links a {
    color: #ccc;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary);
}

.subscribe-footer-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.subscribe-footer-btn:hover {
    background: var(--primary-dark);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #333;
    color: #999;
}

.footer-image {
    margin-top: 1.5rem;
}

.footer-accent-image {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-accent-image:hover {
    opacity: 1;
}

/* ============================================================================
   RESPONSIVE DESIGN - TABLET & MOBILE
   ============================================================================
   Media queries for responsive layout adjustments.
   Breakpoint: 768px (tablets and smaller)
============================================================================ */

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-carousel {
        max-width: 400px;
        min-height: 300px;
        margin: 0 auto;
    }
    
    .hero-text h2 {
        font-size: 2rem;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .episodes-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .episodes-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .reviews-grid {
        grid-template-columns: 1fr;
    }
    
    .category-filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        font-size: 0.75rem;
        padding: 0.6rem 1rem;
    }
    
    .episodes-grid {
        grid-template-columns: 1fr;
    }
    
    .episode-card.featured {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .player-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .progress-container {
        min-width: auto;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/**
 * Mobile-specific styles
 * Breakpoint: 480px (small mobile devices)
 */
@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }
    
    .hero-text h2 {
        font-size: 1.75rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .episodes, .latest-episode {
        padding: 2rem 0;
    }
    
    .episode-card {
        padding: 1rem;
    }
    
    .player-info {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================
   Reusable helper classes for common styling needs
============================================================================ */

/**
 * Hide element completely
 */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
