/* ==============================================================
   UPLOADS / FILE INPUT COMPONENT
   Premium styling for single and multiple file uploads
   ============================================================== */

.upload-group {
    position: relative;
    width: 100%;
}

/* Base Upload Field */
.upload-field {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    transition: var(--transition);
    cursor: pointer;
    text-align: center;
    overflow: hidden;
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 !important;
}

/* Hidden File Input */
.upload-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

/* Upload Field States */
.upload-field:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.upload-field:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.upload-field.drag-over {
    border-color: var(--success);
    background: rgba(var(--success-rgb), 0.05);
    transform: scale(1.01);
}

/* Icon & Content styling */
.upload-icon {
    width: 48px;
    height: 48px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    transition: var(--transition);
}

.upload-field:hover .upload-icon {
    transform: translateY(-5px);
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.3);
}

.upload-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 5px;
    display: block;
}

.upload-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    display: block;
}

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

.upload-preview-item {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    animation: fadeIn 0.3s ease;
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
}

.upload-preview-thumb {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 10px !important;
    background: rgba(var(--black-rgb), 0.2);
}

.upload-preview-info {
    font-size: 11px;
    color: var(--text-muted);
    width: 100%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 5px;
}

.upload-preview-remove {
    position: absolute;
    top: 8px !important;
    right: 8px !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50%;
    background: rgba(var(--accent-rgb, 239, 68, 68), 0.9) !important;
    color: var(--white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(var(--black-rgb), 0.3);
    transition: var(--transition);
    z-index: 20 !important;
}

.upload-preview-remove:hover {
    transform: scale(1.1);
    background: var(--danger) !important;
}

/* Main Photo Feature */
.btn-photo-main {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(var(--bg-card-rgb), 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.btn-photo-main:hover {
    background: var(--bg-card);
    color: var(--primary);
    transform: scale(1.1);
}

.btn-photo-main.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.3);
}

.upload-preview-item.is-main {
    border: 2px solid var(--primary) !important;
    box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.2) !important;
}

.upload-preview-item.is-main::before {
    content: 'Principal';
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary);
    color: var(--white);
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    z-index: 11;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.3);
}

/* --- Premium Upload Box Wrapper (Settings Style) --- */
.upload-box-wrapper {
    background: rgba(var(--white-rgb), 0.02);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.upload-box-wrapper:hover {
    border-color: rgba(var(--primary-rgb), 0.3);
    background: rgba(var(--white-rgb), 0.04);
}

.upload-label, .settings-upload-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    margin-bottom: 15px;
}

/* --- Image Upload Preview Component --- */
.upload-clickable-container {
    position: relative;
    width: 100%;
}

/* --- Upload Selector / Preview Box --- */

.upload-preview-box, .upload-selector {
    width: 100%;
    height: 160px;
    background: rgba(var(--black-rgb), 0.2);
    border: 2px dashed var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    cursor: pointer;
}

.upload-preview-box:hover, .upload-selector:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.04);
}

.upload-preview-box img, .upload-selector img, .preview-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.object-cover {
    object-fit: cover !important;
}

.upload-placeholder-icon, .upload-empty i {
    font-size: 32px;
    color: var(--text-muted);
    margin-bottom: 10px;
    opacity: 0.5;
}

.upload-placeholder-text, .upload-empty span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.upload-hover-overlay, .upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(var(--black-rgb), 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: var(--transition);
    color: var(--white);
    font-weight: 700;
    z-index: 5;
}

.upload-preview-box:hover .upload-hover-overlay, 
.upload-selector:hover .upload-overlay {
    opacity: 1;
}

.upload-delete-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(var(--accent-rgb, 239, 68, 68), 0.9);
    color: var(--white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.upload-delete-overlay:hover {
    background: var(--danger);
    transform: scale(1.1);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

