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

body {
    min-height: 100vh;
    font-family: 'Outfit', sans-serif;
    background:
            radial-gradient(ellipse at 20% 80%, rgba(120, 80, 60, 0.15) 0%, transparent 50%),
            radial-gradient(ellipse at 80% 20%, rgba(60, 80, 100, 0.1) 0%, transparent 50%),
            linear-gradient(165deg, #1a1612 0%, #0d0b09 50%, #12100e 100%);
    color: #e8e4df;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header h1 {
    font-family: 'Crimson Pro', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #f5f2ed;
}

.logout-btn {
    padding: 0.6rem 1.2rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #9a938a;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    border-color: rgba(200, 170, 130, 0.4);
    color: #c8a882;
}

.main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed rgba(200, 170, 130, 0.3);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 2rem;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: rgba(200, 170, 130, 0.6);
    background: rgba(200, 170, 130, 0.05);
}

.upload-zone.uploading {
    pointer-events: none;
    border-color: rgba(200, 170, 130, 0.4);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    opacity: 0.6;
}

.upload-icon svg {
    width: 100%;
    height: 100%;
    fill: #c8a882;
}

.upload-zone h3 {
    font-family: 'Crimson Pro', serif;
    font-size: 1.3rem;
    font-weight: 400;
    color: #f5f2ed;
    margin-bottom: 0.5rem;
}

.upload-zone p {
    font-size: 0.9rem;
    color: #8a837a;
    font-weight: 300;
}

.upload-zone input[type="file"] {
    display: none;
}

/* Progress Bar */
.upload-progress {
    display: none;
    margin-top: 1.5rem;
}

.upload-progress.visible {
    display: block;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.progress-filename {
    color: #e8e4df;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-percent {
    color: #c8a882;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c8a882, #a8886a);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.upload-status {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #8a837a;
}

.upload-status.error {
    color: #e8a090;
}

.upload-status.success {
    color: #90c8a0;
}

/* Videos Grid */
.videos-section {
    margin-top: 2rem;
}

.videos-section h2 {
    font-family: 'Crimson Pro', serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: #f5f2ed;
    margin-bottom: 1.5rem;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.video-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.video-card:hover {
    border-color: rgba(200, 170, 130, 0.3);
    transform: translateY(-2px);
}

.video-thumbnail {
    position: relative; /* allow absolute positioning of children */
    overflow: hidden;
    border-radius: 8px;
    background-color: #000;
}

.video-thumbnail img,
.video-thumbnail svg {
    width: 100%;
    height: auto;
    display: block;
}

.video-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.video-actions button {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.video-actions button:hover {
    background: rgba(0, 0, 0, 0.9);
}
/* Search Bar Styling - Dark Themed */
.search-bar {
    margin: 20px 0;
    text-align: center;
}

.search-bar input {
    width: 80%;
    max-width: 400px;
    padding: 12px 18px;
    font-size: 16px;
    font-family: 'Outfit', sans-serif;
    color: #f5f2ed; /* light text */
    background: rgba(255, 255, 255, 0.05); /* subtle dark background */
    border: 1px solid rgba(200, 170, 130, 0.3); /* match golden accents */
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.search-bar input::placeholder {
    color: rgba(200, 170, 130, 0.6); /* golden placeholder */
}

.search-bar input:focus {
    outline: none;
    border-color: #c8a882; /* golden highlight */
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 8px rgba(200, 170, 130, 0.5);
}

.video-thumbnail.loading {
    background: rgba(0, 0, 0, 0.5);
}

.video-thumbnail.loaded svg {
    display: none;
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 1rem;
    font-weight: 500;
    color: #f5f2ed;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-meta {
    font-size: 0.8rem;
    color: #8a837a;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #8a837a;
}

.empty-state p {
    font-weight: 300;
}

/* Folders */
.add-folder-btn {
    background: rgba(200, 170, 130, 0.1);
    border: 1px solid rgba(200, 170, 130, 0.2);
    color: #c8a882;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.add-folder-btn:hover {
    background: rgba(200, 170, 130, 0.2);
    border-color: rgba(200, 170, 130, 0.4);
}

.add-folder-btn svg {
    width: 16px;
    height: 16px;
}

.folder-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.folder-card:hover {
    border-color: rgba(200, 170, 130, 0.3);
    transform: translateY(-2px);
}

.folder-thumbnail {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, rgba(200, 170, 130, 0.1), rgba(200, 170, 130, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.folder-thumbnail svg {
    width: 64px;
    height: 64px;
    fill: rgba(200, 170, 130, 0.6);
}

.folder-info {
    padding: 1rem;
}

.folder-title {
    font-size: 1rem;
    font-weight: 500;
    color: #f5f2ed;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-meta {
    font-size: 0.8rem;
    color: #8a837a;
}

.folder-actions-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    opacity: 1; /* Always visible for mobile */
    z-index: 100; /* Above thumbnail images */
    pointer-events: auto;
}


.folder-action-btn {
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e8e4df;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    min-width: 32px;
    min-height: 32px;
    flex-shrink: 0;
}

.folder-action-btn:hover {
    background: rgba(200, 170, 130, 0.3);
    border-color: rgba(200, 170, 130, 0.5);
    color: #c8a882;
}

.folder-action-btn {
    font-size: 16px;
    line-height: 1;
}

/* Drag and Drop */
.video-card.dragging,
.folder-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.video-card[draggable="true"],
.folder-card[draggable="true"] {
    cursor: grab;
}

.video-card[draggable="true"]:active,
.folder-card[draggable="true"]:active {
    cursor: grabbing;
}

.folder-card.drop-target,
.video-card.drop-target {
    border-color: rgba(200, 170, 130, 0.6);
    background: rgba(200, 170, 130, 0.1);
    transform: scale(1.02);
}

.drop-zone-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(200, 170, 130, 0.05);
    border: 2px dashed rgba(200, 170, 130, 0.4);
    pointer-events: none;
    z-index: 1000;
    display: none;
}

.drop-zone-overlay.active {
    display: block;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: #8a837a;
    cursor: pointer;
    transition: color 0.2s ease;
    font-size: 0.9rem;
}

.breadcrumb-item:hover {
    color: #c8a882;
}

.breadcrumb-item.active {
    color: #f5f2ed;
    cursor: default;
}

.breadcrumb-separator {
    color: #8a837a;
}

/* Video Player Modal */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.video-modal.active {
    display: flex;
}

.video-modal-content {
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    position: relative;
}

.video-modal video {
    width: 100%;
    height: auto;
    max-height: 90vh;
    background: #000;
}

.video-modal-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.video-modal-title {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-align: center;
}

/* Hide content until auth check completes */
.loading {
    opacity: 0;
}

.loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .upload-zone {
        padding: 2rem 1.5rem;
    }

    .header {
        padding: 1rem 1.5rem;
    }

    .main {
        padding: 1.5rem;
    }
}