/* ============================================
   TIKTOK-STYLE PRODUCT VIDEO FEED CSS
   Complete styles with unmute button
============================================ */

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

:root {
    --primary: #0B4F6C;
    --primary-dark: #083b4f;
    --secondary: #10B981;
    --danger: #EF4444;
    --white: #FFFFFF;
    --black: #000000;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-500: #6B7280;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --overlay: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 30%, rgba(0,0,0,0) 60%);
    --shadow: 0 4px 12px rgba(0,0,0,0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--black);
    color: white;
    height: 100vh;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Video Feed Container */
.feed-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.feed-container::-webkit-scrollbar {
    display: none;
}

/* Video Item */
.video-item {
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    background: var(--black);
}

.video-wrapper {
    height: 100%;
    width: 100%;
    position: relative;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* Video Overlay */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay);
    z-index: 2;
    pointer-events: none;
}

/* Top Bar */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 50px 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

.back-btn, .search-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.2);
}

.back-btn:active, .search-btn:active {
    background: var(--primary);
    transform: scale(0.95);
}

.feed-title {
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    background: rgba(0,0,0,0.3);
    padding: 8px 20px;
    border-radius: 30px;
    backdrop-filter: blur(5px);
}

/* Play/Pause Indicator */
.play-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    color: rgba(255,255,255,0.8);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.play-indicator.show {
    opacity: 1;
}

/* Unmute Button */
.unmute-btn {
    position: absolute;
    bottom: 140px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    backdrop-filter: blur(5px);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.unmute-btn:active {
    transform: scale(0.9);
    background: var(--primary);
    border-color: var(--primary);
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.unmute-btn {
    animation: pulse 2s infinite;
}

/* Bottom Info */
.video-info {
    position: absolute;
    bottom: 100px;
    left: 16px;
    right: 80px;
    z-index: 10;
    color: white;
}

.supplier-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    width: fit-content;
}

.supplier-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    border: 2px solid white;
    overflow: hidden;
}

.supplier-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.supplier-name {
    font-weight: 600;
    font-size: 16px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.product-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.video-caption {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 16px;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.inquiry-btn {
    background: var(--primary);
    border: none;
    color: white;
    padding: 14px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(11, 79, 108, 0.4);
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.2);
}

.inquiry-btn:active {
    transform: scale(0.95);
    background: var(--primary-dark);
}

/* Action Buttons */
.action-buttons {
    position: absolute;
    right: 16px;
    bottom: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 10;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.action-btn i {
    font-size: 32px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.2);
}

.action-btn i:active {
    transform: scale(1.1);
    background: var(--primary);
}

.action-btn.liked i {
    color: var(--danger);
}

.action-btn span {
    font-size: 13px;
    font-weight: 500;
    background: rgba(0,0,0,0.3);
    padding: 4px 8px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

/* Heart Pop Animation */
@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); color: var(--danger); }
    100% { transform: scale(1); }
}

.heart-pop {
    animation: heartPop 0.3s ease;
}

/* Loading State */
.loading-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 20;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: flex-end;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
}

.modal-close:active {
    background: var(--danger);
    color: white;
}

/* Comments List */
.comments-list {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.comment-content {
    flex: 1;
}

.comment-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.comment-text {
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 4px;
    line-height: 1.5;
}

.comment-time {
    font-size: 11px;
    color: var(--gray-500);
}

/* Comment Input */
.comment-input {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    background: white;
}

.comment-input input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid var(--gray-300);
    border-radius: 30px;
    font-size: 14px;
    outline: none;
}

.comment-input input:focus {
    border-color: var(--primary);
}

.comment-input button {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.comment-input button:active {
    transform: scale(0.9);
    background: var(--primary-dark);
}

.comment-input button:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success { background: var(--secondary); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }

/* Sound Wave Animation */
.sound-wave {
    position: absolute;
    bottom: 150px;
    right: 80px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 15;
    pointer-events: none;
}

.sound-wave span {
    width: 4px;
    height: 20px;
    background: white;
    border-radius: 4px;
    animation: wave 1s ease-in-out infinite;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.sound-wave span:nth-child(2) {
    animation-delay: 0.2s;
    height: 30px;
}

.sound-wave span:nth-child(3) {
    animation-delay: 0.4s;
    height: 15px;
}

.sound-wave span:nth-child(4) {
    animation-delay: 0.1s;
    height: 25px;
}

@keyframes wave {
    0%, 100% {
        transform: scaleY(0.5);
        opacity: 0.5;
    }
    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.sound-wave.hide {
    display: none;
}

/* Desktop Styles */
@media (min-width: 768px) {
    .feed-container {
        max-width: 400px;
        margin: 0 auto;
        border-radius: 20px;
        overflow: hidden;
        height: 90vh;
        margin-top: 5vh;
        box-shadow: var(--shadow);
    }
    
    body {
        background: #1a1a1a;
    }
    
    .top-bar {
        max-width: 400px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Mobile Landscape */
@media (max-height: 500px) and (orientation: landscape) {
    .video-info {
        bottom: 20px;
        left: 100px;
        right: 100px;
    }
    
    .action-buttons {
        bottom: 50px;
        flex-direction: row;
        right: 50%;
        transform: translateX(50%);
    }
    
    .unmute-btn {
        bottom: 50px;
        right: 20px;
    }
}

/* Safe Area Support */
@supports (padding: max(0px)) {
    .top-bar {
        padding-top: max(50px, env(safe-area-inset-top));
    }
    
    .video-info {
        bottom: max(100px, env(safe-area-inset-bottom));
    }
    
    .action-buttons {
        bottom: max(140px, env(safe-area-inset-bottom) + 140px);
    }
    
    .unmute-btn {
        bottom: max(140px, env(safe-area-inset-bottom) + 140px);
    }
}