/* File Upload Preview Styles */

.file-upload-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload-input {
    opacity: 0;
    position: absolute;
    z-index: -1;
}

.file-upload-label {
    display: inline-block;
    cursor: pointer;
    padding: 10px 20px;
    background-color: #0000FA;
    color: white;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.file-upload-label:hover {
    background-color: #0000CC;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 250, 0.3);
}

.img-preview, .img-profile-view {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.img-preview:hover, .img-profile-view:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}

.file-drop-area {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.file-drop-area.is-active {
    border-color: #0000FA;
    background-color: rgba(0, 0, 250, 0.05);
}

.file-drop-area:hover {
    border-color: #0000FA;
}

.file-drop-text {
    color: #6c757d;
    font-size: 14px;
    margin-top: 10px;
}

.file-upload-icon {
    font-size: 48px;
    color: #0000FA;
    margin-bottom: 15px;
}

.file-name {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    color: #495057;
    font-style: italic;
}

.file-upload-reset {
    margin-left: 10px;
    padding: 8px 16px;
    background-color: #EF8513;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-reset:hover {
    background-color: #D97512;
    transform: translateY(-2px);
}

.upload-preview-container {
    position: relative;
    margin-top: 15px;
}

.upload-preview-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.upload-remove-btn:hover {
    background-color: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

/* Admin file attach styling */
.avatar-uploader {
    border: 2px dashed #e7eaf3;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.avatar-uploader:hover {
    border-color: #0000FA;
    background-color: rgba(0, 0, 250, 0.02);
}

.avatar-uploader-input {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .file-drop-area {
        padding: 20px;
    }
    
    .upload-preview-image {
        max-width: 100%;
    }
    
    .file-upload-label {
        width: 100%;
        text-align: center;
    }
}

/* Loading spinner for upload */
.upload-spinner {
    display: none;
    margin-top: 10px;
}

.upload-spinner.active {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0000FA;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error messages */
.upload-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    display: none;
}

.upload-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.upload-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* File size indicator */
.file-size-info {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

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

.upload-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.upload-preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}
