/**
 * YayReviews - Media Upload Styles
 */

/* Upload Field */
.yayrev-media-upload-field {
    margin-bottom: 1.5em;
}

/* Upload Area */
.yayrev-upload-area {
    position: relative;
}

.yayrev-upload-dropzone {
    border: 1px dashed #d3dce5;
    border-radius: 8px;
    padding: 2em;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.yayrev-upload-dropzone:hover,
.yayrev-upload-area.dragging .yayrev-upload-dropzone {
    border-color: #000;
}

.yayrev-upload-icon {
    color: #999;
    margin-bottom: 0.5em;
}

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

.yayrev-upload-text {
    margin: 0;
    color: #666;
    font-size: 0.9375em;
}

.yayrev-upload-browse {
    color: #000;
    text-decoration: underline;
    cursor: pointer;
}

.yayrev-upload-help {
    margin: 0.5em 0 0;
    font-size: 0.75em;
    color: #999;
}

/* Hidden File Input */
.yayrev-file-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

/* Preview Container */
.yayrev-preview-container {
    margin-top: 1em;
}

.yayrev-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75em;
}

.yayrev-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
}

.yayrev-preview-image,
.yayrev-preview-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yayrev-preview-video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    pointer-events: none;
}

.yayrev-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.yayrev-preview-item:hover .yayrev-preview-remove {
    opacity: 1;
}

.yayrev-preview-remove:hover {
    background: rgba(231, 76, 60, 0.9);
}

/* Error Message */
#yayrev-media-error {
    display: block;
    margin-top: 0.5em;
    font-size: 0.75em;
    color: #e74c3c;
}

/* Responsive */
@media (max-width: 480px) {
    .yayrev-upload-dropzone {
        padding: 1.5em 1em;
    }

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

    .yayrev-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 0.5em;
    }
}
