/* Password protection styles */
.password-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background-color: #222;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.password-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #fff;
}

.password-container p {
    margin-bottom: 20px;
    color: #ccc;
    text-align: center;
}

.password-form {
    display: flex;
    margin-bottom: 15px;
}

.password-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    background-color: #333;
    color: white;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
}

.password-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.5);
}

.password-button {
    padding: 12px 20px;
    background-color: #1DB954;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.password-button:hover {
    background-color: #19a34a;
}

.password-error {
    color: #ff4d4d;
    text-align: center;
    margin: 10px 0;
    font-size: 14px;
    display: none;
}

.password-container .back-button {
    margin: 20px auto 0;
    text-align: center;
    display: block;
    width: fit-content;
}/* Fullscreen button */
.fullscreen-button {
    position: absolute;
    bottom: 80px;
    right: 15px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0.8;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    padding: 0;
    pointer-events: auto; /* Make sure it's clickable */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.fullscreen-button:hover {
    opacity: 1;
    transform: scale(1.15);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6) 0%, rgba(118, 75, 162, 0.6) 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
}

.fullscreen-button svg {
    width: 24px;
    height: 24px;
}

/* Fullscreen mode adjustments */
.tiktok-video-container:fullscreen .tiktok-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tiktok-video-container:fullscreen .tiktok-video-info,
.tiktok-video-container:fullscreen .tiktok-progress-bar {
    display: none;
}

video:fullscreen {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
}/* Base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    background-attachment: fixed;
    color: white;
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

h1 {
    margin: 20px 15px;
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

h2 {
    margin: 15px 15px;
    font-size: 24px;
    font-weight: 600;
    color: #f0f0f0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

h3 {
    margin: 15px 15px 10px;
    font-size: 18px;
    font-weight: normal;
    color: #aaa;
}

#content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px 20px;
    min-height: 100vh;
}

/* Loading indicator */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error message */
.error {
    background-color: rgba(255, 0, 0, 0.1);
    border-left: 4px solid #f44336;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.error h2 {
    margin: 0 0 10px;
    color: #f44336;
}

.error button, .back-button {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    margin-top: 10px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.error button:hover, .back-button:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 1) 0%, rgba(118, 75, 162, 1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Folders grid */
.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 10px 5px;
}

.folder-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.folder-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.folder-card:hover::before {
    left: 100%;
}

.folder-card:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
}

.folder-icon {
    font-size: 48px;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s;
}

.folder-card:hover .folder-icon {
    transform: scale(1.1) rotate(-5deg);
}

.folder-name {
    font-size: 15px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    color: #e0e0e0;
    letter-spacing: 0.3px;
}

/* Media grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 10px 5px;
}

.media-card {
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.8) 0%, rgba(40, 40, 60, 0.8) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.media-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.0) 0%, rgba(118, 75, 162, 0.0) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.media-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(102, 126, 234, 0.3);
}

.media-card:hover::after {
    opacity: 1;
}

.video-card {
    border-left: 4px solid #1DB954; /* Green for videos */
    box-shadow: 0 4px 15px rgba(29, 185, 84, 0.2);
}

.video-card:hover {
    box-shadow: 0 12px 30px rgba(29, 185, 84, 0.4);
}

.image-card {
    border-left: 4px solid #4285F4; /* Blue for images */
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.2);
}

.image-card:hover {
    box-shadow: 0 12px 30px rgba(66, 133, 244, 0.4);
}

.media-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #111;
}

.media-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.video-icon {
    background-color: rgba(29, 185, 84, 0.8); /* Green */
}

.image-icon {
    background-color: rgba(66, 133, 244, 0.8); /* Blue */
}

.media-info {
    padding: 10px;
}

.media-name {
    font-size: 14px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-type {
    font-size: 12px;
    color: #aaa;
    text-transform: capitalize;
}

/* Empty folder message */
.empty-folder {
    text-align: center;
    padding: 30px;
    color: #aaa;
    font-style: italic;
}

/* Feed View Button */
.feed-view-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 32px;
    margin: 30px auto;
    border-radius: 50px;
    cursor: pointer;
    max-width: 320px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    border: none;
    position: relative;
    overflow: hidden;
}

.feed-view-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.feed-view-button:hover::before {
    left: 100%;
}

.feed-view-button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.feed-view-button:active {
    transform: translateY(-2px) scale(1.03);
}

.feed-button-icon {
    font-size: 18px;
}

/* TikTok Style Feed */
.tiktok-feed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to bottom, rgba(10, 10, 30, 0.95) 0%, rgba(10, 10, 30, 0.6) 60%, transparent 100%);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.feed-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 600;
    font-size: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}

.tiktok-feed-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    background-color: #000;
    z-index: 90;
    -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
    scroll-behavior: smooth;
    overscroll-behavior-y: contain; /* Prevent overscroll bounce */
}

.tiktok-video-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    cursor: pointer; /* Indicate it's clickable for play/pause */
}

.tiktok-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tiktok-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Video scale animation on pause */
.tiktok-video-wrapper video.paused {
    transform: scale(0.98);
}

.tiktok-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tiktok-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.tiktok-video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 25px;
    background: linear-gradient(to top, rgba(10, 10, 30, 0.85) 0%, rgba(10, 10, 30, 0.5) 60%, transparent 100%);
    backdrop-filter: blur(10px);
    pointer-events: none; /* Allow clicking through to pause/play */
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.tiktok-video-title {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    color: #ffffff;
    letter-spacing: 0.3px;
}

/* Video controls */
.tiktok-video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2;
    pointer-events: none; /* Allow clicking through to pause/play */
}

.tap-to-pause-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10;
    opacity: 0.8;
    animation: fade-in-out 3s ease-in-out;
}

.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

@keyframes fade-in-out {
    0% { opacity: 0; }
    20% { opacity: 0.8; }
    80% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* Play overlay for autoplay issues */
.tiktok-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.tiktok-play-button {
    width: 80px;
    height: 80px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.tiktok-play-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Swipe effect animation */
@keyframes swipe-up {
    0% { transform: translateY(100vh); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes swipe-down {
    0% { transform: translateY(-100vh); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Heart animation for like effect */
@keyframes heart-burst {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.9;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.heart-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 120px;
    color: #ff2e63;
    pointer-events: none;
    z-index: 1000;
    animation: heart-burst 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Loading animation for video buffering */
@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 5;
}

/* Additional mobile-specific styles */
@media (max-width: 768px) {
    .folders-grid, .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 18px;
    }

    .folder-icon {
        font-size: 32px;
    }

    .folder-name, .media-name {
        font-size: 12px;
    }

    .feed-view-button {
        padding: 10px 15px;
        font-size: 14px;
    }

    .tiktok-feed-header {
        padding: 10px;
    }

    .tiktok-video-info {
        padding: 15px;
    }

    .tiktok-video-title {
        font-size: 16px;
    }

    .tiktok-play-button {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }
}

/* Small screens and mobile devices */
@media (max-width: 480px) {
    .folders-grid, .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .feed-view-button {
        max-width: 250px;
        font-size: 13px;
    }

    .tiktok-feed-header .back-button {
        padding: 6px 10px;
        font-size: 12px;
    }

    .feed-title {
        font-size: 14px;
    }

    .tiktok-video-title {
        font-size: 14px;
    }

    .tiktok-play-button {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

/* Additional utility classes */
.hidden {
    display: none !important;
}

.no-scroll {
    overflow: hidden !important;
}

/* Progress bar for videos */
.tiktok-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.3);
    width: 100%;
}

.tiktok-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.6);
}

/* Like and share buttons (optional TikTok-like features) */
.tiktok-actions {
    position: absolute;
    right: 15px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.tiktok-action-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.tiktok-action-button:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.25);
}

/* Smooth fade-in for video containers */
.tiktok-video-container {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Hide scrollbar but keep functionality */
.tiktok-feed-container::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.tiktok-feed-container {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}