:root {
    --background-color: #191919;
    --secondary-background-color: #282828;
    --text-color: #286cff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background-color);
    color: #fff;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    background-color: var(--secondary-background-color);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header h1 {
    color: var(--text-color);
}


.description {
    color: #666;
    line-height: 1.6;
}

.upload-zone {
    text-align: center;

    padding: 18px;
    margin-bottom: 25px;
    border: 2px dashed #666;
    border-radius: 12px;
    background: var(--secondary-background-color);
    backdrop-filter: blur(4px);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--text-color);
}

.upload-zone svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    color: #999;
}

.upload-zone p {
    color: #666;
    font-size: 16px;
}

#fileInput {
    display: none;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .media-grid {
        display: flex;
        flex-direction: column;
    }
}

.media-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 8px rgb(0 0 0 / 35%);
    transition: transform 0.2s;
}

.media-item:hover {
    transform: scale(1.02);
}

.media-item img, .media-item video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* contain ou cover*/
}

.video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.video-overlay svg {
    width: 28px;
    height: 28px;
    color: white;
    margin-left: 3px;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    padding: 0;
}

.lightbox.active {
    display: block;
}

.lightbox-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 20px;
    overflow: auto;
}

.lightbox-media-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.lightbox-content {
    max-width: 90vw;
    max-height: calc(100vh - 120px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95vw;
        max-height: calc(100vh - 100px);
    }
}

.lightbox-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1001;
}

.lightbox-title {
    color: white;
    font-size: 14px;
    font-weight: 500;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lightbox-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

@media (max-width: 768px) {
    .lightbox-container {
        padding: 70px 10px 10px;
    }
    
    .lightbox-header {
        padding: 10px 12px;
    }
    
    .lightbox-title {
        font-size: 13px;
        max-width: 40%;
    }
    
    .btn {
        padding: 10px 12px;
        font-size: 0;
    }
    
    .btn svg {
        margin: 0;
    }
    
    .btn span {
        display: none;
    }
}

.btn {
    background: rgba(255,255,255,0.15);
    border: none;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    color: white;
    white-space: nowrap;
}

.btn:hover {
    background: rgba(255,255,255,0.25);
}

.btn svg {
    flex-shrink: 0;
}

.btn-delete {
    background: rgba(244,67,54,0.8);
    color: white;
}

.btn-delete:hover {
    background: rgba(244,67,54,1);
}

.btn-close {
    background: transparent;
    padding: 8px;
}

.btn-close:hover {
    background: rgba(255,255,255,0.15);
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}



.upload-popup {
    color: var(--text-color);
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #191919e0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgb(0 0 0 / 88%);
    padding: 20px;
    min-width: 300px;
    z-index: 999;
    display: none;
    margin: 10px;
}

.upload-popup.active {
    display: block;
}

.upload-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.upload-popup-title {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.upload-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1b1b1b;
}

.upload-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.upload-item-name {
    font-size: 13px;
    color: var(--text-color);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--secondary-background-color);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3949ff, #286cff);
    border-radius: 3px;
    transition: width 0.3s;
}

.upload-percentage {
    font-size: 12px;
    color: #4CAF50;
    font-weight: 600;
    margin-top: 4px;
    text-align: right;
}

@media (max-width: 768px) {
    .upload-popup {
        bottom: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}