:root { 
    --primary-accent: #007AFF; 
    --secondary-accent: #5856D6; 
    --brand-teal: #41A594;
    --background-card: rgba(255, 255, 255, 0.98); 
    --text-dark: #1c1e21; 
    --text-medium: #606770; 
    --border-interactive: #ced4da; 
    --border-light: #dee2e6;
    --success-color-icon: #28a745; 
    --error-color: #dc3545; 
}

/* --- FONDO ANIMADO + ADORNOS FLOTANTES --- */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: #4e54c8;
    background: linear-gradient(-45deg, #4e54c8, #8f94fb, #41a594, #2d7a6c);
    background-size: 400% 400%;
    animation: gradientBG 25s ease infinite;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #333;
}
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.background-shapes {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
}
.background-shapes li {
    position: absolute; display: block; list-style: none;
    width: 20px; height: 20px;
    background: rgba(255, 255, 255, 0.15);
    animation: float 25s linear infinite;
    bottom: -150px;
    border-radius: 10%;
}
.background-shapes li:nth-child(1) { left: 25%; width: 80px; height: 80px; animation-delay: 0s; }
.background-shapes li:nth-child(2) { left: 10%; width: 20px; height: 20px; animation-delay: 2s; animation-duration: 12s; }
.background-shapes li:nth-child(3) { left: 70%; width: 20px; height: 20px; animation-delay: 4s; }
.background-shapes li:nth-child(4) { left: 40%; width: 60px; height: 60px; animation-delay: 0s; animation-duration: 18s; }
.background-shapes li:nth-child(5) { left: 65%; width: 20px; height: 20px; animation-delay: 0s; }
.background-shapes li:nth-child(6) { left: 75%; width: 110px; height: 110px; animation-delay: 3s; }
.background-shapes li:nth-child(7) { left: 35%; width: 150px; height: 150px; animation-delay: 7s; }
.background-shapes li:nth-child(8) { left: 50%; width: 25px; height: 25px; animation-delay: 15s; animation-duration: 45s; }
@keyframes float {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-120vh) rotate(720deg); opacity: 0; }
}

/* --- CABECERA --- */
.page-header { padding: 1rem 2rem; width: 100%; z-index: 10; }
.navbar-brand img { height: 40px; border-radius: 8px; }
.navbar-brand .navbar-brand-text { color: white; font-weight: 600; font-size: 1.25rem; }
.header-nav .nav-link { color: rgba(255, 255, 255, 0.8); font-weight: 500; border-radius: 8px; transition: all 0.2s ease-in-out; padding: 0.5rem 1rem; }
.header-nav .nav-link:hover { color: white; background-color: rgba(255, 255, 255, 0.1); }
.header-actions .header-icon { color: rgba(255, 255, 255, 0.8); font-size: 1.5rem; transition: all 0.2s ease-in-out; }
.header-actions .header-icon:hover { color: white; transform: scale(1.1); }
.header-actions .btn-chat { background-color: white; color: var(--primary-accent); border-radius: 50px; font-weight: 600; padding: 0.5rem 1.2rem; transition: all 0.2s ease-in-out; }
.header-actions .btn-chat:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
@media (max-width: 991px) { .page-header .navbar { background-color: rgba(0,0,0,0.2); backdrop-filter: blur(5px); border-radius: 15px; } }

/* --- ESTRUCTURA Y TARJETA --- */
.page-wrapper { flex-grow: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.upload-card { 
    background-color: var(--background-card); padding: 2.5rem; border-radius: 20px; 
    box-shadow: 0 16px 40px rgba(0,0,0,0.1); width: 100%; max-width: 750px;
    transition: all 0.3s ease-in-out; position: relative;
}
.upload-card:hover { transform: translateY(-5px); box-shadow: 0 24px 50px rgba(0,0,0,0.15); }
.form-version { position: absolute; bottom: 10px; right: 15px; font-size: 0.75rem; color: #adb5bd; }

/* --- TÍTULOS Y ZONA DE INICIO --- */
h1.form-title { color: var(--text-dark); font-weight: 700; font-size: 2.25rem; margin-bottom: 0.5rem; }
p.form-subtitle { color: var(--text-medium); font-size: 1rem; margin-bottom: 2.5rem; }
#dropZone { 
    position: relative; overflow: hidden;
    background-color: #f8f9fc; border: 2px dashed var(--border-interactive); 
    border-radius: 16px; padding: 3rem 2rem; cursor: pointer; 
    transition: all 0.2s ease-in-out; text-align: center; 
}
#dropZone.dragover { background-color: #eef6ff; border-color: var(--primary-accent); border-style: solid; box-shadow: 0 0 15px rgba(0, 122, 255, 0.2); }

/* --- ANIMACIÓN DE FONDO PARA DROPZONE --- */
.animated-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.animated-bg .bg-icon {
    position: absolute; color: var(--primary-accent); opacity: 0;
    animation: drop-animation 10s linear infinite;
}
.animated-bg .bg-icon.bi-folder { font-size: 2.5rem; }
.animated-bg .bg-icon.bi-file-earmark-image { font-size: 2rem; }
.animated-bg .bg-icon:nth-child(1) { left: 10%; animation-delay: 0s; }
.animated-bg .bg-icon:nth-child(2) { left: 20%; animation-delay: 4s; }
.animated-bg .bg-icon:nth-child(3) { left: 40%; animation-delay: 2s; }
.animated-bg .bg-icon:nth-child(4) { left: 60%; animation-delay: 7s; }
.animated-bg .bg-icon:nth-child(5) { left: 75%; animation-delay: 1s; }
.animated-bg .bg-icon:nth-child(6) { left: 85%; animation-delay: 5s; }
#dropZone > * { position: relative; z-index: 1; }
@keyframes drop-animation {
    0% { transform: translateY(-100px) rotate(-15deg); opacity: 0; }
    20%, 80% { opacity: 0.1; }
    100% { transform: translateY(120%) rotate(15deg); opacity: 0; }
}

/* --- BOTONES DE LA PANTALLA INICIAL --- */
.file-select-button { 
    display: inline-flex; align-items: center; justify-content: center; 
    color: white; padding: 0.75rem 1.5rem; border-radius: 8px; font-weight: 500; 
    text-decoration: none; border: none; cursor: pointer; 
    background-size: 300% 100%; transition: all 0.4s ease-in-out;
}
.file-select-button.files { background-image: linear-gradient(to right, #007aff, #0056b3, #007aff); }
.file-select-button.folder { background-image: linear-gradient(to right, #5856D6, #3D3B9E, #5856D6); }
.file-select-button:hover { background-position: 100% 0; }

/* --- ESTILOS DEL FORMULARIO DE DATOS --- */
.form-label.fw-bold { font-weight: 600 !important; color: var(--text-dark); margin-bottom: 0.5rem; }
.input-wrapper { position: relative; }
.form-control {
    padding: 0.85rem 1rem; font-size: 1rem; border: 1px solid var(--border-light);
    border-radius: 8px; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus { border-color: var(--primary-accent); box-shadow: 0 0 0 0.2rem rgba(0, 122, 255, 0.2); }

/* Clases de validación de Bootstrap manejarán los íconos como background-image */
.form-control.is-invalid { border-color: var(--error-color) !important; }
.form-control.is-valid { border-color: var(--success-color-icon) !important; }

.validation-message { color: var(--error-color); font-size: 0.875rem; margin-top: 0.25rem; display: none; }
.info-fields-col { display: flex; flex-direction: column; justify-content: center; }

/* --- ESTILOS DE LA LISTA DE ARCHIVOS --- */
.selection-list-outer-container {
    border: 2px dashed var(--border-interactive); border-radius: 16px; padding: 0.5rem;
    background-color: #f8f9fc; transition: all 0.2s ease-in-out;
}
.selection-list-outer-container.dragover { background-color: #eef6ff; border-color: var(--primary-accent); border-style: solid; }
.file-list-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 0.5rem 0.25rem 0.5rem;
    border-bottom: 1px dashed var(--border-light);
    font-size: 0.75rem; 
    color: var(--text-medium);
}
.clear-all-btn {
    background: none; border: none; color: var(--error-color);
    font-size: 0.75rem; font-weight: 500; cursor: pointer; text-decoration: underline;
}
.selection-list-container {
    max-height: 220px; overflow-y: auto;
}
.selection-list-container::-webkit-scrollbar { width: 6px; }
.selection-list-container::-webkit-scrollbar-track { background: transparent; }
.selection-list-container::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 10px; }
.drop-zone-prompt {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; color: var(--text-medium); flex-grow: 1; min-height: 180px;
}
.drop-zone-prompt i { font-size: 3rem; color: var(--primary-accent); opacity: 0.6; }
.drop-zone-prompt p { font-weight: 500; margin-top: 0.5rem; }

.file-list { list-style: none; padding: 0.5rem 0 0 0; margin: 0; }
.file-list-item {
    display: flex; align-items: center; padding: 0.5rem;
    border-radius: 6px;
}
.file-list-item:hover { background-color: #f0f2f5; }
.item-icon { color: var(--primary-accent); margin-right: 0.75rem; font-size: 1.25rem; }
.item-icon.bi-folder-fill { color: var(--secondary-accent); }
.item-title { font-weight: 500; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-details {
    margin-left: auto; text-align: right; color: var(--text-medium);
    font-size: 0.8rem; white-space: nowrap; padding-left: 1rem;
}
.remove-item-btn {
    background: none; border: none; color: var(--text-medium); font-size: 1.5rem;
    line-height: 1; cursor: pointer; padding: 0 0.5rem; transition: color 0.2s;
}
.remove-item-btn:hover { color: var(--error-color); }
.add-more-buttons { display: flex; gap: 0.5rem; justify-content: center; }

.add-more-buttons .btn-add-folder {
    background-color: var(--secondary-accent); border-color: var(--secondary-accent);
    color: white;
}
.add-more-buttons .btn-add-folder:hover {
    background-color: #3D3B9E; border-color: #3D3B9E;
    color: white;
}
.add-more-buttons .btn-add-files {
    background-color: #6c757d; /* Este es el color gris estándar de Bootstrap (secondary) */
    border-color: #6c757d;
    color: white;
}
.add-more-buttons .btn-add-files:hover {
    background-color: #5a6268; /* Un gris un poco más oscuro para el efecto hover */
    border-color: #545b62;
}

/* --- BOTÓN DE ENVÍO FINAL --- */
#submitButton.btn-lg {
    font-weight: 600; padding: 1.25rem 1.75rem; font-size: 1.15rem; width: 100%;
    border-radius: 12px; 
    border: none; color: white;
    background-size: 300% 100%; transition: all 0.4s ease-in-out;
    background-image: linear-gradient(to right, var(--brand-teal), var(--primary-accent), var(--brand-teal));
}
#submitButton:hover:not(:disabled) { background-position: 100% 0; }
#submitButton:disabled { background-image: none; background-color: #aeb8c3; cursor: not-allowed; }

/* --- PANTALLA DE PROGRESO Y ÉXITO --- */
#uploadProgressText { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem !important; }
#uploadDetails { font-size: 0.9rem; margin-bottom: 0.25rem !important; }
#uploadSpeed { font-size: 0.9rem; margin-bottom: 0.25rem !important; color: var(--text-medium); font-weight: 500;}
#uploadTimeRemaining { font-size: 0.8rem; margin-bottom: 0.5rem !important;}
/* Estilos para botones en la pantalla de éxito */
.btn-whatsapp-confirm { background-color: #25D366; color: white; padding: 0.7rem 1.5rem; font-size: 1rem; font-weight: 600; border-radius: 8px; }
.btn-whatsapp-confirm:hover { background-color: #128C7E; color: white; }
.btn-new-upload { background-color: var(--primary-accent); color: white; padding: 0.7rem 1.5rem; font-size: 1rem; font-weight: 500; border-radius: 8px; border: none;}
.btn-new-upload:hover { background-color: #0056b3; }


/* --- FOOTER --- */
.page-footer { text-align: center; padding: 2rem 1rem; color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.page-footer a { color: white; text-decoration: none; font-weight: 500; }