/* ==========================================
   The AI Morning Read - Main Stylesheet
   ========================================== */

/* CSS Variables */
:root {
    /* Brand Colors */
    --color-gold: #D4A853;
    --color-gold-light: #F4D795;
    --color-gold-dark: #B8892D;
    --color-blue: #1E3A5F;
    --color-blue-light: #2D5A8B;
    --color-blue-dark: #0F1E2F;
    --color-cyan: #4FC3DC;
    --color-cyan-light: #7DD8EB;
    
    /* Neutral Colors */
    --color-white: #FFFFFF;
    --color-gray-50: #F9FAFB;
    --color-gray-100: #F3F4F6;
    --color-gray-200: #E5E7EB;
    --color-gray-300: #D1D5DB;
    --color-gray-400: #9CA3AF;
    --color-gray-500: #6B7280;
    --color-gray-600: #4B5563;
    --color-gray-700: #374151;
    --color-gray-800: #1F2937;
    --color-gray-900: #111827;
    
    /* Platform Colors */
    --color-spotify: #1DB954;
    --color-spotify-dark: #1AA34A;
    --color-apple: #8B5CF6;
    --color-apple-dark: #7C3AED;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ==========================================
   Reset & Base Styles
   ========================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-gray-800);
    background-color: var(--color-gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ==========================================
   Container
   ========================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ==========================================
   Hero Section
   ========================================== */

.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(15, 30, 47, 0.95) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: var(--spacing-2xl);
    margin-top: 10vh;
}

.hero-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.hero-ai {
    font-family: var(--font-display);
    font-size: 6rem;
    font-weight: 400;
    color: var(--color-white);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.1em;
    opacity: 0; /* Will be shown if image doesn't contain text */
}

.hero-subtitle {
    font-family: var(--font-primary);
    font-size: 1.75rem;
    font-weight: 300;
    color: var(--color-white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    opacity: 0; /* Will be shown if image doesn't contain text */
}

.hero-tagline {
    font-size: 1.125rem;
    color: var(--color-white);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    margin-bottom: var(--spacing-xl);
    opacity: 0; /* Hidden as the image has branding */
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ==========================================
   Buttons
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Streaming Platform Badges */
/* Spotify Badge */
.spotify-badge-link {
    display: block;
    transition: all var(--transition-base);
    border-radius: 8px;
    overflow: hidden;
}

.spotify-badge-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.spotify-badge {
    width: 129px; /* Matched to Apple badge width */
    height: 41px; /* Matched to Apple badge height */
    display: block;
    object-fit: contain;
}

/* Apple Badge */
.apple-badge-link {
    display: block;
    transition: all var(--transition-base);
    border-radius: 8px;
    overflow: hidden;
}

.apple-badge-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.apple-badge {
    width: 129px;
    height: 41px;
    display: block;
}

/* Amazon Badge */
.amazon-badge-link {
    display: block;
    transition: all var(--transition-base);
    border-radius: 8px;
    overflow: hidden;
}

.amazon-badge-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.amazon-badge {
    width: 129px;
    height: 41px;
    display: block;
    object-fit: contain;
}

/* Smaller Badge Versions for Episode Cards */
.spotify-badge-link-small {
    display: block;
    transition: all var(--transition-base);
    border-radius: 6px;
    overflow: hidden;
}

.spotify-badge-link-small:hover {
    transform: scale(1.05);
}

.spotify-badge-small {
    width: 90px;
    height: 30px;
    display: block;
    object-fit: contain;
}

.apple-badge-link-small {
    display: block;
    transition: all var(--transition-base);
    border-radius: 6px;
    overflow: hidden;
}

.apple-badge-link-small:hover {
    transform: scale(1.05);
}

.apple-badge-small {
    width: 90px;
    height: 30px;
    display: block;
    object-fit: contain;
}

.amazon-badge-link-small {
    display: block;
    transition: all var(--transition-base);
    border-radius: 6px;
    overflow: hidden;
}

.amazon-badge-link-small:hover {
    transform: scale(1.05);
}

.amazon-badge-small {
    width: 90px;
    height: 30px;
    display: block;
    object-fit: contain;
}

/* Legacy Spotify button - keeping for episode cards */
.btn-spotify {
    background-color: var(--color-spotify);
    color: var(--color-white);
}

.btn-spotify:hover {
    background-color: var(--color-spotify-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-apple {
    background-color: var(--color-apple);
    color: var(--color-white);
}

.btn-apple:hover {
    background-color: var(--color-apple-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-load-more {
    background-color: var(--color-blue);
    color: var(--color-white);
    padding: var(--spacing-md) var(--spacing-2xl);
}

.btn-load-more:hover {
    background-color: var(--color-blue-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-coffee {
    background-color: var(--color-white);
    color: var(--color-gold-dark);
    border: 2px solid var(--color-gold);
}

.btn-coffee:hover {
    background-color: var(--color-gold);
    color: var(--color-white);
}

/* ==========================================
   Episodes Section
   ========================================== */

.episodes-section {
    padding: var(--spacing-3xl) 0;
    background: linear-gradient(to bottom, 
        rgba(15, 30, 47, 0.95) 0%, 
        rgba(30, 58, 95, 0.9) 50%,
        rgba(15, 30, 47, 0.95) 100%
    );
    background-color: var(--color-blue-dark);
}

.section-title {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-white);
    text-align: center;
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.episodes-divider {
    width: 100%;
    max-width: 800px;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--color-gold) 20%, 
        var(--color-cyan) 50%, 
        var(--color-gold) 80%, 
        transparent 100%
    );
    margin: 0 auto var(--spacing-2xl);
    border-radius: var(--radius-full);
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    max-width: 900px;
    margin: 0 auto;
}

/* ==========================================
   Episode Card - Dark Futuristic Theme
   ========================================== */

.episode-card {
    background: rgba(20, 35, 55, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    border: 2px solid var(--color-gold);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(212, 168, 83, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: all var(--transition-base);
}

.episode-card:hover {
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(212, 168, 83, 0.2);
    transform: translateY(-4px);
    border-color: var(--color-gold-light);
}

.episode-header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
}

.episode-infographic {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: linear-gradient(135deg, var(--color-blue-dark) 0%, var(--color-blue) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.episode-infographic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.episode-infographic:hover img {
    transform: scale(1.1);
}

.episode-infographic-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.episode-infographic:hover .episode-infographic-overlay {
    opacity: 1;
}

.episode-infographic-overlay svg {
    width: 28px;
    height: 28px;
    color: var(--color-white);
}

.episode-info {
    flex: 1;
    min-width: 0;
}

.episode-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.episode-date {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.875rem;
    color: var(--color-cyan);
    font-weight: 500;
}

.episode-date svg {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

.episode-number {
    font-size: 0.875rem;
    color: var(--color-gold);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.episode-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-white);
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.episode-description {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.episode-description.expanded {
    -webkit-line-clamp: unset;
}

.episode-read-more {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.8125rem;
    color: var(--color-cyan);
    font-weight: 600;
    margin-top: var(--spacing-sm);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.episode-read-more:hover {
    color: var(--color-cyan-light);
}

.episode-read-more svg {
    width: 14px;
    height: 14px;
    transition: transform var(--transition-fast);
}

.episode-read-more.expanded svg {
    transform: rotate(180deg);
}

/* Episode Footer - Dark Theme */
.episode-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.episode-sources {
    margin-bottom: var(--spacing-md);
    display: none; /* Hide sources in compact view */
}

.sources-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-sm);
}

.sources-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.source-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    transition: color var(--transition-fast);
}

.source-link:hover {
    color: var(--color-cyan);
}

.source-link svg {
    width: 10px;
    height: 10px;
}

.episode-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Badge-style buttons for dark theme */
.btn-episode {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.btn-episode-spotify {
    background-color: var(--color-spotify);
    color: var(--color-white);
}

.btn-episode-spotify:hover {
    background-color: var(--color-spotify-dark);
    transform: scale(1.05);
}

.btn-episode-apple {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-episode-apple:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-episode svg {
    width: 14px;
    height: 14px;
}

/* ==========================================
   Load More
   ========================================== */

.load-more-container {
    text-align: center;
    margin-top: var(--spacing-2xl);
}

/* ==========================================
   Loading Spinner - Dark Theme
   ========================================== */

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl);
    color: rgba(255, 255, 255, 0.6);
}

.loading-spinner p {
    color: rgba(255, 255, 255, 0.6);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--color-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   Support Section - Dark Theme
   ========================================== */

.support-section {
    padding: var(--spacing-2xl) 0 var(--spacing-3xl);
    background: linear-gradient(to bottom, 
        rgba(15, 30, 47, 0.95) 0%,
        var(--color-blue-dark) 100%
    );
}

.support-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, 
        rgba(212, 168, 83, 0.2) 0%, 
        rgba(184, 137, 45, 0.3) 100%
    );
    border: 2px solid var(--color-gold);
    border-radius: var(--radius-xl);
    color: var(--color-white);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.support-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background-color: rgba(212, 168, 83, 0.3);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-icon svg {
    width: 32px;
    height: 32px;
    color: var(--color-gold-light);
}

.support-content {
    flex: 1;
}

.support-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--color-gold-light);
}

.support-text {
    font-size: 0.9375rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.8);
}

/* ==========================================
   Footer - Dark Theme
   ========================================== */

.footer {
    background-color: var(--color-blue-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--spacing-lg) 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
}

.footer-links {
    display: flex;
    gap: var(--spacing-lg);
}

.footer-links a {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-gold);
}

/* ==========================================
   Modal
   ========================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
    animation: modalSlideIn var(--transition-base);
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    transition: background-color var(--transition-fast);
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

.modal-image {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

/* Player Modal */
.player-modal .modal-content {
    width: 100%;
    max-width: 600px;
}

.player-content {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
}

.spotify-player-container {
    width: 100%;
}

.spotify-player-container iframe {
    width: 100%;
    border-radius: var(--radius-md);
}

/* ==========================================
   Utility Classes
   ========================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.mb-0 {
    margin-bottom: 0;
}
