@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

.section-shorts {
    padding: 60px 0; /* 상단 여백 축소 */
    background-color: #ffffff !important;
    font-family: 'Pretendard', sans-serif;
    position: relative;
    z-index: 1000;
    overflow: hidden;
}

/* Header Area (Centered Top) */
.shorts-header-wrapper.centered {
    text-align: center;
    max-width: 1600px;
    margin: 60px auto 40px; /* 상단 마진을 주어 아래로 내림 */
    padding: 0 20px;
}

.shorts-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 30px;
    margin-bottom: 10px;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(255, 71, 87, 0.2);
}

.shorts-title {
    font-size: 1.4rem; /* 크기 줄임 */
    font-weight: 700;
    color: #555;
    line-height: 1.2;
    margin: 0;
}

.shorts-main-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* 로고와 메뉴 버튼 하단 정렬 */
    padding-top: 10px;
    margin-top: 0;
}

.shorts-logo-area {
    display: flex;
    flex-direction: column;
    align-items: center; /* 중앙 정렬 */
}

.shorts-logo-main {
    display: flex;
    flex-direction: row; /* 로고는 가로로 유지할지 검토 -> 이번엔 로고를 작게 유지 */
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.shorts-logo-text {
    font-size: 24px;
    font-weight: 800;
    color: #030303;
    line-height: 1;
}

.shorts-title {
    font-size: 2.5rem; /* h1에 걸맞는 크기 */
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.2;
    margin: 10px 0 0;
    letter-spacing: -1px;
}

/* Content Layout (수평 유지) */
.shorts-content-layout {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-end; /* 플레이어 하단과 리스트 그룹(헤더 포함) 전체 하단 정렬 */
    padding: 0 20px;
}

/* Waiting Shorts Shelf (Left Side) */
.shorts-shelf-wrapper {
    flex: 1;
}

.shorts-shelf {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 한 줄에 5개 배치 */
    gap: 12px;
    justify-content: flex-start;
}

/* Individual Shorts Card */
.shorts-card {
    width: 100%; /* 그리드 너비에 맞춤 */
    aspect-ratio: 9/16; /* 세로 비율 유지 */
    height: auto;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background-color: #000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.shorts-card:hover {
    transform: translateY(-8px);
}

.shorts-card.active {
    box-shadow: 0 0 0 3px #ff0000, 0 10px 30px rgba(255,0,0,0.3);
}

.card-thumb {
    width: 100%;
    height: 100%;
}

.card-thumb img,
.card-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Playing Badge */
.playing-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #ff0000;
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0;
    z-index: 5;
}

.shorts-card.active .playing-badge {
    opacity: 1;
}

.playing-dot {
    width: 6px;
    height: 6px;
    background-color: #fff;
    border-radius: 50%;
    animation: pulse-dot 1.2s infinite;
}

@keyframes pulse-dot {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* Card Info Overlay: 글래스모피즘 제거 후 전통적인 스타일로 복구 */
.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 16px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
    color: #ffffff;
    pointer-events: none;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-views {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
}

/* Main Player Area (Right Side) */
.shorts-player-container {
    flex-shrink: 0;
    position: sticky;
    top: 50px;
}

.shorts-phone-frame {
    width: 320px;
    height: 640px;
    background-color: #000;
    border-radius: 44px;
    border: 12px solid #0f0f0f;
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.25);
}

.shorts-phone-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 28px;
    background-color: #0f0f0f;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    z-index: 10;
}

.movie-box {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 1100px) {
    .shorts-content-layout {
        flex-direction: column-reverse;
        align-items: center;
    }
    .shorts-player-container {
        position: static;
        margin-bottom: 40px;
    }
    .shorts-shelf {
        grid-template-columns: repeat(3, 1fr); /* 태블릿에서는 3개 */
        justify-content: center;
        width: 100%;
        max-width: 600px;
    }
}

@media (max-width: 480px) {
    .shorts-title {
        font-size: 2.2rem !important;
    }
    .shorts-shelf {
        grid-template-columns: repeat(2, 1fr); /* 모바일에서는 2개 */
        gap: 8px;
    }
    .shorts-phone-frame {
        width: 200px;
        height: 400px;
    }
    .shorts-card {
        border-radius: 8px;
    }
}
