/* blog_sns 커스텀 스타일 */

/* 스크롤바 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c4b5fd; border-radius: 3px; }

/* 플랫폼 탭 — 기본 상태 */
.platform-tab {
    background-color: #e5e7eb;
    color: #374151;
    cursor: pointer;
    border: none;
}
.platform-tab:hover:not(.active) {
    background-color: #d1d5db;
    color: #111827;
}

/* 플랫폼 탭 — 활성 상태 */
.platform-tab.active {
    background-color: #4f46e5;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.platform-tab.active[data-platform="instagram"] {
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
}
.platform-tab.active[data-platform="threads"] {
    background-color: #000;
}
.platform-tab.active[data-platform="youtube"] {
    background-color: #FF0000;
}

/* ── 캐러셀 ────────────────────────────────────────── */
.carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
    scrollbar-width: thin;
}
.carousel-track::-webkit-scrollbar { height: 4px; }
.carousel-track::-webkit-scrollbar-thumb { background: #c4b5fd; border-radius: 2px; }

/* 싱글 아이템일 때 가운데 정렬 */
.carousel-track.single-item {
    justify-content: center;
}

/* 캐러셀 아이템 */
.carousel-item {
    flex: 0 0 auto;
    scroll-snap-align: center;
    width: min(100%, 480px);
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s;
}
.carousel-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* 미디어 표시 영역 */
.carousel-media {
    position: relative;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    max-height: 70vh;
    overflow: hidden;
}
.carousel-media img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}
.carousel-media video {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    background: #000;
}
.carousel-media .media-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
}
.media-badge.image { background: #dbeafe; color: #1e40af; }
.media-badge.video { background: #fce7f3; color: #be185d; }
.media-badge.audio { background: #fef3c7; color: #92400e; }

/* 슬라이드 번호 */
.carousel-media .slide-number {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    z-index: 2;
}

/* 액션 바 */
.carousel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #f3f4f6;
    flex-wrap: wrap;
}
.carousel-actions .action-info {
    flex: 1;
    min-width: 0;
}
.carousel-actions .action-info .filename {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.carousel-actions .action-info .quality {
    font-size: 0.65rem;
    color: #9ca3af;
}
.carousel-actions .action-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* 액션 버튼 공통 */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 0.625rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s;
    white-space: nowrap;
}
.btn-action:active { transform: scale(0.96); }
.btn-action svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-download {
    background-color: #16a34a;
    color: #fff;
}
.btn-download:hover { background-color: #15803d; }

.btn-share {
    background-color: #2563eb;
    color: #fff;
}
.btn-share:hover { background-color: #1d4ed8; }

.btn-wallpaper {
    background-color: #7c3aed;
    color: #fff;
}
.btn-wallpaper:hover { background-color: #6d28d9; }

/* 캐러셀 화살표 */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #374151;
    transition: background 0.15s, box-shadow 0.15s;
}
.carousel-arrow:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.carousel-arrow.left { left: -16px; }
.carousel-arrow.right { right: -16px; }

/* 인디케이터 도트 */
.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.carousel-dot.active {
    background: #4f46e5;
    transform: scale(1.25);
}

/* 플랫폼 배지 */
.badge-instagram { background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045); color: white; }
.badge-threads { background: #000; color: white; }
.badge-youtube { background: #FF0000; color: white; }

/* 로딩 스피너 */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
}
.pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

/* Line clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 비디오 로딩 placeholder */
.video-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    color: rgba(255,255,255,0.6);
    gap: 8px;
    font-size: 0.8rem;
}

/* ── 반응형 ────────────────────────────────────────── */

/* 모바일: 한 장씩 풀 너비 */
@media (max-width: 640px) {
    .carousel-item {
        width: calc(100vw - 48px);
        max-width: none;
    }
    .carousel-arrow { display: none !important; }
    .carousel-actions {
        padding: 10px 12px;
    }
    .btn-action {
        padding: 7px 10px;
        font-size: 0.72rem;
    }
    .btn-action .btn-label { display: none; }
    .btn-action svg { width: 16px; height: 16px; }
}

/* 태블릿 */
@media (min-width: 641px) and (max-width: 1023px) {
    .carousel-item {
        width: min(60vw, 400px);
    }
}
