/* file-upload.css - ProView v1.1
   Glass-style file upload wrapper. Auto-initializes <input class="glass-file-input">.
   v1.1: English text, design-system colors, proper margins, no overflow bugs.
*/

.glass-file-upload {
    max-width: 100%;
    width: 100%;
    font-family: inherit;
}

.glass-file-dropzone {
    position: relative;
    width: 100%;
    min-height: 120px;
    background: var(--bg-elevated, rgba(20, 25, 35, 0.4));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px dashed var(--border-default, rgba(255, 255, 255, 0.25));
    border-radius: var(--radius-md, 10px);
    box-shadow: none;
    transition: border-color 0.3s ease, background 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}

.glass-file-dropzone:hover {
    border-color: var(--border-strong, rgba(255, 255, 255, 0.5));
    background: var(--gray-800, rgba(40, 40, 40, 0.6));
}

.glass-file-dropzone.drag-over {
    border-color: var(--text-primary, #fff);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.15);
}

/* Default state (upload button) */
.glass-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 1;
    transform: scale(1);
}

.glass-upload-placeholder.hidden {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    position: absolute;
}

.glass-upload-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, rgba(255, 255, 255, 0.7));
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
    animation: glass-float 4s infinite ease-in-out;
}

.glass-upload-icon svg {
    width: 100%;
    height: 100%;
}

@keyframes glass-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

.glass-upload-text {
    color: var(--text-primary, #fff);
    text-align: center;
    font-size: var(--text-sm, 13px);
    font-weight: 500;
}

.glass-upload-hint {
    color: var(--text-muted, rgba(255, 255, 255, 0.6));
    font-size: var(--text-xs, 11px);
    margin-top: -2px;
}

/* Selected state (file name + remove button) */
.glass-file-selected-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    gap: 12px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    position: absolute;
    inset: 0;
}

.glass-file-selected-state.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.glass-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.glass-file-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #eee);
    flex-shrink: 0;
}

.glass-file-icon svg {
    width: 100%;
    height: 100%;
}

.glass-file-details {
    min-width: 0;
}

.glass-file-name {
    color: var(--text-primary, #fff);
    font-size: var(--text-sm, 13px);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: ltr;
    text-align: left;
    margin-bottom: 2px;
}

.glass-file-size {
    color: var(--text-muted, rgba(255, 255, 255, 0.6));
    font-size: var(--text-xs, 11px);
}

.glass-remove-file-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full, 9999px);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-default, rgba(255, 255, 255, 0.15));
    color: var(--text-secondary, #eee);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    animation: glass-pop-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.glass-remove-file-btn svg {
    width: 14px;
    height: 14px;
}

@keyframes glass-pop-in {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.glass-remove-file-btn:hover {
    background: rgba(244, 67, 54, 0.18);
    border-color: rgba(244, 67, 54, 0.6);
    color: #ff7b7b;
    transform: rotate(90deg);
    box-shadow: 0 0 16px rgba(244, 67, 54, 0.3);
}

.glass-remove-file-btn:active {
    transform: rotate(90deg) scale(0.9);
}

/* Hidden input */
.glass-hidden-file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

/* Ripple effect */
.glass-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
    transform: scale(0);
    animation: glass-ripple-animation 0.6s ease-out;
    pointer-events: none;
    width: 100px;
    height: 100px;
    margin-left: -50px;
    margin-top: -50px;
}

@keyframes glass-ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Fallback */
@supports not (backdrop-filter: blur(1px)) {
    .glass-file-dropzone {
        background: #1a1a1a;
        border-color: rgba(255, 255, 255, 0.2);
    }
    .glass-remove-file-btn {
        background: #2a2a2a;
    }
}

/* Mobile responsive */
@media (max-width: 500px) {
    .glass-file-selected-state {
        padding: 10px 14px;
    }
    .glass-upload-text {
        font-size: var(--text-xs, 12px);
    }
}
