/**
 * Catalog Widget - Modern Apple TV/Netflix Style
 * All styles are scoped to .style-modern to avoid conflicts
 */

/* Variables - Customizable via Elementor */
.cda-tv-catalog-container.style-modern {
    --cda-tv-bg-primary: #004077;
    --cda-tv-bg-secondary: #00407722;
    --cda-tv-bg-tertiary: #00407733;
    --cda-tv-text-primary: #ffffff;
    --cda-tv-text-secondary: #a0c4e7;
    --cda-tv-text-tertiary: #6f9fc7;
    --cda-tv-accent: #e50914;
    --cda-tv-accent-hover: #f40612;
    --cda-tv-card-hover: rgba(255,255,255,0.1);
    --cda-tv-border-color: rgba(255,255,255,0.2);
    --cda-tv-shadow: 0 8px 24px rgba(0,32,64,0.8);
    --cda-tv-shadow-hover: 0 12px 32px rgba(0,32,64,0.9);
    
    /* Frost Glass Effect */
    --cda-tv-frost-bg: rgba(255, 255, 255, 0.05);
    --cda-tv-frost-border: rgba(255, 255, 255, 0.1);
    --cda-tv-frost-blur: blur(20px);
    --cda-tv-frost-saturate: saturate(180%);
}

/* Dark theme variant */
.cda-tv-catalog-container.dark-theme {
    --cda-tv-bg-primary: #0a0a0a;
    --cda-tv-bg-secondary: #141414;
    --cda-tv-bg-tertiary: #1a1a1a;
    --cda-tv-text-secondary: #a0a0a0;
    --cda-tv-text-tertiary: #6f6f6f;
    --cda-tv-border-color: rgba(255,255,255,0.1);
}

/* Container - Dark Cinematic Theme */
.cda-tv-catalog-container.style-modern {
    position: relative;
    background: var(--cda-tv-bg-primary);
    color: var(--cda-tv-text-primary);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Frost Glass Components */
.cda-tv-catalog-container.style-modern .cda-tv-frost-panel {
    background: var(--cda-tv-frost-bg);
    backdrop-filter: var(--cda-tv-frost-blur) var(--cda-tv-frost-saturate);
    -webkit-backdrop-filter: var(--cda-tv-frost-blur) var(--cda-tv-frost-saturate);
    border: 1px solid var(--cda-tv-frost-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Header with Frost Effect */
.cda-tv-catalog-container.style-modern .cda-tv-catalog-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--cda-tv-frost-bg);
    backdrop-filter: var(--cda-tv-frost-blur) var(--cda-tv-frost-saturate);
    -webkit-backdrop-filter: var(--cda-tv-frost-blur) var(--cda-tv-frost-saturate);
    border-bottom: 1px solid var(--cda-tv-frost-border);
    padding: 20px 5%;
    transition: all 0.3s ease;
}

/* Modern Breadcrumb */
.cda-tv-catalog-container.style-modern .cda-tv-catalog-breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 14px;
    flex-wrap: wrap;
}

.cda-tv-catalog-container.style-modern .cda-tv-catalog-breadcrumb a {
    color: var(--cda-tv-text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    padding: 4px 8px;
    border-radius: 6px;
}

.cda-tv-catalog-container.style-modern .cda-tv-catalog-breadcrumb a:hover {
    color: var(--cda-tv-text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.cda-tv-catalog-breadcrumb .separator {
    color: var(--cda-tv-text-tertiary);
    font-size: 18px;
    line-height: 1;
}

.cda-tv-catalog-breadcrumb .current {
    color: var(--cda-tv-text-primary);
    font-weight: 500;
}

/* Hero Section for Featured Content */
.cda-tv-featured-hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    margin-bottom: 40px;
    overflow: hidden;
    background: linear-gradient(to bottom, transparent, var(--cda-tv-bg-primary));
}

.cda-tv-featured-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, transparent 60%);
    z-index: 1;
}

.cda-tv-featured-content {
    position: absolute;
    bottom: 15%;
    left: 5%;
    max-width: 600px;
    z-index: 2;
}

.cda-tv-featured-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.cda-tv-featured-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--cda-tv-text-secondary);
}

.cda-tv-featured-description {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 30px;
    color: var(--cda-tv-text-secondary);
}

.cda-tv-featured-actions {
    display: flex;
    gap: 15px;
}

.cda-tv-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.cda-tv-btn-primary {
    background: var(--cda-tv-accent);
    color: white;
}

.cda-tv-btn-primary:hover {
    background: var(--cda-tv-accent-hover);
    transform: scale(1.05);
}

.cda-tv-btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.cda-tv-btn-secondary:hover {
    background: rgba(255,255,255,0.3);
}

/* Navigation Pills */
.cda-tv-nav-pills {
    display: flex;
    gap: 20px;
    padding: 0 5%;
    margin-bottom: 40px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cda-tv-nav-pills::-webkit-scrollbar {
    display: none;
}

.cda-tv-nav-pill {
    padding: 10px 20px;
    background: var(--cda-tv-bg-tertiary);
    color: var(--cda-tv-text-secondary);
    border-radius: 25px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.cda-tv-nav-pill:hover {
    background: var(--cda-tv-card-hover);
    color: var(--cda-tv-text-primary);
}

.cda-tv-nav-pill.active {
    background: var(--cda-tv-accent);
    color: white;
}

/* Content Sections */
.cda-tv-section {
    padding: 0 5%;
    margin-bottom: 60px;
}

.cda-tv-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cda-tv-section-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.cda-tv-see-all {
    color: var(--cda-tv-text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.cda-tv-see-all:hover {
    color: var(--cda-tv-text-primary);
}

/* Card Grid - Netflix Style */
.cda-tv-cards-container {
    position: relative;
}

.cda-tv-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    transition: transform 0.3s ease;
}

@media (min-width: 768px) {
    .cda-tv-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (min-width: 1200px) {
    .cda-tv-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Card Hover Effects with Frost Glass */
.cda-tv-card {
    position: relative;
    background: var(--cda-tv-frost-bg);
    backdrop-filter: var(--cda-tv-frost-blur) var(--cda-tv-frost-saturate);
    -webkit-backdrop-filter: var(--cda-tv-frost-blur) var(--cda-tv-frost-saturate);
    border: 1px solid var(--cda-tv-frost-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cda-tv-card:hover {
    transform: scale(1.05) translateY(-10px);
    box-shadow: var(--cda-tv-shadow-hover);
    z-index: 10;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.cda-tv-card-thumb {
    position: relative;
    padding-bottom: 56.25%;
    overflow: hidden;
    background: var(--cda-tv-bg-secondary);
}

.cda-tv-card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cda-tv-card:hover .cda-tv-card-thumb img {
    transform: scale(1.1);
}

/* Card Overlay */
.cda-tv-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cda-tv-card:hover .cda-tv-card-overlay {
    opacity: 1;
}

/* Card Content */
.cda-tv-card-content {
    padding: 15px;
}

.cda-tv-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cda-tv-card-meta {
    font-size: 13px;
    color: var(--cda-tv-text-secondary);
    display: flex;
    gap: 10px;
}

/* Expanded Card Info on Hover */
.cda-tv-card-expanded {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cda-tv-bg-secondary);
    padding: 20px;
    border-radius: 0 0 8px 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 20;
}

.cda-tv-card:hover .cda-tv-card-expanded {
    opacity: 1;
    visibility: visible;
}

.cda-tv-card-description {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    color: var(--cda-tv-text-secondary);
}

.cda-tv-card-actions {
    display: flex;
    gap: 10px;
}

.cda-tv-card-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--cda-tv-border-color);
    background: transparent;
    color: var(--cda-tv-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cda-tv-card-btn:hover {
    background: var(--cda-tv-card-hover);
    border-color: var(--cda-tv-text-primary);
}

/* Loading States */
.cda-tv-skeleton {
    background: linear-gradient(90deg, var(--cda-tv-bg-tertiary) 25%, var(--cda-tv-bg-secondary) 50%, var(--cda-tv-bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Search Bar - Modern Style */
.cda-tv-search-container {
    position: relative;
    max-width: 600px;
    margin: 40px auto;
    padding: 0 5%;
}

.cda-tv-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.cda-tv-search-icon {
    position: absolute;
    left: 20px;
    color: var(--cda-tv-text-secondary);
    pointer-events: none;
}

.cda-tv-search-input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    background: var(--cda-tv-bg-tertiary);
    border: 1px solid var(--cda-tv-border-color);
    border-radius: 8px;
    color: var(--cda-tv-text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.cda-tv-search-input:focus {
    outline: none;
    border-color: var(--cda-tv-accent);
    background: var(--cda-tv-bg-secondary);
}

.cda-tv-search-input::placeholder {
    color: var(--cda-tv-text-tertiary);
}

/* Filter Bar */
.cda-tv-filter-bar {
    display: flex;
    gap: 15px;
    padding: 0 5%;
    margin-bottom: 30px;
    overflow-x: auto;
}

.cda-tv-filter-select {
    padding: 10px 15px;
    background: var(--cda-tv-bg-tertiary);
    border: 1px solid var(--cda-tv-border-color);
    border-radius: 6px;
    color: var(--cda-tv-text-primary);
    font-size: 14px;
    min-width: 150px;
    transition: all 0.3s ease;
}

.cda-tv-filter-select:focus {
    outline: none;
    border-color: var(--cda-tv-accent);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .cda-tv-featured-hero {
        height: 50vh;
        min-height: 400px;
    }
    
    .cda-tv-featured-content {
        left: 5%;
        right: 5%;
        max-width: none;
    }
    
    .cda-tv-featured-title {
        font-size: 2rem;
    }
    
    .cda-tv-featured-description {
        font-size: 16px;
    }
    
    .cda-tv-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .cda-tv-card:hover {
        transform: scale(1.02);
    }
}

/* Animations */
.cda-tv-fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cda-tv-slide-in {
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}
