/* --- ANIMACION DE CARGA --- */
@keyframes globalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes globalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- ESTILOS BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: #f2e9d3;
    color: #1a1a1a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    animation: globalFadeIn 0.8s ease-out forwards, globalSlideUp 0.8s ease-out forwards;
}

/* --- ENCABEZADO --- */
.header {
    background-color: #f2e9d3;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 50px;
    border-bottom: 1px solid #dcd4c6;
}

.header-divider {
    height: 14px;
    background-color: #103e4d;
    width: 100%;
}

.logo-container {
    display: flex;
    align-items: center;
}

/* --- HERO SECTION --- */
.hero-section {
    padding: 40px 50px;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-section h1 {
    font-size: 2.2rem;
    color: #103e4d;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
}

.hero-section p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    text-align: center;
}

/* --- NAVEGACIÓN (TABS) --- */
.tabs-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.tab-btn {
    background-color: #e2e8f0;
    color: #475569;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background-color: #cbd5e1;
}

.tab-btn.active {
    background-color: #103e4d;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(16, 62, 77, 0.2);
}

.content-area {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* --- CONTENEDORES (TARJETAS BLANCAS) --- */
.white-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    width: 100%;
    max-width: 900px;
}

.db-container.white-card {
    max-width: 100%;
}

.view-section {
    width: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.view-section.active {
    opacity: 1;
}

/* --- ZONA DE DROP (UPLOAD) --- */
.upload-box {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    transition: all 0.3s;
    background: #f8fafc;
    margin-bottom: 25px;
}

.upload-box.dragover {
    border-color: #103e4d;
    background: rgba(16, 62, 77, 0.05);
}

.upload-icon {
    font-size: 3.5rem;
    color: #103e4d;
    margin-bottom: 15px;
}

.upload-box h3 {
    font-size: 1.2rem;
    color: #334155;
    margin-bottom: 10px;
}

.upload-box p {
    color: #64748b;
    margin-bottom: 15px;
}

/* --- BOTONES DE ACCIÓN --- */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
    text-decoration: none;
}

.btn-primary {
    background-color: #103e4d;
    color: white;
}

.btn-primary:hover {
    background-color: #0c2d38;
}

.btn-secondary {
    background-color: #e2e8f0;
    color: #334155;
}

.btn-secondary:hover {
    background-color: #cbd5e1;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-success:disabled {
    background-color: #a7f3d0;
    cursor: not-allowed;
}

.btn-danger {
    background-color: #80242b;
    color: white;
}

.btn-danger:hover {
    background-color: #5a191f;
}

.btn-delete-col {
    background-color: #80242b;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-left: 8px;
    transition: transform 0.2s;
}

.btn-delete-col:hover {
    transform: scale(1.1);
}

.actions-container {
    text-align: right;
    margin-top: 20px;
}

/* --- LISTA DE ARCHIVOS --- */
.file-list-container {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 20px;
}

.file-list-container h4 {
    margin-bottom: 10px;
    color: #103e4d;
}

#file-list {
    list-style: none;
}

#file-list li {
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#file-list li.empty-msg {
    background: transparent;
    box-shadow: none;
    color: #94a3b8;
    justify-content: center;
}

.remove-file {
    color: #ef4444;
    cursor: pointer;
    transition: color 0.2s;
}

.remove-file:hover {
    color: #b91c1c;
}

/* --- TABLA (DATABASE) --- */
.table-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

th {
    background-color: #f8fafc;
    color: #103e4d;
    font-weight: 700;
}

tbody tr:hover {
    background-color: #f1f5f9;
}

/* --- TOAST NOTIFICATIONS --- */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background-color: #10b981;
}

.toast.error {
    background-color: #80242b;
}

.toast.info {
    background-color: #3b82f6;
}