/* TikTok Style Landing Page */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
    background: #000;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height untuk mobile */
}

/* Logo Header */
.brand-header-tiktok {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    padding: 15px 20px;
    width: 100%;
    max-width: 500px;
    display: flex;
    justify-content: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
}

.brand-logo-tiktok {
    height: 40px;
    width: auto;
    object-fit: contain;
}

/* Main TikTok Container */
.tiktok-container {
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height untuk mobile */
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    display: flex;
    justify-content: center;
}

/* Container wrapper for desktop centering */
.tiktok-wrapper {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height untuk mobile */
    position: relative;
    margin: 0 auto;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
    body {
        background: #0b0b0b;
    }
    .tiktok-container {
        align-items: center;
        padding: 24px 0;
    }
    .tiktok-wrapper {
        max-height: calc(100dvh - 48px);
        height: calc(100dvh - 48px);
        border-radius: 24px;
        overflow-y: scroll;
        overflow-x: hidden;
        scroll-snap-type: y mandatory;
    }
    /* Hide scrollbar on wrapper */
    .tiktok-wrapper::-webkit-scrollbar {
        display: none;
    }
    .tiktok-wrapper {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .podcast-slide {
        height: calc(100dvh - 48px) !important;
        min-height: calc(100dvh - 48px);
    }
    /* Logo adjustment for desktop - move much lower */
    .brand-header-tiktok {
        padding: 50px 20px 15px;
        background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.6) 70%, transparent 100%);
    }
    /* Adjust swipe hint for desktop visibility */
    .swipe-hint {
        bottom: 120px;
    }
}

/* Hide scrollbar but keep functionality */
.tiktok-container::-webkit-scrollbar {
    display: none;
}

.tiktok-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Individual Podcast Slide */
.podcast-slide {
    width: 100%;
    max-width: 500px;
    height: 100vh !important;
    height: 100dvh !important; /* Dynamic viewport height untuk mobile */
    min-height: 100vh; /* Fallback untuk browser lama */
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

/* Different gradient backgrounds for variety */
.podcast-slide:nth-child(1) {
    background: linear-gradient(135deg, #4a5fc1 0%, #5a3678 100%);
}

.podcast-slide:nth-child(2) {
    background: linear-gradient(135deg, #c066d4 0%, #c9364a 100%);
}

.podcast-slide:nth-child(3) {
    background: linear-gradient(135deg, #2d7bc7 0%, #00b8c5 100%);
}

.podcast-slide:nth-child(4) {
    background: linear-gradient(135deg, #2db35e 0%, #26c49f 100%);
}

.podcast-slide:nth-child(5) {
    background: linear-gradient(135deg, #c9476e 0%, #d4a810 100%);
}

/* Podcast Illustration/Image */
.slide-illustration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.2;
    z-index: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-illustration img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(2px);
}

/* Podcast icon fallback - full background */
.slide-illustration-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 250px;
    opacity: 0.1;
    z-index: 0;
    color: white;
}

/* Overlay for better text readability */
.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Content Container */
.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    width: 100%;
    color: white;
    max-height: 50vh;
    overflow-y: auto;
    padding: 15px 20px 20px 20px;
    pointer-events: auto;
}

@media (min-width: 768px) {
    .slide-content {
        padding: 15px 20px 100px 20px;
        max-height: 60vh;
    }
}

/* Bottom Info Section */
.podcast-bottom-info {
    max-width: calc(100% - 100px);
    width: 100%;
}

/* Host Info */
.host-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.host-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.host-name {
    font-weight: 600;
    font-size: 14px;
    opacity: 0.9;
}

/* Title and Description */
.slide-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.2;
}

.slide-episode {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.slide-description {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 15px;
    opacity: 0.9;
    max-width: 90%;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Bottom sheet modal & comments */
.modal.bottom-sheet .modal-dialog {
    position: fixed;
    bottom: 0;
    left: 50%;
    right: auto;
    margin: 0;
    width: min(500px, calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));
    max-width: 500px;
    transform: translate(-50%, 100%);
    transition: transform 0.25s ease;
}
.modal.bottom-sheet.show .modal-dialog {
    transform: translate(-50%, 0);
}
.modal.bottom-sheet .modal-content {
    border-radius: 18px 18px 0 0;
}
.bottom-sheet-content {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    border-radius: 18px 18px 0 0;
    color: #111;
    pointer-events: auto;
    -webkit-user-select: text;
    user-select: text;
}
.bottom-sheet-content .text-muted {
    color: rgba(0, 0, 0, 0.6) !important;
}
.bottom-sheet-content .comment-item {
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.bottom-sheet-content #commentInput {
    background: rgba(0,0,0,0.04);
    color: #111;
    border: 1px solid rgba(0,0,0,0.12);
}
/* Comment Modal Header */
.comment-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    padding: 1.25rem 1.5rem;
    border-radius: 24px 24px 0 0;
}

.comment-modal-header .modal-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: white;
    display: flex;
    align-items: center;
}

/* Comment List Container */
.comment-list {
    max-height: 350px;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    background: rgba(0,0,0,0.02);
}

.comment-list::-webkit-scrollbar {
    width: 6px;
}

.comment-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 3px;
}

.comment-list::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}

.comment-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.3);
}

.comment-list:empty::before {
    content: "Belum ada komentar. Jadilah yang pertama!";
    display: block;
    text-align: center;
    color: rgba(0,0,0,0.4);
    padding: 2rem;
    font-size: 0.9rem;
}

/* Comment Item Card */
.comment-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    animation: slideInComment 0.3s ease;
}

@keyframes slideInComment {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.comment-item:last-child {
    margin-bottom: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.comment-meta {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.comment-time {
    font-size: 0.75rem;
    color: rgba(0,0,0,0.5);
}

.comment-text {
    color: #333;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Comment Input Footer */
.comment-modal-footer {
    padding: 1rem 1.5rem 1.25rem;
    background: white;
    border-top: 1px solid rgba(0,0,0,0.08);
    border-radius: 0 0 24px 24px;
}

.comment-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    width: 100%;
    pointer-events: auto;
}

.comment-textarea {
    flex: 1;
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    resize: none;
    transition: all 0.2s ease;
    color: #1a1a1a;
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
    touch-action: manipulation;
}

.comment-textarea:focus {
    background: white;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.comment-textarea::placeholder {
    color: rgba(0,0,0,0.4);
}

.btn-comment-send {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    flex-shrink: 0;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-comment-send:active {
    transform: scale(0.95);
}

/* Audio Player in Slide */
.slide-audio-player {
    margin-top: 10px;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.audio-play-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #333;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.audio-play-btn:hover {
    transform: scale(1.1);
    background: white;
}

.audio-progress-wrapper {
    flex: 1;
}

.audio-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 5px;
}

.audio-progress-fill {
    height: 100%;
    background: white;
    width: 0%;
    transition: width 0.1s linear;
}

.audio-time {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    opacity: 0.8;
}

/* Right Action Buttons (TikTok Style) */
.action-buttons {
    position: absolute;
    right: 20px;
    bottom: 150px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 20px;
    pointer-events: auto;
}

.action-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 24px;
    position: relative;
    margin-top: 15px;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.action-btn i {
    position: relative;
}

/* Adjust icon positions */
.action-btn.like-btn i {
    top: 2px;
}

.action-btn.share-btn i {
    top: 2px;
}

/* Profile avatar styling */
.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.action-btn.active {
    background: rgba(255, 59, 92, 0.9);
}

.action-btn.comment-btn.active {
    background: rgba(102, 126, 234, 0.9);
}

.action-btn .count {
    font-size: 11px;
    font-weight: 600;
    margin-top: 3px;
    position: absolute;
    bottom: -20px;
    white-space: nowrap;
}

/* Like button animation when clicked */
.action-btn.like-btn.active i {
    animation: likeAnimation 0.4s ease;
}

@keyframes likeAnimation {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

/* Swipe Hint */
.swipe-hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: white;
    opacity: 0.6;
    animation: bounceHint 2s ease-in-out infinite;
    pointer-events: none;
}

.swipe-hint i {
    font-size: 24px;
}

.swipe-hint span {
    font-size: 12px;
    font-weight: 500;
}

@keyframes bounceHint {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(10px);
    }
}

/* Hide hint after first interaction */
.tiktok-container.interacted .swipe-hint {
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Responsive Design */
@media (min-width: 769px) {
    /* Desktop: centered with max-width */
    .tiktok-wrapper {
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .brand-header-tiktok {
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    /* Mobile: full width */
    .tiktok-wrapper {
        max-width: 100%;
        box-shadow: none;
    }
    
    .podcast-slide {
        max-width: 100%;
    }
    
    .brand-header-tiktok {
        max-width: 100%;
    }
    
    .slide-title {
        font-size: 28px;
    }
    
    .slide-description {
        font-size: 15px;
        max-width: 100%;
    }
    .slide-description {
        font-size: 13px;
        max-width: 100%;
    }
    
    .podcast-bottom-info {
        max-width: calc(100% - 80px);
    }
    
    .action-buttons {
        right: 15px;
        bottom: 150px;
    }
    
    .action-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .slide-content {
        padding: 15px;
        padding-bottom: 170px;
    }
    
    .slide-title {
        font-size: 28px;
    }
    
    .slide-description {
        font-size: 15px;
    }
}
