/* ============================================= */
/* CEA - ENVIO DE DOCUMENTOS - ESTILOS v3       */
/* Tema: Black & Gold Premium                    */
/* ============================================= */

/* ========== TEMA PADRÃO (CLARO) ========== */
:root {
    --gold: #b8860b;
    --gold-bright: #d4a017;
    --gold-transparent: rgba(184, 134, 11, 0.15);
    --black: #f5f5f5;
    --dark-grey: #e8e8e8;
    --medium-grey: #e0e0e0;
    --white: #1a1a1a;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    background: #f5f5f5;
    color: #1a1a1a;
    font-family: 'Montserrat', 'Inter', sans-serif;
    overflow: hidden;
}

/* ========== CONTAINER ========== */
.upload-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: radial-gradient(circle at top, #f0f0f0, #f5f5f5);
}

/* ========== HEADER ========== */
.upload-header {
    background: var(--dark-grey);
    padding: 10px 16px;
    border-bottom: 1px solid var(--gold-transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    gap: 10px;
    min-height: 46px;
}

.upload-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.gold-dot {
    width: 7px; height: 7px;
    background: var(--gold);
    border-radius: 50%;
    animation: goldPulse 2s infinite ease-in-out;
}
@keyframes goldPulse {
    0%, 100% { box-shadow: 0 0 5px var(--gold); }
    50% { box-shadow: 0 0 18px var(--gold); }
}

.gold-text {
    color: var(--gold);
    font-size: 11px; font-weight: 800;
    letter-spacing: 1px; text-transform: uppercase;
}

.white-text {
    color: var(--white);
    font-size: 9px; font-weight: 300;
    letter-spacing: 0.5px;
}

.upload-status {
    display: flex; align-items: center; gap: 6px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.15);
    padding: 4px 10px; border-radius: 20px;
    flex-shrink: 0;
}
#status-text {
    font-size: 8px; color: #aaa;
    text-transform: uppercase; letter-spacing: 1px;
}
.status-dot {
    width: 6px; height: 6px;
    background: var(--success); border-radius: 50%;
    transition: all 0.3s;
}
.status-dot.uploading { background: var(--warning); animation: pulseDot 1s infinite; }
.status-dot.success { background: var(--success); }
.status-dot.error { background: var(--danger); }
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ========== BODY ========== */
.upload-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

.upload-body::-webkit-scrollbar { width: 4px; }
.upload-body::-webkit-scrollbar-track { background: transparent; }
.upload-body::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 10px; }

/* ========== LAYOUT EM DUAS COLUNAS ========== */
.upload-layout {
    display: flex;
    gap: 24px;
    width: 100%;
    height: 100%;
    min-height: 0;
    align-items: stretch;
}

.upload-col-left {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    
}

.upload-col-right {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    
}

/* Separador dourado */
.upload-divider {
    width: 1px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(212, 175, 55, 0.3) 20%,
        rgba(212, 175, 55, 0.5) 50%,
        rgba(212, 175, 55, 0.3) 80%,
        transparent 100%
    );
    flex-shrink: 0;
}

/* ========== CAMPOS ========== */
.field-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 2px;
    margin-top: 4px;
}
.field-label:first-child { margin-top: 0; }

.upload-input, .upload-textarea {
    background: var(--medium-grey);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--white) !important;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
    outline: none;
    resize: none;
    width: 100%;
}
.upload-input:focus, .upload-textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
}
.upload-input::placeholder, .upload-textarea::placeholder {
    color: #555; font-size: 10px;
}

.char-counter {
    text-align: right;
    font-size: 8px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.char-counter.warning { color: var(--warning); }
.char-counter.limit { color: var(--danger); }

/* ========== DROP ZONE ========== */
.drop-zone {
    border: 2px dashed var(--gold-transparent);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(212, 175, 55, 0.02);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.06);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.06);
}
.drop-icon { margin-bottom: 8px; }
.drop-text { font-size: 12px; font-weight: 600; color: var(--white); margin-bottom: 3px; }
.drop-subtext { font-size: 8px; color: var(--text-secondary); margin-bottom: 6px; }
.drop-limit { font-size: 8px; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; }

/* ========== PROGRESSO ========== */
.total-progress {
    background: var(--medium-grey);
    border-radius: 10px;
    padding: 10px 14px;
    border: 1px solid var(--gold-transparent);
    flex-shrink: 0;
}
.progress-info { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.progress-label { font-size: 9px; color: var(--text-secondary); text-transform: uppercase; }
.progress-value { font-size: 11px; font-weight: 700; color: var(--gold); }
.progress-separator { font-size: 9px; color: #555; }
.progress-limit { font-size: 9px; color: var(--text-secondary); }
.progress-bar-container { height: 5px; background: rgba(255,255,255,0.05); border-radius: 3px; overflow: hidden; }
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-bright));
    border-radius: 3px; transition: width 0.4s ease; width: 0%;
}
.progress-bar-fill.warning { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.progress-bar-fill.danger { background: linear-gradient(90deg, #f87171, var(--danger)); }

/* ========== LISTA DE ARQUIVOS ========== */
.upload-col-right .file-list {
    flex: 1;
    overflow-y: auto;
    min-height: 100px;
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.04);
}
.upload-col-right .file-list::-webkit-scrollbar { width: 4px; }
.upload-col-right .file-list::-webkit-scrollbar-track { background: transparent; }
.upload-col-right .file-list::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 10px; }

.file-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #555;
    font-size: 11px;
    gap: 6px;
    text-align: center;
    padding: 20px;
}

.file-item {
    display: flex; align-items: center; gap: 10px;
    background: var(--medium-grey);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px; padding: 8px 12px;
    transition: all 0.3s;
    animation: fadeIn 0.3s ease;
    margin-bottom: 6px;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.file-item:hover { border-color: var(--gold-transparent); background: #222; }
.file-item.removing { animation: fadeOut 0.3s ease forwards; }
@keyframes fadeOut { to { opacity: 0; transform: translateX(30px); } }

.file-icon { font-size: 18px; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 10px; font-weight: 500; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 8px; color: var(--text-secondary); }

.file-remove {
    background: none; border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger); width: 22px; height: 22px;
    border-radius: 50%; cursor: pointer; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s; flex-shrink: 0;
}
.file-remove:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ========== MENSAGENS ========== */
.upload-messages { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
    flex-shrink: 0;
    max-height: 120px;
    overflow-y: auto;
}
.msg { padding: 8px 12px; border-radius: 6px; font-size: 9px; text-align: center; animation: fadeIn 0.3s ease; }
.msg-error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }
.msg-success { background: rgba(37, 211, 102, 0.1); border: 1px solid rgba(37, 211, 102, 0.3); color: #6ee7b7; }
.msg-info { background: rgba(212, 175, 55, 0.1); border: 1px solid rgba(212, 175, 55, 0.3); color: var(--gold); }

/* ========== FOOTER ========== */
.upload-footer {
    flex-shrink: 0;
    padding: 10px 16px;
    background: var(--dark-grey);
    border-top: 1px solid var(--gold-transparent);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.btn-clear {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    width: 36px; height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}
.btn-clear:hover { background: rgba(239, 68, 68, 0.1); border-color: var(--danger); }

.btn-send {
    background: var(--gold);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-send:hover { background: var(--gold-bright); transform: scale(1.03); box-shadow: 0 4px 18px rgba(212, 175, 55, 0.3); }
.btn-send:active { transform: scale(0.97); }
.btn-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ========== RESPONSIVO ========== */
@media (max-width: 768px) {
    .upload-header { padding: 8px 12px; }
    .white-text { display: none; }
    
    .upload-body { padding: 12px; }
    
    .upload-layout {
        flex-direction: column;
        gap: 14px;
    }
    
    .upload-col-left,
    .upload-col-right {
        max-width: 100%;
        flex: auto;
    }
    
    .upload-divider {
        width: 100%;
        height: 1px;
        background: linear-gradient(
            90deg,
            transparent 0%,
            rgba(212, 175, 55, 0.3) 20%,
            rgba(212, 175, 55, 0.5) 50%,
            rgba(212, 175, 55, 0.3) 80%,
            transparent 100%
        );
    }
    
    .drop-zone { padding: 16px 12px; min-height: 80px; }
    .drop-text { font-size: 11px; }
    .drop-subtext { font-size: 8px; }
    
    .upload-col-right .file-list { max-height: 200px; }
    
    .upload-footer { padding: 8px 12px; }
    .btn-send { padding: 8px 16px; font-size: 10px; }
    .upload-input, .upload-textarea { font-size: 11px; padding: 8px 10px; }
}

@media (max-width: 480px) {
    .upload-layout { gap: 10px; }
    .upload-col-right .file-list { max-height: 150px; }
}
/* ========== FORÇAR LARGURA TOTAL ========== */
.upload-container {
    width: 100vw !important;
    max-width: 100vw !important;
}

.upload-body {
    width: 100% !important;
    max-width: 100% !important;
    padding: 20px 30px !important;
}

.upload-layout {
    width: 100% !important;
    max-width: 100% !important;
}

.upload-col-left,
.upload-col-right {
    flex: 1 1 50% !important;
    max-width: none !important;
}

.upload-input,
.upload-textarea {
    width: 100% !important;
    max-width: 100% !important;
}
html, body {
    scrollbar-width: thin;
    scrollbar-color: #D4AF37 #0a0a0a;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 5px;
}
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    background: #0a0a0a;
}
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background: #D4AF37;
    border-radius: 10px;
}

/* ========== TEMA PADRÃO ========== */
body {
    --gold: #b8860b;
    --gold-bright: #d4a017;
    --gold-transparent: rgba(184, 134, 11, 0.15);
    --black: #f5f5f5;
    --dark-grey: #e8e8e8;
    --medium-grey: #dddddd;
    --white: #1a1a1a;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    background: #f5f5f5;
}

body .upload-container {
    background: radial-gradient(circle at top, #f0f0f0, #f5f5f5);
}

body .upload-header {
    background: #e8e8e8;
    border-bottom: 1px solid rgba(184, 134, 11, 0.2);
}

body .upload-footer {
    background: #e8e8e8;
    border-top: 1px solid rgba(184, 134, 11, 0.2);
}

body .upload-input,
body .upload-textarea {
    background: #e0e0e0;
    border: 1px solid rgba(0,0,0,0.08);
    color: #1a1a1a !important;
}

body .upload-input::placeholder,
body .upload-textarea::placeholder {
    color: #888;
}

body .drop-zone {
    background: rgba(184, 134, 11, 0.03);
    border-color: rgba(184, 134, 11, 0.2);
}

body .total-progress {
    background: #e0e0e0;
}

body .file-item {
    background: #e0e0e0;
    border-color: rgba(0,0,0,0.05);
}

body .file-list-empty {
    color: #888;
}

body .upload-status {
    background: rgba(184, 134, 11, 0.08);
    border-color: rgba(184, 134, 11, 0.15);
}

body #status-text {
    color: #666;
}

body .upload-col-right .file-list {
    background: rgba(0,0,0,0.02);
    border-color: rgba(0,0,0,0.04);
}

/* ========== TEMA DARK ========== */
body.tema-dark {
    --gold: #D4AF37;
    --gold-bright: #f1c40f;
    --gold-transparent: rgba(212, 175, 55, 0.15);
    --black: #0a0a0a;
    --dark-grey: #1a1a1a;
    --medium-grey: #2a2a2a;
    --white: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #999;
    background: #0a0a0a;
}

body.tema-dark .upload-container {
    background: radial-gradient(circle at top, #111, #000);
}

body.tema-dark .upload-header {
    background: #1a1a1a;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

body.tema-dark .upload-footer {
    background: #1a1a1a;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

body.tema-dark .upload-input,
body.tema-dark .upload-textarea {
    background: #2a2a2a;
    border: 1px solid rgba(255,255,255,0.08);
    color: #ffffff !important;
}

body.tema-dark .upload-input::placeholder,
body.tema-dark .upload-textarea::placeholder {
    color: #555;
}

body.tema-dark .drop-zone {
    background: rgba(212, 175, 55, 0.02);
    border-color: rgba(212, 175, 55, 0.15);
}

body.tema-dark .total-progress {
    background: #2a2a2a;
}

body.tema-dark .file-item {
    background: #2a2a2a;
    border-color: rgba(255,255,255,0.05);
}

body.tema-dark .file-list-empty {
    color: #555;
}

body.tema-dark .upload-status {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.15);
}

body.tema-dark #status-text {
    color: #aaa;
}

body.tema-dark .upload-col-right .file-list {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.04);
}

body.tema-dark .drop-zone:hover {
    background: rgba(212, 175, 55, 0.06);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.06);
}

body.tema-dark .file-item:hover {
    border-color: rgba(212, 175, 55, 0.3);
    background: #222;
}