/* MySF Shortform Mobile Feed Styles */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Noto+Sans+KR:wght@300;400;700&display=swap');

:root {
    --sf-primary: #ff3366;
    --sf-primary-glow: rgba(255, 51, 102, 0.4);
    --sf-bg: #090F25;
    --sf-card-bg: #131d45;
    --sf-text: #ffffff;
    --sf-text-muted: #a0a0b0;
    --sf-overlay-bg: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0) 100%);
    --sf-top-overlay-bg: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    --sf-font: 'Outfit', 'Noto Sans KR', sans-serif;
}

/* Base Container */
.sf-platform-container {
    width: 100%;
    min-height: 100vh;
    background-color: var(--sf-bg);
    color: var(--sf-text);
    font-family: var(--sf-font);
    overflow-x: hidden;
    position: relative;
}

/* ==========================================================================
   1. Portal View (Catalog) Styles
   ========================================================================== */

/* Header */
.sf-portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(15, 15, 20, 0.95);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.sf-portal-logo {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(to right, #ff3366, #ff6699);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.sf-portal-profile span.dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: var(--sf-text-muted);
    cursor: pointer;
    transition: color 0.2s;
}
.sf-portal-profile span.dashicons:hover {
    color: var(--sf-primary);
}

/* Hero Banner */
.sf-hero-banner {
    height: 380px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 30px 20px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sf-hero-content {
    max-width: 600px;
    z-index: 2;
}

.sf-hero-tag {
    display: inline-block;
    background-color: var(--sf-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    box-shadow: 0 0 12px var(--sf-primary-glow);
}

.sf-hero-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    letter-spacing: -1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
    line-height: 1.2;
}

.sf-hero-desc {
    font-size: 14px;
    color: var(--sf-text-muted);
    margin: 0 0 20px 0;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.sf-btn-play-now {
    background: linear-gradient(135deg, var(--sf-primary) 0%, #d53f8c 100%);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px var(--sf-primary-glow);
    transition: all 0.2s ease;
}

.sf-btn-play-now span.dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.sf-btn-play-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--sf-primary-glow);
}

.sf-btn-play-now:active {
    transform: translateY(0);
}

/* Portal Catalog Section */
.sf-portal-content {
    padding: 0 20px 40px;
}

.sf-section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 18px 0;
    letter-spacing: -0.5px;
    border-left: 4px solid var(--sf-primary);
    padding-left: 10px;
}

.sf-series-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sf-series-card {
    background-color: var(--sf-card-bg);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.25s ease;
}

.sf-series-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 51, 102, 0.3);
}

.sf-series-cover {
    width: 120px;
    min-width: 120px;
    height: 170px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.sf-series-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #ffd700;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.sf-series-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.sf-series-name {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px 0;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sf-series-desc {
    font-size: 12px;
    color: var(--sf-text-muted);
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Episode Quick Chips */
.sf-episodes-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
}

/* Custom scrollbar for episode list */
.sf-episodes-list::-webkit-scrollbar {
    height: 3px;
}
.sf-episodes-list::-webkit-scrollbar-track {
    background: transparent;
}
.sf-episodes-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sf-ep-chip {
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    min-width: 50px;
    flex-shrink: 0;
    transition: background-color 0.2s, border-color 0.2s;
    border: 1px solid transparent;
}

.sf-ep-chip:hover {
    background-color: rgba(255, 51, 102, 0.15);
    border-color: rgba(255, 51, 102, 0.3);
}

.sf-ep-chip .ep-num {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.sf-ep-chip .ep-badge {
    font-size: 9px;
    font-weight: 700;
}

.sf-ep-chip .ep-badge.free {
    color: var(--sf-primary);
}

.sf-ep-chip .ep-badge.vip {
    color: #ffd700;
}

.sf-no-ep, .sf-no-data {
    font-size: 12px;
    color: var(--sf-text-muted);
    font-style: italic;
}


/* ==========================================================================
   2. Full Screen Player Overlay Styles
   ========================================================================== */

/* Overlapping configuration: starts at bottom and slides up when active */
.sf-player-overlay-view {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: #000 !important;
    z-index: 99999 !important;
    overflow: hidden !important;
    transform: translateY(100%); /* 아래 숨김 상태 */
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1); /* 프리미엄 느낌의 가속도 효과 */
    pointer-events: none;
}

.sf-player-overlay-view.active {
    transform: translateY(0); /* 노출 상태 */
    pointer-events: auto;
}

/* Close/Back Nav Bar on Player */
.sf-player-nav-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 24px 20px;
    z-index: 100;
    pointer-events: none; /* 뒤쪽 클릭 통과 */
}

.sf-btn-back {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(10px);
    transition: background-color 0.2s;
    pointer-events: auto; /* 버튼만 활성화 */
}

.sf-btn-back:hover {
    background-color: rgba(255, 51, 102, 0.3);
    border-color: var(--sf-primary);
}

.sf-btn-back span.dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Swiper Feed Base */
.sf-feed-container {
    width: 100%;
    height: 100%;
}

.sf-slide {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #111;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Video Frame */
.sf-video-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sf-video-container video,
.sf-video-container .plyr,
.sf-video-container .plyr__video-wrapper {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Plyr Override: pointer events disabled to pass swipe to Swiper */
.sf-video-container .plyr {
    pointer-events: none !important;
}

.sf-video-container .plyr__controls {
    display: none !important;
}

.sf-video-container .plyr--video {
    background: transparent !important;
}

/* Play/Pause Overlay Animation */
.sf-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.5);
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.sf-play-overlay.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.sf-play-overlay span {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: #fff;
    line-height: 1;
}

/* UI Overlay Inside Slide */
.sf-ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sf-top-header {
    background: var(--sf-top-overlay-bg);
    padding: 75px 20px 40px; /* 상단 닫기 바 영역 확보를 위한 패딩 처리 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
}

.sf-logo {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    letter-spacing: -0.5px;
}

.sf-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.sf-badge-free {
    background-color: var(--sf-primary);
    color: #fff;
    box-shadow: 0 0 10px var(--sf-primary-glow);
}

.sf-badge-premium {
    background-color: #ffd700;
    color: #000;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* Right Float Bar */
.sf-right-actions {
    position: absolute;
    right: 15px;
    bottom: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 10;
    pointer-events: auto;
}

.sf-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.sf-action-item:active {
    transform: scale(0.9);
}

.sf-action-item span.dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
    transition: color 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cp-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(45deg, #1f1f2e, #3f3f5c);
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.cp-avatar span.dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.sf-action-label {
    font-size: 12px;
    color: #ffffff;
    margin-top: 5px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Like Heartbeat Active */
.sf-like-btn.active span.dashicons {
    color: var(--sf-primary) !important;
    animation: heartBeat 0.35s forwards;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    35% { transform: scale(1.3); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* Bottom Metadata overlay */
.sf-bottom-meta {
    background: var(--sf-overlay-bg);
    padding: 40px 20px 30px;
    color: var(--sf-text);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sf-meta-series-title {
    font-size: 14px;
    color: var(--sf-primary);
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.sf-meta-episode-title {
    font-size: 18px;
    color: #ffffff;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.sf-meta-description {
    font-size: 13px;
    color: var(--sf-text-muted);
    font-weight: 400;
    margin: 0;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    max-width: 80%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Seekbar */
.sf-custom-pagination {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 3px !important;
    background: rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.sf-custom-pagination .swiper-pagination-progressbar-fill {
    background: var(--sf-primary) !important;
    box-shadow: 0 0 6px var(--sf-primary);
}

/* UI/UX fallback for No Episodes */
.sf-no-episodes {
    background: #000;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: var(--sf-font);
    font-size: 16px;
    font-weight: 600;
}

/* ==========================================================================
   3. Horizontal Thumbnail Episode Carousel (Recent / Popular)
   ========================================================================== */
.sf-episodes-carousel {
    width: 100%;
    margin-bottom: 25px;
    overflow: hidden;
}

.sf-carousel-track {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar */
.sf-carousel-track::-webkit-scrollbar {
    height: 4px;
}
.sf-carousel-track::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
.sf-carousel-track::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sf-episode-thumb-card {
    width: 130px;
    min-width: 130px;
    cursor: pointer;
    scroll-snap-align: start;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sf-episode-thumb-card:hover {
    transform: scale(1.03);
}

.sf-thumb-aspect {
    width: 100%;
    height: 195px; /* 숏폼 세로 비율 매칭 */
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.sf-episode-thumb-card:hover .sf-thumb-aspect {
    border-color: var(--sf-primary);
}

.sf-thumb-aspect .sf-ep-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.sf-thumb-aspect .sf-ep-badge.free {
    background-color: var(--sf-primary);
    color: #fff;
}

.sf-thumb-aspect .sf-ep-badge.vip {
    background-color: #ffd700;
    color: #000;
}

.sf-thumb-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 44px;
    height: 44px;
    background-color: rgba(255, 51, 102, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px var(--sf-primary-glow);
}

.sf-episode-thumb-card:hover .sf-thumb-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.sf-thumb-play-btn span.dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #fff;
}

.sf-thumb-meta {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sf-thumb-series {
    font-size: 11px;
    color: var(--sf-primary);
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sf-thumb-title {
    font-size: 12px;
    color: #fff;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   4. Desktop & PC Viewport Optimization (9:16 Aspect Ratio)
   ========================================================================== */
@media (min-width: 768px) {
    /* PC 플레이어 오버레이: 9:16 고정 비율 및 정중앙 정렬 */
    .sf-player-overlay-view {
        width: 430px !important;
        height: 100vh !important;
        left: 50% !important;
        top: 0 !important;
        transform: translateX(-50%) translateY(100%) !important;
        transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
        border-left: 1px solid rgba(255, 255, 255, 0.08);
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        background-color: #000 !important;
    }

    .sf-player-overlay-view.active {
        transform: translateX(-50%) translateY(0) !important;
    }

    /* 상단 뒤로가기/네비게이션 헤더 폭 조정 */
    .sf-player-nav-header {
        left: 50% !important;
        transform: translateX(-50%);
        width: 430px !important;
        box-sizing: border-box;
    }

    /* PC 배경 블러 마스크 (플레이어 뒷배경을 어둡고 흐리게 채움) */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(4, 7, 20, 0.7);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 99998; /* 플레이어 99999 바로 아래 */
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.35s ease;
    }

    body.sf-player-active::before {
        opacity: 1;
        pointer-events: auto;
    }
}
