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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #000;
    overflow: hidden;
    height: 100vh;
}

/* Video loading progress bar */
.video-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.1);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-progress-bar.visible {
    opacity: 1;
}

.video-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-grey), var(--color-purple));
    transition: width 0.2s ease;
}

.video-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Swiper styles */
.video-swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease-out;
}

.swiper-wrapper {
    transition-timing-function: ease-out;
}

.video-item {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-item .video-preview {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: 100%;
    object-fit: contain;
    background-color: #000;
    z-index: 5;
    pointer-events: none;
}

.video-item video {
    width: auto;
    height: 100%;
    object-fit: contain;
    background-color: #000;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: auto;
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    z-index: 10;
}

.top-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(rgba(0, 0, 0, 0.7), transparent);
    color: white;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.quick-signup-btn {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.quick-signup-btn:hover {
    opacity: 0.8;
}

.username-display {
    color: white;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    position: absolute;
    left: 20px;
    top: 20px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    text-decoration: none;
}

.username-display:hover {
    opacity: 0.8;
}

.video-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.video-info p {
    font-size: 14px;
    opacity: 0.8;
}

/* Tags container */
.tags-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.tags-container .tag:first-child {
    margin-left: 20px;
}

.tags-container .tag:last-child {
    margin-right: 20px;
}

.tags-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tag:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tag.selected {
    background: white;
    color: black;
    border-color: white;
}

/* Likes overlay */
.likes-overlay {
    position: absolute;
    bottom: 80px;
    z-index: 15;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Separate hover scaling for buttons */
.share-button:hover, .like-button:hover {
    transform: scale(1.1);
}

/* Horizontal padding for buttons */
.share-button, .like-button {
    padding: 0 12px;
}

/* Align share button with like button's left edge (matches likes-container padding-left) */
/* share-button inherits centering from likes-overlay */

/* Disable hover effects on mobile to prevent stuck states */
@media (hover: none) and (pointer: coarse) {
    .likes-overlay:hover {
        transform: none;
    }
    
    .likes-overlay:active {
        transform: scale(1.05);
    }
}

.likes-overlay:active {
    background: none;
    -webkit-tap-highlight-color: transparent;
}

.like-button {
    margin-top: 10px;
}

.like-icon {
    width: 32px;
    height: 32px;
    filter: brightness(0.7) opacity(0.6);
    transition: all 0.2s ease;
}

/* Share icon matches like icon visual treatment */
.share-icon {
    width: 32px;
    height: 32px;
    filter: brightness(0.7) opacity(0.6);
    transition: all 0.2s ease;
}

/* Keep likes (icon+count) grouped horizontally; share sits outside */

.share-button:hover .share-icon,
.like-button:hover .like-icon {
    filter: brightness(1);
}

.like-button.liked .like-icon {
    filter: brightness(1);
}

.likes-count {
    color: white;
    font-size: 12px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    align-self: center;
    margin-top: 14px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Loading indicator */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    z-index: 20;
}

/* Removed video loading indicator styles */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Swiper pagination - hidden for vertical swiping */
.swiper-pagination {
    display: none;
}

/* Custom navigation arrows for desktop */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.nav-arrow-left {
    left: 20px;
}

.nav-arrow-right {
    right: 20px;
}

/* Show arrows on desktop */
@media (min-width: 769px) {
    .nav-arrow {
        opacity: 0.7;
    }
    
    .video-container:hover .nav-arrow {
        opacity: 0.7;
    }
}

/* Hide arrows on mobile */
@media (max-width: 768px) {
    .nav-arrow {
        display: none;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .video-overlay {
        padding: 15px 0;
        /* Ensure overlay sticks to bottom of viewport on mobile */
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        /* Add safe area padding for devices with home indicators */
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
    
    .video-info h3 {
        font-size: 16px;
    }
    
    .video-info p {
        font-size: 12px;
    }
    
    .tags-container {
        gap: 6px;
        padding: 6px 0;
    }
    
    .tag {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .top-overlay {
        padding: 15px;
    }
    
    .username-display {
        left: 15px;
        top: 15px;
    }

    /* Ensure video container takes full viewport height on mobile */
    .video-container {
        height: 100vh;
        height: 100dvh; /* Use dynamic viewport height for mobile */
    }
    
    .swiper-slide {
        height: 100vh;
        height: 100dvh; /* Use dynamic viewport height for mobile */
    }
} 

/* Generic dialog styles (used by Sign In and Share dialogs) */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: white;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.dialog-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 20px;
    max-width: 400px;
    margin: 20px;
    border: 1px solid rgba(255,255,255,0.2);
}

.dialog-title {
    margin-bottom: 20px;
    font-size: 24px;
}

.dialog-desc {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
    opacity: 0.9;
}

.dialog-buttons {
    display: flex;
    gap: 25px;
    justify-content: center;
    margin-top: 20px;
}

.btn {
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-purple) 0%, var(--color-grey) 50%, var(--color-dark-grey) 100%);
    color: #ffffff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 24, 208, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
    transform: translateY(-2px);
}

.btn-outline:active {
    transform: translateY(0);
}

/* Copyable single-line field (scrollable without visible scrollbar) */
.copy-frame, .confirmation-code-frame {
    text-align: left;
    margin-top: 15px;
    margin-bottom: 10px;
    padding: 12px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-white);
    cursor: pointer;
    transition: border-color 0.3s ease;
    color: var(--color-grey);
    white-space: nowrap;
    overflow: visible; /* allow tooltip to render outside */
    -webkit-user-select: all;
    -moz-user-select: all;
    -ms-user-select: all;
    user-select: all;
    position: relative;
}
.copy-frame span, .confirmation-code-frame span {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    vertical-align: top;
}

.copy-frame span::-webkit-scrollbar, .confirmation-code-frame span::-webkit-scrollbar {
    display: none;
}

.copy-frame span, .confirmation-code-frame span {
    scrollbar-width: none;
}

.copy-frame:hover, .confirmation-code-frame:hover {
    border-color: var(--color-purple);
}

.copy-frame::-webkit-scrollbar, .confirmation-code-frame::-webkit-scrollbar {
    display: none;
}

.copy-frame, .confirmation-code-frame {
    scrollbar-width: none;
}

.copy-frame .tooltip, .confirmation-code-frame .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-grey);
    color: var(--color-white);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    margin-bottom: 8px;
    z-index: 1100;
}

.copy-frame .tooltip::after, .confirmation-code-frame .tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--color-grey);
}

.copy-frame:hover .tooltip, .confirmation-code-frame:hover .tooltip {
    opacity: 1;
    visibility: visible;
}