/* ── Variables (idénticas al portfolio) ── */
:root {
    --color-yellow: #fbf9c4;
    --color-orange: #FF7F50;
    --color-purple: #D9C3FA;
    --color-green: #CAFA9D;
    --color-white: #FFFFFF;
    --color-blue-zone0: #0A1A2B;
    --color-blue-zone1: #0F1624;
    --color-blue-zone2: #1B2639;
    --color-blue-zone3: #283B5B;
    --color-blue-zone4: #384E7A;
    --color-accent: #88C4FF;
    --transition-speed: 0.3s;
    --border-radius: 10px;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: hidden; }

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: var(--color-white);
    background-color: var(--color-blue-zone1);
    background-image:
        radial-gradient(ellipse at 30% 30%, rgba(60,1,60,0.07) 0%, rgba(128,0,128,0.05) 40%, transparent 70%),
        radial-gradient(circle at 80% 15%, rgba(150,20,60,0.04) 0%, rgba(150,20,60,0.03) 30%, transparent 60%),
        radial-gradient(ellipse at 40% 80%, rgba(0,28,85,0.08) 0%, rgba(0,50,150,0.04) 50%, transparent 75%),
        radial-gradient(circle at 10% 60%, rgba(159,27,27,0.07) 0%, transparent 60%),
        radial-gradient(ellipse at 85% 30%, rgba(0,90,90,0.13) 0%, rgba(0,128,128,0.05) 40%, transparent 70%);
    min-height: 100vh;
    background-blend-mode: screen;
}

/* ── Estrellas ── */
.stars-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle var(--twinkle-duration, 4s) ease-in-out infinite;
}

.star.with-glow { box-shadow: 0 0 10px 2px rgba(255,255,255,0.3); }

@keyframes twinkle {
    0%   { opacity: 0; }
    50%  { opacity: var(--star-opacity, 0.5); }
    100% { opacity: 0; }
}

/* ── Layout ── */
.page-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

/* ── Header ── */
header {
    background-color: var(--color-blue-zone0);
    border-bottom: 2px solid rgba(255,127,80,0.3);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    padding: 0.9rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-brand {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.65rem;
    color: var(--color-accent);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.header-back {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.82rem;
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    transition: color var(--transition-speed);
    white-space: nowrap;
}
.header-back:hover { color: var(--color-orange); }

/* ── Glass card ── */
.card {
    background: rgba(27,38,57,0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(136,196,255,0.15);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

/* ── Botones ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-speed);
    line-height: 1;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--color-accent);
    color: var(--color-blue-zone1);
}
.btn-primary:hover:not(:disabled) { background: #a8d8ff; transform: translateY(-1px); }

.btn-danger {
    background: rgba(255,80,80,0.15);
    color: #ff8888;
    border: 1px solid rgba(255,80,80,0.25);
}
.btn-danger:hover:not(:disabled) { background: rgba(255,80,80,0.3); transform: translateY(-1px); }

.btn-ghost {
    background: rgba(136,196,255,0.1);
    color: var(--color-accent);
    border: 1px solid rgba(136,196,255,0.2);
}
.btn-ghost:hover:not(:disabled) { background: rgba(136,196,255,0.2); transform: translateY(-1px); }

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.78rem; }

.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }

/* ── Inputs ── */
.field { display: flex; flex-direction: column; gap: 0.4rem; }

.field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"],
input[type="password"],
input[type="search"] {
    background: rgba(10,26,43,0.8);
    border: 1px solid rgba(136,196,255,0.2);
    border-radius: var(--border-radius);
    color: var(--color-white);
    padding: 0.65rem 1rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    width: 100%;
    transition: border-color var(--transition-speed);
}

input:focus { outline: none; border-color: var(--color-accent); }
input::placeholder { color: rgba(255,255,255,0.25); }

/* ── Upload zone ── */
.drop-zone {
    border: 2px dashed rgba(136,196,255,0.3);
    border-radius: var(--border-radius);
    padding: 2.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    background: rgba(10,26,43,0.4);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--color-accent);
    background: rgba(136,196,255,0.05);
}

.drop-zone-icon { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; }

.drop-zone p { color: rgba(255,255,255,0.6); font-size: 0.9rem; }

.drop-zone .link-label {
    color: var(--color-accent);
    cursor: pointer;
    text-decoration: underline;
}

/* ── Progress ── */
.upload-progress { margin-top: 1rem; }

.progress-track {
    background: rgba(136,196,255,0.1);
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.progress-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: 999px;
    width: 0%;
    transition: width 0.2s;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
}

/* ── File rows ── */
.files-list { display: flex; flex-direction: column; gap: 0.6rem; }

.file-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(10,26,43,0.5);
    border: 1px solid rgba(136,196,255,0.1);
    border-radius: var(--border-radius);
    padding: 0.85rem 1rem;
    transition: border-color var(--transition-speed);
}

.file-row:hover { border-color: rgba(136,196,255,0.25); }

.file-emoji { font-size: 1.6rem; flex-shrink: 0; }

.file-info { flex: 1; min-width: 0; }

.file-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.file-meta {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    display: block;
    margin-top: 0.1rem;
}

.badge-lock {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: rgba(217,195,250,0.15);
    color: var(--color-purple);
    border: 1px solid rgba(217,195,250,0.2);
    white-space: nowrap;
    flex-shrink: 0;
}

.file-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255,255,255,0.3);
    font-size: 0.9rem;
}

.empty-state .empty-icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }

/* ── FTP pending list ── */
.ftp-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(202,250,157,0.05);
    border: 1px solid rgba(202,250,157,0.15);
    border-radius: var(--border-radius);
}

.ftp-item-name { flex: 1; font-size: 0.88rem; font-weight: 600; }
.ftp-item-size { font-size: 0.75rem; color: rgba(255,255,255,0.45); }

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.hidden { display: none; }

.modal-card {
    background: var(--color-blue-zone2);
    border: 1px solid rgba(136,196,255,0.2);
    border-radius: var(--border-radius);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-title { font-weight: 700; font-size: 1rem; }
.modal-subtitle { font-size: 0.82rem; color: rgba(255,255,255,0.5); margin-top: 0.25rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* ── Toast ── */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.toast {
    padding: 0.65rem 1.1rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 600;
    animation: toastIn 0.2s ease, toastOut 0.3s ease 2s forwards;
    backdrop-filter: blur(8px);
}

.toast-success { background: rgba(202,250,157,0.2); border: 1px solid rgba(202,250,157,0.35); color: var(--color-green); }
.toast-error   { background: rgba(255,80,80,0.2);  border: 1px solid rgba(255,80,80,0.35);  color: #ff9090; }
.toast-info    { background: rgba(136,196,255,0.15); border: 1px solid rgba(136,196,255,0.3); color: var(--color-accent); }

@keyframes toastIn  { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; } }

/* ── Download page ── */
.download-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    padding: 2rem 1rem;
}

.download-card {
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.download-file-icon { font-size: 4rem; display: block; margin-bottom: 1rem; }

.download-file-name {
    font-size: 1.35rem;
    font-weight: 700;
    word-break: break-word;
    margin-bottom: 0.35rem;
}

.download-file-ext {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 0.6rem;
    word-break: break-all;
}

.download-file-meta {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 1.75rem;
}

.download-divider {
    border: none;
    border-top: 1px solid rgba(136,196,255,0.1);
    margin: 1.25rem 0;
}

.lock-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--color-purple);
    margin-bottom: 1.25rem;
}

.error-msg {
    background: rgba(255,80,80,0.15);
    border: 1px solid rgba(255,80,80,0.3);
    color: #ff9090;
    border-radius: var(--border-radius);
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.download-footer {
    margin-top: 2rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.25);
}

.download-footer a { color: rgba(136,196,255,0.4); text-decoration: none; }
.download-footer a:hover { color: var(--color-accent); }

/* ── Login page ── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.login-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.7rem;
    color: var(--color-accent);
    letter-spacing: 0.05em;
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 2rem;
}

/* ── Admin sections ── */
.admin-main {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

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

.section-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.count-badge {
    background: rgba(136,196,255,0.15);
    color: var(--color-accent);
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .file-row { flex-wrap: wrap; }
    .file-actions { width: 100%; justify-content: flex-end; }
    .header-brand { display: none; }
    .admin-main { padding: 1rem; }
}
