/**
 * File Upload Styles - Modern Drag & Drop Interface
 * For Photos and Videos with Preview
 */

/* Drop Zone Styles */
.file-drop-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 50px;
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    padding: 40px 20px;
    /* text-align: center; */
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fafafa;
    margin-bottom: 20px;
}

.file-drop-zone:hover {
    border-color: #ff8c42;
    background-color: #fff5f0;
}

.file-drop-zone.drag-over {
    border-color: #ff8c42;
    background-color: #fff5f0;
    border-style: solid;
}

/* Upload Icon */
.upload-icon {
    width: 80px;
    height: 80px;
    /* margin: 0 auto 20px; */
    background-color: #ffe8d6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-icon svg {
    width: 40px;
    height: 40px;
    color: #ff8c42;
}

/* Upload Text */
.upload-text h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.upload-text p {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px 0;
}

/* Select Files Button */
.select-files-btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-files-btn:hover {
    border-color: #ff8c42;
    color: #ff8c42;
    background-color: #fff5f0;
}

/* Hide default file inputs */
#listing_photos,
#listing_videos {
    display: none;
}

/* Preview Container */
.file-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

/* Photo Preview Item */
.photo-preview {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    background-color: #f5f5f5;
    transition: all 0.3s ease;
}

.photo-preview:hover {
    border-color: #ff8c42;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video Preview Item */
.video-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fff;
    transition: all 0.3s ease;
    grid-column: span 2;
}

.video-preview:hover {
    border-color: #ff8c42;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.video-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background-color: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.video-info {
    flex: 1;
    min-width: 0;
}

.video-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.video-size {
    font-size: 12px;
    color: #999;
}

/* Remove Button */
.remove-file {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background-color: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.video-preview .remove-file {
    position: relative;
    top: auto;
    right: auto;
    flex-shrink: 0;
}

.remove-file:hover {
    background-color: #ff4444;
    color: #fff;
    transform: scale(1.1);
}

.remove-file svg {
    width: 16px;
    height: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .file-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .video-preview {
        grid-column: span 1;
    }

    .upload-icon {
        width: 60px;
        height: 60px;
    }

    .upload-icon svg {
        width: 30px;
        height: 30px;
    }

    .upload-text h4 {
        font-size: 14px;
    }

    .upload-text p {
        font-size: 12px;
    }
}

/* Form Field Spacing */
.form-field.file-upload-field {
    margin-bottom: 30px;
}

.form-field.file-upload-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.form-field.file-upload-field small {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

/* Empty State */
.file-preview-container:empty::after {
    content: '';
    display: none;
}

/* Animation for new items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-preview-item {
    animation: fadeInUp 0.3s ease;
}
