/* --- Nueva Paleta de Colores ---
Fondo Principal: #0D1117
Fondo Contenedor: #161B22
Bordes/Separadores: #30363d
Texto Principal: #C9D1D9
Texto Secundario: #8B949E
Acento Verde (Botones): #2cb67d
Acento Azul (Hover/Interactivo): #4cc9f0
*/

body {
    font-family: 'Poppins', sans-serif;
    background-color: #0D1117;
    color: #C9D1D9;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.container {
    background-color: #161B22;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 30px 40px;
    width: 100%;
    max-width: 800px; /* Ancho por defecto */
    box-sizing: border-box;
    text-align: center;
    border: 1px solid #30363d;
    transition: max-width 0.3s ease; /* Transición suave del ancho */
    flex: 1 0 auto;
    margin: 0 auto;
}

h1, h2 {
    color: #C9D1D9;
    margin-bottom: 25px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

h2 { margin-bottom: 0; }
h1 i, h2 i { color: #2cb67d; }

hr {
    border: none;
    border-top: 1px solid #30363d;
    margin: 40px 0;
}

/* Sección de Carga */
.upload-section {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.drop-area {
    border: 2px dashed #30363d;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    margin-bottom: 25px;
    background-color: #0D1117;
    width: 100%;
}

.drop-area:hover,
.drop-area.highlight {
    background-color: #182c25;
    border-color: #2cb67d;
}

.drop-area i {
    font-size: 3em;
    color: #2cb67d;
    margin-bottom: 15px;
    display: block;
    transition: transform 0.3s ease;
}

.drop-area:hover i {
    transform: scale(1.1) translateY(-5px);
}

.drop-area p {
    margin: 0;
    font-size: 1.1em;
    color: #8B949E;
    font-weight: 500;
}

.upload-button {
    background: linear-gradient(45deg, #2cb67d, #2f9e74);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(44, 182, 125, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.upload-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(44, 182, 125, 0.3);
}

.upload-button:disabled {
    background: #30363d;
    color: #8B949E;
    cursor: not-allowed;
    box-shadow: none;
}

.upload-status {
    margin-top: 20px;
    font-size: 0.95em;
    color: #8B949E;
    min-height: 20px;
    font-weight: 500;
}

.progress-bar-container {
    width: 100%;
    max-width: 400px;
    background-color: #0D1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    margin-top: 15px;
    padding: 3px;
    box-sizing: border-box;
    display: none;
}

.progress-bar {
    height: 12px;
    background-color: #2cb67d;
    border-radius: 5px;
    width: 0%;
    transition: width 0.4s ease;
}

/* Estilos para el encabezado de la lista y el filtro */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap; /* Para que se adapte en móvil */
    gap: 15px;
}

.filter-select {
    background-color: #0D1117;
    color: #C9D1D9;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 8px 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9em;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.filter-select:hover {
    border-color: #4cc9f0;
}

.filter-select:focus {
    outline: none;
    border-color: #4cc9f0;
    box-shadow: 0 0 0 2px rgba(76, 201, 240, 0.3);
}

/* Lista de Archivos */
.file-list {
    display: flex; /* Por defecto para móvil */
    flex-direction: column;
    gap: 12px;
    text-align: left;
    min-height: 100px;
    max-height: 500px; /* Más altura para el layout de 2 columnas */
    overflow-y: auto;
    padding: 5px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: #161B22;
    border: 1px solid #30363d;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.file-item:hover {
    transform: translateX(5px);
    background-color: #21262d;
    border-color: #4cc9f0;
}

.file-icon-wrapper {
    font-size: 1.5em;
    color: #4cc9f0;
    margin-right: 15px;
    flex-shrink: 0;
    width: 25px;
    text-align: center;
}

.file-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: #C9D1D9;
    word-break: break-all;
}

.file-info {
    font-size: 0.8em;
    color: #8B949E;
    white-space: nowrap;
}

.file-actions {
    margin-left: 20px;
}

.download-icon {
    font-size: 1.2em;
    color: #8B949E;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.file-item:hover .download-icon {
    opacity: 1;
    color: #C9D1D9;
}

.file-list p {
    color: #8B949E;
    text-align: center;
    margin-top: 30px;
    font-style: italic;
    width: 100%; /* Para que ocupe todo el ancho en grid */
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #161B22;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #2cb67d;
}

/* Layout para Escritorio */
@media (min-width: 769px) {
    .container {
        max-width: 1100px; /* Hacemos el contenedor más ancho */
    }

    .file-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* Dos columnas */
        gap: 15px; /* Espacio entre los items */
    }

    /* En modo grid, el hover no debe mover todo el item a un lado */
    .file-item:hover {
        transform: translateY(-3px); /* Un efecto de elevación sutil */
    }
}

/* Estilos para Móviles (Responsive) */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 20px;
    }
    h1 {
        font-size: 1.5em;
    }
    h2 {
        font-size: 1.3em;
    }
    .list-header {
        justify-content: center;
    }
    .drop-area {
        padding: 30px 15px;
    }
    .drop-area p {
        font-size: 1em;
    }
    .file-item {
        padding: 10px;
    }
    .file-icon-wrapper {
        margin-right: 10px;
    }
    .file-name {
        font-size: 0.9em;
    }
    .file-info {
        font-size: 0.7em;
    }
}

/* Footer estilizado mejorado */
.footer {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    color: #8B949E;
    font-size: 1em;
    padding: 20px 0 10px 0;
    margin-top: 40px;
    background: none;
    letter-spacing: 0.5px;
    font-weight: 500;
    position: static;
    left: unset;
    right: unset;
    transform: none;
}

/* --- Nueva Paleta de Colores ---
Fondo Principal: #0D1117
Fondo Contenedor: #161B22
Bordes/Separadores: #30363d
Texto Principal: #C9D1D9
Texto Secundario: #8B949E
Acento Verde (Botones): #2cb67d
Acento Azul (Hover/Interactivo): #4cc9f0
Error/Eliminar Rojo: #e5534b
*/

/* Sección de Carga */
.upload-section { margin-bottom: 30px; display: flex; flex-direction: column; align-items: center; }
.drop-area { border: 2px dashed #30363d; border-radius: 10px; padding: 40px 20px; text-align: center; cursor: pointer; transition: background-color 0.3s ease, border-color 0.3s ease; margin-bottom: 25px; background-color: #0D1117; width: 100%; }
.drop-area:hover, .drop-area.highlight { background-color: #182c25; border-color: #2cb67d; }
.drop-area i { font-size: 3em; color: #2cb67d; margin-bottom: 15px; display: block; transition: transform 0.3s ease; }
.drop-area:hover i { transform: scale(1.1) translateY(-5px); }
.drop-area p { margin: 0; font-size: 1.1em; color: #8B949E; font-weight: 500; }
.upload-button { background: linear-gradient(45deg, #2cb67d, #2f9e74); color: white; padding: 12px 25px; border: none; border-radius: 8px; cursor: pointer; font-size: 1.1em; font-weight: 600; transition: all 0.3s ease; width: 100%; max-width: 300px; margin-top: 15px; box-shadow: 0 4px 15px rgba(44, 182, 125, 0.2); display: flex; align-items: center; justify-content: center; gap: 10px; }
.upload-button:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(44, 182, 125, 0.3); }
.upload-button:disabled { background: #30363d; color: #8B949E; cursor: not-allowed; box-shadow: none; }
.upload-status { margin-top: 20px; font-size: 0.95em; color: #8B949E; min-height: 20px; font-weight: 500; }
.progress-bar-container { width: 100%; max-width: 400px; background-color: #0D1117; border: 1px solid #30363d; border-radius: 8px; margin-top: 15px; padding: 3px; box-sizing: border-box; display: none; }
.progress-bar { height: 12px; background-color: #2cb67d; border-radius: 5px; width: 0%; transition: width 0.4s ease; }

/* Controles de Lista */
.list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.filter-controls { display: flex; gap: 10px; align-items: center; }
.search-input { background-color: #0D1117; color: #C9D1D9; border: 1px solid #30363d; border-radius: 6px; padding: 8px 12px; font-family: 'Poppins', sans-serif; font-size: 0.9em; transition: border-color 0.2s ease, box-shadow 0.2s ease; width: 180px; }
.search-input::placeholder { color: #8B949E; }
.search-input:focus { outline: none; border-color: #4cc9f0; box-shadow: 0 0 0 2px rgba(76, 201, 240, 0.3); }
.filter-select { background-color: #0D1117; color: #C9D1D9; border: 1px solid #30363d; border-radius: 6px; padding: 8px 12px; font-family: 'Poppins', sans-serif; font-size: 0.9em; cursor: pointer; transition: border-color 0.2s ease, background-color 0.2s ease; }
.filter-select:hover { border-color: #4cc9f0; }
.filter-select:focus { outline: none; border-color: #4cc9f0; box-shadow: 0 0 0 2px rgba(76, 201, 240, 0.3); }

/* Lista de Archivos */
.file-list { display: flex; flex-direction: column; gap: 12px; text-align: left; min-height: 100px; max-height: 500px; overflow-y: auto; padding: 5px; }
.file-item { display: flex; align-items: center; padding: 12px 15px; background-color: #161B22; border: 1px solid #30363d; border-radius: 8px; transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease; cursor: default; }
.file-item:hover { background-color: #21262d; }
.file-item:hover .action-icon { opacity: 1; }
.file-icon-wrapper { font-size: 1.5em; color: #4cc9f0; margin-right: 15px; flex-shrink: 0; width: 25px; text-align: center; }
.file-details { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; }
.file-name { font-weight: 500; color: #C9D1D9; word-break: break-all; }
.file-info { font-size: 0.8em; color: #8B949E; white-space: nowrap; }
.file-actions { margin-left: 20px; display: flex; gap: 15px; }
.action-icon { font-size: 1.2em; color: #8B949E; opacity: 0; transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease; cursor: pointer; }
.action-icon:hover { transform: scale(1.2); }
.download-icon:hover { color: #4cc9f0; }
.copy-link-icon:hover { color: #C9D1D9; }
.delete-icon:hover { color: #e5534b; }
.file-list p { color: #8B949E; text-align: center; margin-top: 30px; font-style: italic; width: 100%; }

/* Skeleton Loader */
.skeleton-item { background-color: #161B22; border: 1px solid #30363d; border-radius: 8px; padding: 12px 15px; display: flex; align-items: center; gap: 15px; }
.skeleton-icon { width: 25px; height: 28px; background-color: #30363d; border-radius: 4px; flex-shrink: 0; }
.skeleton-details { flex-grow: 1; }
.skeleton-line { height: 16px; background-color: #30363d; border-radius: 4px; margin-bottom: 8px; }
.skeleton-line.short { width: 50%; height: 12px; margin-bottom: 0; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #161B22; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #2cb67d; }

/* Layout Escritorio */
@media (min-width: 769px) {
    .container { max-width: 1100px; }
    .file-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .file-item:hover { transform: translateY(-3px); border-color: #4cc9f0; }
}

/* Layout Móvil */
@media (max-width: 768px) {
    body { padding: 10px; }
    .container { padding: 20px; }
    h1 { font-size: 1.5em; }
    h2 { font-size: 1.3em; }
    .list-header, .filter-controls { flex-direction: column; align-items: stretch; }
    .search-input { width: auto; }
    .file-item { padding: 10px; }
    .file-icon-wrapper { margin-right: 10px; }
    .file-name { font-size: 0.9em; }
    .file-info { font-size: 0.7em; }
}

/* Footer */
.footer { width: 100%; box-sizing: border-box; text-align: center; color: #8B949E; font-size: 1em; padding: 20px 0 10px 0; margin-top: 40px; background: none; letter-spacing: 0.5px; font-weight: 500; }