/* ========================================
   ESTILOS GLOBALES Y ANIMACIONES
   ======================================== */
* {
    transition: all 0.3s ease;
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glow {
    0% { box-shadow: 0 0 10px rgba(79, 195, 247, 0.3); }
    50% { box-shadow: 0 0 20px rgba(79, 195, 247, 0.6); }
    100% { box-shadow: 0 0 10px rgba(79, 195, 247, 0.3); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   BODY Y ESTILOS BASE
   ======================================== */
body {
    margin: 0;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    color: #e5e5e5;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
    animation: fadeIn 0.8s ease-out;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ========================================
   TIPOGRAFÍA Y ELEMENTOS BASE
   ======================================== */
.subtitle {
    position: absolute;
    top: 15px;
    font-size: 0.7rem;
    color: #4fc3f7;
    letter-spacing: 3px;
    font-weight: 600;
    animation: fadeIn 1s ease-out 0.2s backwards;
}

h1 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(2rem, 8vw, 3.5rem);
    margin-bottom: 20px;
    background: linear-gradient(135deg, #4fc3f7, #81c784);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeIn 1s ease-out 0.4s backwards;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

.description {
    margin-top: 15px;
    max-width: 600px;
    text-align: center;
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    color: #99a8b8;
    line-height: 1.6;
    animation: fadeIn 1s ease-out 0.3s backwards;
}

/* ========================================
   BOTONES Y CONTROLES
   ======================================== */
.btn {
    border: 2px solid #4fc3f7;
    padding: 12px 30px;
    background: transparent;
    color: #4fc3f7;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    animation: fadeIn 1s ease-out 0.6s backwards;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #4fc3f7, transparent);
    transition: left 0.5s ease;
    opacity: 0.3;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: #4fc3f7;
    color: #0a0a0a;
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.6);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.reset-btn {
    margin-top: 30px;
    display: none;
    animation: fadeIn 0.5s ease-out;
}

/* ========================================
   TERMINAL Y OUTPUT
   ======================================== */
.terminal {
    margin-top: 25px;
    width: 100%;
    max-width: 700px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    padding: 25px;
    display: none;
    font-family: 'Courier New', monospace;
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    border: 1px solid rgba(79, 195, 247, 0.2);
    animation: slideIn 0.5s ease-out;
    box-shadow: 0 8px 32px rgba(79, 195, 247, 0.1);
}

.cmd {
    color: #4fc3f7;
    font-weight: 600;
    animation: slideIn 0.3s ease-out;
}

.label {
    color: #ce93d8;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

.value {
    color: #81c784;
    animation: slideIn 0.3s ease-out;
}

.progress {
    height: 8px;
    background: rgba(79, 195, 247, 0.1);
    margin: 15px 0;
    border-radius: 4px;
    overflow: hidden;
}

.bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4fc3f7, #81c784);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.8);
}

/* ========================================
   GRID DE SECCIONES
   ======================================== */
.sections {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    padding: 0 10px;
}

.box {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #a9d7ec;
    background: rgba(26, 26, 46, 0.5);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(79, 195, 247, 0.15);
    animation: fadeIn 0.8s ease-out;
    transition: all 0.3s ease;
}

.box:hover {
    border-color: rgba(79, 195, 247, 0.5);
    box-shadow: 0 8px 32px rgba(79, 195, 247, 0.15);
    transform: translateY(-5px);
}

.box h3 {
    margin-bottom: 20px;
    text-align: center;
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    color: #4fc3f7;
    font-weight: 700;
}

.box button {
    display: block;
    width: 100%;
    max-width: 180px;
    margin: 12px 0;
    padding: 14px 20px;
    background: linear-gradient(135deg, #4fc3f7, #00bcd4);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 12px;
    font-weight: 700;
    position: relative;
    overflow: hidden;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.3);
    transition: all 0.3s ease;
}

.box button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #00bcd4, #4fc3f7);
    transition: left 0.4s ease;
    z-index: -1;
}

.box button:hover::before {
    left: 0;
}

.box button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 195, 247, 0.6);
}

.box button:active {
    transform: translateY(-1px);
}

.download-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.download-card {
    min-height: 168px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 22px 16px;
    border: 1px solid rgba(79, 195, 247, 0.18);
    border-radius: 14px;
    background: rgba(10, 10, 10, 0.36);
    color: #e5e5e5;
    position: relative;
    overflow: hidden;
    outline: none;
}

.download-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    opacity: 0;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.18), rgba(129, 199, 132, 0.16));
}

.download-card:hover,
.download-card:focus-visible {
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(79, 195, 247, 0.7);
    box-shadow: 0 14px 32px rgba(79, 195, 247, 0.18);
}

.download-card:hover::before,
.download-card:focus-visible::before {
    opacity: 1;
}

.download-icon,
.download-title {
    position: relative;
    z-index: 1;
}

.download-icon {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f4fbff;
    box-shadow: 0 0 0 8px rgba(79, 195, 247, 0.08), 0 14px 26px rgba(0, 0, 0, 0.28);
}

.download-card:hover .download-icon,
.download-card:focus-visible .download-icon {
    transform: rotate(-5deg) scale(1.08);
    box-shadow: 0 0 0 10px rgba(129, 199, 132, 0.11), 0 18px 34px rgba(79, 195, 247, 0.22);
}

.download-icon img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.download-title {
    color: #e5e5e5;
    font-size: 0.98rem;
    font-weight: 800;
    text-align: center;
}

.side-stack {
    display: grid;
    gap: 20px;
}

.mini-panel {
    min-height: 176px;
    padding: 26px;
    border: 1px solid rgba(79, 195, 247, 0.15);
    border-radius: 16px;
    background: rgba(22, 33, 62, 0.48);
    color: #a9d7ec;
    animation: fadeIn 0.8s ease-out;
}

.mini-panel:hover {
    border-color: rgba(129, 199, 132, 0.45);
    box-shadow: 0 8px 32px rgba(79, 195, 247, 0.12);
    transform: translateY(-4px);
}

.mini-panel h3 {
    margin: 0 0 12px;
    color: #81c784;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.05rem, 2vw, 1.2rem);
}

.mini-panel p {
    margin: 0;
    color: #99a8b8;
    line-height: 1.7;
    font-size: 0.95rem;
}

.status-line {
    width: 52px;
    height: 3px;
    margin-top: 20px;
    border-radius: 999px;
    background: linear-gradient(90deg, #4fc3f7, #81c784);
}

.divider {
    width: 80%;
    height: 2px;
    margin: 60px auto;
    background: linear-gradient(90deg, transparent, #4fc3f7, #81c784, transparent);
    border-radius: 1px;
    animation: fadeIn 1s ease-out 0.5s backwards;
}

/* ========================================
   ESTILOS DE LOGIN
   ======================================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
    backdrop-filter: blur(4px);
}

.login-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 40px;
    border-radius: 16px;
    border: 2px solid #4fc3f7;
    box-shadow: 0 8px 32px rgba(79, 195, 247, 0.3);
    max-width: 400px;
    width: 90%;
    animation: fadeIn 0.4s ease-out;
}

.login-container h2 {
    text-align: center;
    color: #4fc3f7;
    margin-bottom: 30px;
    font-size: 1.8rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #81c784;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #4fc3f7;
    border-radius: 8px;
    color: #e5e5e5;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #81c784;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(129, 199, 132, 0.3);
}

.form-group input::placeholder {
    color: #99a8b8;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4fc3f7, #81c784);
    border: none;
    color: #fff;
    font-weight: 700;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 195, 247, 0.6);
}

.login-btn:active {
    transform: translateY(0);
}

.login-info {
    text-align: center;
    color: #99a8b8;
    font-size: 0.85rem;
    margin-top: 20px;
    font-style: italic;
}

/* ========================================
   ESTILOS DE LOGOUT
   ======================================== */
.logout-header {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: #4fc3f7;
    font-weight: 600;
    font-size: 0.95rem;
}

.logout-link {
    background: linear-gradient(135deg, #ef5350, #e53935);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(239, 83, 80, 0.3);
}

.logout-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 83, 80, 0.6);
}

.logout-link:active {
    transform: translateY(0);
}

/* ========================================
   MEDIA QUERIES - TABLET (768px)
   ======================================== */
@media (max-width: 768px) {
    body {
        padding: 30px 15px;
    }
    
    h1 {
        margin-bottom: 15px;
    }
    
    .subtitle {
        font-size: 0.65rem;
    }
    
    .terminal {
        max-width: 100%;
        padding: 20px;
        font-size: 0.8rem;
        max-height: 50vh;
        overflow-y: auto;
    }
    
    .sections {
        gap: 20px;
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }
    
    .box {
        padding: 20px;
        width: 100%;
    }
    
    .box button {
        max-width: 150px;
        padding: 12px 18px;
    }
    
    .divider {
        margin: 45px auto;
    }

    .logout-header {
        top: 15px;
        right: 15px;
        gap: 10px;
    }
}

/* ========================================
   MEDIA QUERIES - MÓVIL HORIZONTAL (600px)
   ======================================== */
@media (max-width: 600px) {
    .sections {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .box {
        padding: 18px;
    }
    
    .box button {
        max-width: 100%;
        padding: 12px 16px;
    }

    .download-grid {
        grid-template-columns: 1fr;
    }

    .logout-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-end;
    }
    
    .mini-panel {
        padding: 22px 20px;
    }
}

/* ========================================
   MEDIA QUERIES - MÓVIL VERTICAL (480px)
   ======================================== */
@media (max-width: 480px) {
    body {
        padding: 20px 12px;
        min-height: 100vh;
    }
    
    h1 {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .terminal {
        padding: 15px;
        font-size: 0.75rem;
        max-width: 100%;
        max-height: 50vh;
        overflow-y: auto;
    }
    
    .sections {
        gap: 12px;
        grid-template-columns: 1fr;
        padding: 0 5px;
    }
    
    .box {
        padding: 15px;
        gap: 10px;
    }
    
    .box h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .box button {
        max-width: 100%;
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .download-card {
        min-height: 150px;
    }

    .login-container {
        padding: 30px 20px;
        max-width: 95%;
    }
    
    .login-container h2 {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }

    .logout-link {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}
