/* Reset y base */
* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #181c1f 0%, #1a1f24 100%);
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    min-height: 100vh;
    color: #e0e3e6;
}

.container {
    background: #23272a;
    max-width: 95vw;
    width: 100%;
    margin: 40px auto;
    padding: 1.5rem 1.2rem;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
    text-align: center;
}

@media (min-width: 600px) {
    .container {
        max-width: 520px;
        padding: 2rem 2.5rem;
    }
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #2e353a;
}

h2, h3 {
    margin: 0;
    color: #4ade80;
    font-weight: 600;
    letter-spacing: 0.01em;
}

h2 {
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h2 i {
    font-size: 1.4rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.audio-count {
    font-size: 0.85rem;
    color: #8b949e;
    background: #2e353a;
    padding: 0.3rem 0.7rem;
    border-radius: 12px;
}

/* Inputs */
input[type="text"], input[type="password"], input[type="file"] {
    width: 100%;
    padding: 0.7rem;
    margin: 0.5rem 0;
    border: 1.5px solid #2e353a;
    border-radius: 8px;
    font-size: 1rem;
    background: #1a1f24;
    color: #e0e3e6;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus, input[type="password"]:focus, input[type="file"]:focus {
    border-color: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
}

/* Botones generales */
button {
    background: #22c55e;
    color: #fff;
    border: none;
    padding: 0.7rem 1.3rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 0.5rem;
    font-weight: 500;
    transition: background 0.2s, transform 0.1s;
}

button:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

/* Flash messages */
.flash {
    background: #26332a;
    color: #4ade80;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
    border: 1px solid #4ade80;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logout */
.logout {
    color: #8b949e;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.logout:hover {
    background: #2e353a;
    color: #e0e3e6;
}

/* Audio list */
.audio-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.audio-item {
    margin-bottom: 0.8rem;
    background: #1a1f24;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #2e353a;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.audio-item:hover {
    border-color: #3d444d;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.audio-info {
    display: flex;
    align-items: center;
    margin-bottom: 0.7rem;
}

.audio-name {
    font-size: 0.95rem;
    color: #e0e3e6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    word-break: break-all;
    text-align: left;
}

.audio-name i {
    color: #4ade80;
    flex-shrink: 0;
}

audio {
    width: 100%;
    margin: 0.5rem 0;
    background: #181c1f;
    border-radius: 8px;
    height: 40px;
}

audio::-webkit-media-controls-panel {
    background: #181c1f;
}

.audio-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Botón descargar */
.download-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.download-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Botón eliminar */
.delete-btn {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-weight: 500;
    margin: 0;
}

.delete-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Estado vacío */
.empty-state {
    padding: 3rem 1rem;
    color: #6b7280;
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-size: 1rem;
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #2e353a;
}

.page-btn {
    background: #2e353a;
    color: #e0e3e6;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    cursor: pointer;
    border: none;
}

.page-btn:hover:not(.disabled) {
    background: #3d444d;
    transform: translateY(-1px);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.page-info {
    font-size: 0.9rem;
    color: #8b949e;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #23272a;
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.2s;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-icon {
    width: 60px;
    height: 60px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.modal-icon i {
    font-size: 1.8rem;
    color: #ef4444;
}

.modal h3 {
    color: #e0e3e6;
    margin-bottom: 0.5rem;
}

.modal p {
    color: #8b949e;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.modal p strong {
    color: #e0e3e6;
    word-break: break-all;
}

.modal-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}

.btn-cancel {
    background: #2e353a;
    color: #e0e3e6;
    padding: 0.7rem 1.2rem;
    margin: 0;
}

.btn-cancel:hover {
    background: #3d444d;
}

.btn-confirm {
    background: #ef4444;
    padding: 0.7rem 1.2rem;
    margin: 0;
}

.btn-confirm:hover {
    background: #dc2626;
}

/* Animación fade-in */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .modal-actions {
        flex-direction: column;
    }
    
    .header {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}
