/**
 * Masterclass/Netflix-Inspired Community Interface
 * Modern, clean, scrollable content sections
 */

:root {
    --primary-color: #436E67;
    --dark-bg: #0b0e11;
    --card-bg: #1a1d23;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --hover-bg: #2a2d35;
    --overlay-gradient: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0) 100%);
}

.masterclass-page {
    background-color: var(--dark-bg);
    min-height: 100vh;
    color: var(--text-primary);
}

/* ============================================
   HERO SECTION
============================================ */
.hero-section {
    position: relative;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    margin-top: 0;
    padding-top: 72px; /* Account for fixed navbar */
}

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

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

.hero-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top,
        var(--dark-bg) 0%,
        rgba(11, 14, 17, 0.8) 20%,
        rgba(11, 14, 17, 0.4) 50%,
        rgba(11, 14, 17, 0) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem 0;
}

.hero-title {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem auto; /* Center the subtitle */
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center; /* Center the stats */
    max-width: 800px;
    margin: 0 auto;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.575rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 110, 103, 0.3);
    color: var(--text-primary);
    text-decoration: none;
}

.stat-item i {
    font-size: 1.125rem;
    color: var(--primary-color);
}

.stat-item span {
    white-space: nowrap;
}

/* ============================================
   SEARCH BAR
============================================ */
.search-bar-wrapper {
    position: relative;
    z-index: 3;
    padding: 0 0 3rem 0;
}

.search-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: stretch;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    min-height: 48px;
}

.search-input-group:focus-within {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(67, 110, 103, 0.3);
}

.search-icon {
    position: absolute;
    left: 20px;
    font-size: 1.125rem;
    color: var(--text-secondary);
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
}

.search-input {
    flex: 1;
    padding: 0.875rem 1.25rem 0.875rem 3.25rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9375rem;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-button {
    padding: 0.875rem 2rem;
    background-color: var(--primary-color);
    color: var(--text-primary);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-button:hover {
    background-color: #528d84;
    transform: translateX(2px);
}

/* ============================================
   QUICK ACCESS CARDS
============================================ */
.quick-access-section {
    padding: 3rem 0;
    background-color: var(--dark-bg);
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.quick-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.2rem 1.2rem;
    background-color: var(--card-bg);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.quick-card:hover {
    background-color: var(--hover-bg);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
    color: var(--text-primary);
    text-decoration: none;
}

.quick-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), #528d84);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quick-card-icon i {
    font-size: 1.5rem;
    color: white;
}

.quick-card-content {
    flex: 1;
}

.quick-card-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.quick-card-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.quick-card-arrow {
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.quick-card:hover .quick-card-arrow {
    transform: translateX(4px);
    color: var(--primary-color);
}

/* ============================================
   SCROLLABLE CONTENT ROWS
============================================ */
.content-row-section {
    padding: 3rem 0;
    background-color: var(--dark-bg);
}

.row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 20px;
}

.row-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.row-view-all {
    font-size: 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.row-view-all:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.scrollable-row-wrapper {
    position: relative;
    padding: 0 20px;
}

.scrollable-row {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 1rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.scrollable-row::-webkit-scrollbar {
    height: 8px;
}

.scrollable-row::-webkit-scrollbar-track {
    background: transparent;
}

.scrollable-row::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.scrollable-row::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Scroll Buttons */
.scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: all 0.3s ease;
}

.scrollable-row-wrapper:hover .scroll-button {
    opacity: 1;
}

.scroll-button:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.scroll-left {
    left: 10px;
}

.scroll-right {
    right: 10px;
}

/* ============================================
   MASTERCLASS CARD
============================================ */
.masterclass-card {
    min-width: 320px;
    max-width: 320px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

/* Remove max-width constraint in grid layouts */
.posts-grid .masterclass-card {
    max-width: 100%;
    min-width: auto;
    width: 100%;
}

.masterclass-card:hover {
    transform: scale(1.05);
    z-index: 5;
}

.card-link {
    display: block;
    text-decoration: none;
    color: var(--text-primary);
}

.card-link:hover {
    text-decoration: none;
    color: var(--text-primary);
}

.card-image-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background-color: var(--card-bg);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.masterclass-card:hover .card-image {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

/* Badges always visible at top */
.card-badges {
    position: absolute;
    top: 6px;
    right: 8px;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    z-index: 2;
}

.badge {
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-purchased {
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    font-size: 10px;
}

.badge-free {
    background-color: #4CAF50;
    color: white;
    font-size: 10px;
}

.badge-premium {
    background-color: rgba(0, 0, 0, 0.85);
    color: #ffffff;
}

/* Play button only visible on hover, centered */
.card-play-button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
    pointer-events: all;
}

.card-play-button i {
    font-size: 1.25rem;
    color: #ffffff;
    margin-left: 3px;
}

.masterclass-card:hover .card-play-button {
    opacity: 1;
    transform: scale(1);
    background-color: rgba(0, 0, 0, 0.95);
}

.masterclass-card:hover .card-play-button i {
    color: white;
}

.card-content {
    padding: 1rem 0.25rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.card-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.card-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.category-tag {
    font-size: 0.75rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.card-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.price-original {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.price-current {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================
   SOCIAL SECTION
============================================ */
.social-section {
    padding: 4rem 0 6rem;
    background-color: var(--dark-bg);
}

.social-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.social-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background-color: var(--card-bg);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.social-card i {
    font-size: 2rem;
}

.social-card div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.social-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.social-count {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.social-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    color: var(--text-primary);
}

.social-card.instagram:hover {
    border-color: #E1306C;
}

.social-card.instagram:hover i {
    color: #E1306C;
}

.social-card.youtube:hover {
    border-color: #FF0000;
}

.social-card.youtube:hover i {
    color: #FF0000;
}

.social-card.tiktok:hover {
    border-color: #000000;
}

.social-card.tiktok:hover i {
    color: #FE2C55;
}

.social-card.facebook:hover {
    border-color: #1877F2;
}

.social-card.facebook:hover i {
    color: #1877F2;
}

.social-card.twitter:hover {
    border-color: #1DA1F2;
}

.social-card.twitter:hover i {
    color: #1DA1F2;
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 768px) {
    .row-header {
        padding: 0 5px;
    }

    .scrollable-row-wrapper {
        padding: 0 5px;
    }

    .hero-section {
        height: auto;
        min-height: 500px;
        padding-bottom: 2rem;
    }
    
    .hero-content {
        padding-bottom: 1.5rem;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-stats {
        gap: 0.5rem;
        margin-bottom: 2rem;
    }
    
    .stat-item {
        font-size: 0.75rem;
        padding: 0.5rem 0.875rem;
        gap: 0.5rem;
        flex: 1 1 auto;
        min-width: calc(33.333% - 0.35rem);
        justify-content: center;
    }
    
    .stat-item i {
        font-size: 0.875rem;
    }
    
    .stat-item span {
        font-size: 0.75rem;
    }
    
    .search-bar-wrapper {
        padding: 0 1rem 2rem 1rem;
    }
    
    .search-input-group {
        min-height: 44px;
        flex-wrap: wrap;
    }
    
    .search-input {
        padding: 0.75rem 1rem 0.75rem 2.75rem;
        font-size: 0.875rem;
        min-width: 0;
    }
    
    .search-icon {
        left: 16px;
        font-size: 1rem;
    }
    
    .search-button {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .quick-access-grid {
        grid-template-columns: 1fr;
    }
    
    .row-title {
        font-size: 1.2rem;
    }
    
    .scrollable-row .masterclass-card {
        min-width: 280px;
        max-width: 280px;
    }
    
    .scroll-button {
        display: none;
    }
    
    .social-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-section {
        min-height: 450px;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        gap: 0.375rem;
        flex-direction: row;
        width: 100%;
        padding: 0 0.5rem;
    }
    
    .stat-item {
        font-size: 0.6875rem;
        padding: 0.5rem 0.5rem;
        gap: 0.375rem;
        flex: 1;
        min-width: 0;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-item i {
        font-size: 1rem;
        margin-bottom: 0.125rem;
    }
    
    .stat-item span {
        font-size: 0.8rem;
        line-height: 1.2;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .stat-count {
        font-size: 1.125rem;
        font-weight: 700;
        display: block;
        line-height: 1;
    }
    
    .stat-label {
        font-size: 0.625rem;
        opacity: 0.8;
        display: block;
    }
    
    .stat-item {
        font-size: 0.8125rem;
        padding: 0.55rem 0.95rem;
        border-radius: 17px;
    }
    
    .stat-item i {
        font-size: 1rem;
    }
    
    .scrollable-row .masterclass-card {
        min-width: 240px;
        max-width: 240px;
    }
    
    .card-title {
        font-size: 1rem;
    }
}

/* ============================================
   CATEGORY PAGE SPECIFIC STYLES
   ============================================ */

/* Category-specific hero adjustments */
.category-page .hero-section {
    min-height: 50vh;
}

.category-page .category-back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
    margin-bottom: 1.5rem;
}

.category-page .category-back-link:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.category-page .category-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.category-page .hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Filter and Sort Bar */
.filter-sort-bar {
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.filter-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    text-decoration: none;
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.filter-count {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.filter-btn.active .filter-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Sort Dropdown */
.sort-dropdown {
    position: relative;
}

.sort-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-right: 0.75rem;
}

.sort-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    transition: all 0.3s ease;
}

.sort-select:hover,
.sort-select:focus {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    outline: none;
}

.sort-select option {
    background: #1a1d23;
    color: var(--text-primary);
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Tablet breakpoint - prevent overlap */
@media (max-width: 991px) {
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.25rem;
    }
}

/* Small tablet - 2 columns max or 1 if too narrow */
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.25rem;
    }
}

/* Mobile - always single column, full width */
@media (max-width: 576px) {
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 0;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.reset-filters-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.reset-filters-btn:hover {
    background: #5a9a90;
    transform: translateY(-1px);
    text-decoration: none;
    color: white;
}

/* Responsive adjustments for category page */
@media (max-width: 768px) {
    .category-page .hero-section {
        min-height: 45vh;
    }
    
    .category-page .category-title {
        font-size: 2rem;
    }
    
    .filter-sort-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sort-dropdown {
        width: 100%;
    }
    
    .sort-select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .category-page .hero-section {
        min-height: 40vh;
    }
    
    .category-page .category-title {
        font-size: 1.75rem;
    }
}


.social-card:before {
    content: none !important;
}