/* Modern File Upload Component */
.modern-file-upload {
    position: relative;
    width: 100%;
    height: 150px;
    border: 2px dashed #ddd;
    border-radius: 10px;
    background: #fdfdfd;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
}

@media (hover: hover) {
    .modern-file-upload:hover {
        border-color: #68bbe4;
        background: #f6fbff;
    }
}

.modern-file-upload.dragover {
    border-color: #68bbe4;
    background: #eef8ff;
    transform: scale(1.01);
}

.modern-file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 12; /* Stay above preview but below remove button */
}

.modern-file-upload .upload-placeholder {
    text-align: center;
    color: #888;
    pointer-events: none;
}

.modern-file-upload .upload-placeholder i {
    font-size: 32px;
    margin-bottom: 8px;
    color: #68bbe4;
}

.modern-file-upload .upload-placeholder span {
    display: block;
    font-size: 14px;
}

/* Preview State */
.modern-file-upload .preview-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through to input */
}

.modern-file-upload .preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modern-file-upload .preview-container .file-info {
    text-align: center;
    padding: 20px;
}

.modern-file-upload .preview-container .file-info i {
    font-size: 40px;
    color: #68bbe4;
    display: block;
    margin-bottom: 10px;
}

.modern-file-upload .preview-container .file-info .file-name {
    font-size: 14px;
    font-weight: 500;
    color: #444;
    word-break: break-all;
}

/* Remove button */
.modern-file-upload .btn-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    transition: all 0.2s;
    font-size: 18px;
    font-weight: bold;
    color: #666;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.modern-file-upload .btn-remove:hover {
    background: #ff5e5e;
    color: #fff;
    border-color: #ff5e5e;
}

/* Loading state */
.modern-file-upload.loading::after {
    content: "";
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #68bbe4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 20;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
