/**
 * upload.css
 * Screen 3: Upload — dropzone, preview, client-side resize
 * Architecture: Dumb browser, all CSS in files, zero inline styles
 */

/* ═══ UPLOAD LAYOUT ═══ */
#view-upload {
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem 1rem;
    overflow: hidden;
}

/* Hidden file input (triggered by dropzone click) */
.upload-file-input {
    display: none;
}



/* ═══ UPLOAD CARD (glassmorphism) ═══ */
.upload-card {
    width: 100%;
    max-width: 480px;
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: calc(100vh - 200px);
}

.upload-card-glow {
    position: absolute;
    top: 0;
    left: 25%;
    width: 50%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
}

/* ═══ BACK BUTTON ═══ */
.upload-back-btn {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 3;
    font-family: inherit;
}

.upload-back-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ═══ HEADER ═══ */
.upload-header {
    text-align: center;
    padding-top: 0.5rem;
}

.upload-title {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.upload-subtitle {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 500;
}

/* ═══ DROPZONE ═══ */
.upload-dropzone {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 1rem;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 200px;
    background: rgba(255, 255, 255, 0.01);
}

.upload-dropzone:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.03);
}

.upload-dropzone.drag-over {
    border-color: rgba(255, 255, 255, 0.6);
    border-style: solid;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.05) inset;
}

.upload-dropzone.has-file {
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.08);
    padding: 1rem;
    cursor: default;
}

/* Dropzone prompt (icon + text) */
.upload-dropzone-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    pointer-events: none;
}

.upload-dropzone.has-file .upload-dropzone-prompt {
    display: none;
}

.upload-dropzone-icon {
    width: 48px;
    height: 48px;
    color: rgba(255, 255, 255, 0.65);
    transition: color 0.3s;
}

.upload-dropzone:hover .upload-dropzone-icon {
    color: rgba(255, 255, 255, 0.65);
}

.upload-dropzone-text {
    font-size: 9px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    text-align: center;
    line-height: 1.6;
}

.upload-dropzone-hint {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.2em;
    font-weight: 500;
}

/* ═══ PREVIEW ═══ */
.upload-preview {
    display: none;
    position: relative;
    width: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.upload-dropzone.has-file .upload-preview {
    display: block;
}

.upload-preview-img {
    width: 100%;
    max-height: 150px;
    object-fit: contain;
    display: block;
}

.upload-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 5;
    font-family: inherit;
}

.upload-remove-btn:hover {
    background: rgba(220, 38, 38, 0.6);
    border-color: rgba(220, 38, 38, 0.5);
    color: #fff;
}

/* ═══ FILE INFO ═══ */
.upload-info {
    display: none;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    letter-spacing: 0.05em;
}

.upload-dropzone.has-file~.upload-info {
    display: block;
}

.upload-info-name {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
}

.upload-info-size {
    margin-left: 6px;
    color: rgba(255, 255, 255, 0.3);
}

/* ═══ RECOMMENDATIONS ═══ */
.upload-tips {
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
}

.upload-tips-title {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
}

.upload-tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.upload-tips-list li {
    font-size: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.3);
}

.upload-tips-list li::before {
    content: '•';
    margin-right: 6px;
    color: rgba(255, 255, 255, 0.2);
}

/* ═══ ERROR MESSAGE ═══ */
.upload-error {
    display: none;
    font-size: 10px;
    color: #f87171;
    text-align: center;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.upload-error.visible {
    display: block;
}

/* ═══ SUBMIT BUTTON ═══ */
.upload-submit {
    width: 100%;
    border-radius: 1rem;
    padding: 0.75rem;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #FFF 0%, #A0A0A0 100%);
    color: #000;
    font-weight: 800;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.3;
    pointer-events: none;
}

.upload-submit.enabled {
    opacity: 1;
    pointer-events: auto;
}

.upload-submit.enabled:hover {
    transform: scale(1.03);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.25);
}

.upload-submit.uploading {
    opacity: 0.5;
    pointer-events: none;
}

/* ═══ MOBILE ═══ */
@media (max-width: 768px) {
    #view-upload {
        padding: 0.75rem;
    }

    .upload-card {
        max-width: 100%;
        padding: 1.25rem;
        border-radius: 1.25rem;
    }

    .upload-dropzone {
        min-height: 160px;
        padding: 2rem 1rem;
    }

    .upload-preview-img {
        max-height: 220px;
    }

    .upload-dropzone-icon {
        width: 36px;
        height: 36px;
    }
}