* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: pan-y;
    /* Prevent text selection on mobile */
    -webkit-user-select: none;
    user-select: none;
    /* Prevent pull-to-refresh */
    overscroll-behavior-y: contain;
}

#app {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

#video-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#video-container.swiper {
    overflow: hidden;
    touch-action: pan-y;
}

#video-container .swiper-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#video-container .swiper-slide {
    height: 100vh;
    width: 100%;
}

.video-item {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    flex-shrink: 0;
}

.video-wrapper {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
    visibility: visible;
    opacity: 1;
}

/* === VIDEO PLAYER INSIDE SLIDES === */
.slide-video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    z-index: 1;
}

/* === THUMBNAIL SYSTEM === */
.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000;
    z-index: 2;
    transition: opacity 0.2s ease-out;
}

.video-thumbnail.loaded {
    background-color: transparent;
}

.video-thumbnail.hidden {
    opacity: 0;
    pointer-events: none;
}

.video-thumbnail.error {
    background-color: #1a1a1a;
}

/* === VIDEO SPINNER === */
.video-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 5;
    display: block;
}

/* Hide spinner when thumbnail is hidden (video playing) */
.video-thumbnail.hidden ~ .video-spinner {
    display: none;
}

.pause-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 20;
    pointer-events: none;
}

.pause-icon {
    font-size: 64px;
    color: #fff;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.pause-text {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

/* Unmute Overlay - Styled button for first video */
.unmute-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* Hidden by default, shown via JS */
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 50;
    cursor: pointer;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.unmute-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 48px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: pulse 2s ease-in-out infinite;
}

.unmute-overlay:hover .unmute-button {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.unmute-overlay:active .unmute-button {
    transform: scale(0.98);
}

.unmute-icon {
    font-size: 64px;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.unmute-text {
    font-size: 20px;
    font-weight: 700;
    color: #000;
    text-align: center;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

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

@media (max-width: 768px) {
    .unmute-button {
        padding: 24px 36px;
        gap: 12px;
    }
    
    .unmute-icon {
        font-size: 52px;
    }
    
    .unmute-text {
        font-size: 16px;
    }
}

.video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    z-index: 10;
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    max-width: 80%;
    cursor: pointer;
    transition: opacity 0.2s;
}

.video-title:hover {
    opacity: 0.8;
}

.video-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 16px;
    max-width: 80%;
    cursor: pointer;
    transition: opacity 0.2s;
    line-height: 1.4;
}

.video-description:hover {
    opacity: 0.9;
}

.video-description.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.video-description.expanded {
    display: block;
    white-space: normal;
}

.video-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.video-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.detail-icon {
    font-size: 14px;
    opacity: 0.8;
}

.detail-label {
    font-weight: 500;
    min-width: 70px;
}

.detail-value {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.video-info.expanded {
    padding-bottom: 24px;
}

.video-actions {
    position: absolute;
    right: 16px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

.action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.2s;
}

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

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.action-icon.liked {
    background: rgba(255, 48, 64, 0.9);
}

.action-count {
    font-size: 12px;
    font-weight: 600;
}

.reaction-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.reaction-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s;
}

.reaction-btn:active {
    transform: scale(0.9);
}

.reaction-btn.active {
    background: rgba(255, 48, 64, 0.9);
}

/* Comment Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: flex-end;
}

.modal-content {
    width: 100%;
    max-height: 90vh;
    background: #1a1a1a;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s;
}

.modal-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #333;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comment-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.comment-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.comment-username-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.comment-username {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.comment-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.comment-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    word-wrap: break-word;
    line-height: 1.5;
    padding-left: 0;
}

.comment-input-container {
    padding: 16px;
    border-top: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-input-wrapper {
    display: flex;
    gap: 8px;
}

#comment-username,
#comment-input {
    flex: 1;
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 24px;
    color: #fff;
    font-size: 14px;
}

#comment-username {
    margin-bottom: 8px;
}

#comment-input:focus,
#comment-username:focus {
    outline: none;
    border-color: #fff;
}

#submit-comment {
    padding: 12px 20px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

#submit-comment:active {
    opacity: 0.8;
}

/* Loading Spinner */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.empty-state h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #fff;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 32px;
    color: rgba(255, 255, 255, 0.7);
}

.empty-state .upload-btn {
    padding: 16px 32px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.empty-state .upload-btn:active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* Floating Upload Button */
.floating-upload-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
    color: #000;
    border: none;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.floating-upload-btn:active {
    transform: scale(0.9);
}

.floating-upload-btn span {
    line-height: 1;
}

/* Floating Admin Login Button */
.floating-admin-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 20px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.floating-admin-btn:active {
    transform: scale(0.9);
}

.floating-admin-btn span {
    line-height: 1;
}

/* Upload Modal */
.upload-form-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#upload-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#upload-title,
#upload-description {
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

#upload-title:focus,
#upload-description:focus {
    outline: none;
    border-color: #fff;
}

.file-input-wrapper {
    position: relative;
}

#upload-file {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.file-label:hover {
    border-color: #fff;
}

.file-label #file-name {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 12px;
}

.file-label #file-name.has-file {
    color: #fff;
}

.file-label .file-button {
    padding: 8px 16px;
    background: #fff;
    color: #000;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.file-size {
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.upload-progress-container {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-progress-bar {
    width: 100%;
    height: 8px;
    background: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
}

.upload-progress {
    height: 100%;
    background: #fff;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.upload-progress-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.upload-submit-btn {
    padding: 16px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.upload-submit-btn:active {
    opacity: 0.8;
}

.upload-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.upload-message {
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
}

.upload-message.success {
    background: rgba(0, 255, 0, 0.1);
    color: #4ade80;
}

.upload-message.error {
    background: rgba(255, 0, 0, 0.1);
    color: #f87171;
}

.upload-message.info {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

/* === TABLET/DESKTOP RESPONSIVE STYLES === */

/* iPad and larger tablets */
@media (min-width: 768px) {
    /* Video stays full screen - no max-width constraints */
    
    .video-title {
        font-size: 18px;
        max-width: 85%;
    }
    
    .video-description {
        font-size: 15px;
        max-width: 85%;
    }
    
    .video-info {
        padding: 24px;
    }
    
    .video-actions {
        right: 24px;
        bottom: 120px;
        gap: 16px;
    }
    
    .action-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }
    
    .action-count {
        font-size: 14px;
    }
    
    .pause-icon {
        font-size: 80px;
    }
    
    .pause-text {
        font-size: 22px;
    }
    
    .video-spinner {
        width: 56px;
        height: 56px;
    }
    
    /* Modal styles for larger screens */
    .modal.show {
        align-items: center;
        justify-content: center;
    }
    
    .modal-content {
        max-width: 480px;
        max-height: 80vh;
        border-radius: 20px;
        margin: 0 auto;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .comments-list {
        padding: 16px 20px;
    }
    
    .comment-item {
        padding-bottom: 16px;
    }
    
    .comment-username {
        font-size: 14px;
    }
    
    .comment-text {
        font-size: 14px;
    }
    
    .comment-input-container {
        padding: 20px;
    }
    
    #comment-username,
    #comment-input {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    #submit-comment {
        padding: 14px 24px;
        font-size: 15px;
    }
    
    /* Empty state */
    .empty-state h2 {
        font-size: 28px;
    }
    
    .empty-state p {
        font-size: 18px;
    }
    
    /* Floating admin button */
    .floating-admin-btn {
        width: 56px;
        height: 56px;
        font-size: 24px;
        bottom: 32px;
        right: 32px;
    }
}

/* Laptops and larger desktops */
@media (min-width: 1024px) {
    .video-actions {
        right: 32px;
        bottom: 140px;
    }
    
    .action-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
        transition: transform 0.2s, background 0.2s;
    }
    
    .action-button:hover .action-icon {
        transform: scale(1.1);
        background: rgba(255, 255, 255, 0.2);
    }
    
    .modal-content {
        max-width: 520px;
    }
    
    /* Hover states for desktop */
    .video-title:hover,
    .video-description:hover {
        opacity: 0.9;
    }
    
    .floating-admin-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.05);
    }
    
    #submit-comment:hover {
        opacity: 0.9;
    }
}

/* Large desktops */
@media (min-width: 1440px) {
    .video-info {
        padding: 28px;
    }
    
    .video-title {
        font-size: 20px;
    }
    
    .video-description {
        font-size: 16px;
    }
    
    .video-actions {
        right: 40px;
    }
}
