/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #000;
    --secondary: #666;
    --accent: #0066ff;
    --bg: #ffffff;
    --border: #e0e0e0;
    --text: #1a1a1a;
    --text-light: #666;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== LOADER PRINCIPAL ===== */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-container.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.loader-title {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    margin-bottom: 3rem;
    color: var(--primary);
    animation: fadeInDown 0.6s ease;
}

.progress-wrapper {
    margin-bottom: 1.5rem;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 3px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-glow {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(0, 102, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    animation: glowPulse 2s ease-in-out infinite;
}

.progress-percentage {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--secondary);
    letter-spacing: 0.05em;
}

.loader-text {
    font-size: 0.95rem;
    color: var(--text-light);
    letter-spacing: 0.05em;
    animation: fadeIn 0.6s ease;
}

/* ===== CONTENIDO PRINCIPAL ===== */
.main-content {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease 0.3s, visibility 0.6s ease 0.3s;
}

.main-content.visible {
    opacity: 1;
    visibility: visible;
}

/* Navbar */
.navbar {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h2 {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--primary);
}

.reload-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.reload-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

/* Content Container */
.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.welcome-title {
    font-size: 3rem;
    font-weight: 300;
    text-align: center;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.welcome-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 4rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

/* Demo Grid */
.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.demo-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease both;
}

.demo-card:nth-child(1) { animation-delay: 0.1s; }
.demo-card:nth-child(2) { animation-delay: 0.15s; }
.demo-card:nth-child(3) { animation-delay: 0.2s; }
.demo-card:nth-child(4) { animation-delay: 0.25s; }
.demo-card:nth-child(5) { animation-delay: 0.3s; }
.demo-card:nth-child(6) { animation-delay: 0.35s; }
.demo-card:nth-child(7) { animation-delay: 0.4s; }
.demo-card:nth-child(8) { animation-delay: 0.45s; }
.demo-card:nth-child(9) { animation-delay: 0.5s; }
.demo-card:nth-child(10) { animation-delay: 0.55s; }
.demo-card:nth-child(11) { animation-delay: 0.6s; }
.demo-card:nth-child(12) { animation-delay: 0.65s; }

.demo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.demo-card h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.demo-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 1.5rem;
}

.demo-loader {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== DEMO 1: LINEAR PROGRESS ===== */
.linear-progress {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.linear-fill {
    height: 100%;
    width: 60%;
    background: var(--primary);
    animation: slideProgress 2s ease-in-out infinite;
}

/* ===== DEMO 2: GRADIENT WAVE ===== */
.gradient-progress {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.gradient-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: gradientWave 1.5s linear infinite;
}

/* ===== DEMO 3: DOTS LOADING ===== */
.dots-loading {
    display: flex;
    gap: 8px;
}

.dots-loading span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: dotsBounce 1.4s infinite ease-in-out both;
}

.dots-loading span:nth-child(1) { animation-delay: -0.32s; }
.dots-loading span:nth-child(2) { animation-delay: -0.16s; }
.dots-loading span:nth-child(3) { animation-delay: 0s; }
.dots-loading span:nth-child(4) { animation-delay: 0.16s; }
.dots-loading span:nth-child(5) { animation-delay: 0.32s; }

/* ===== DEMO 4: CIRCLE PROGRESS ===== */
.circle-progress {
    width: 60px;
    height: 60px;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 3;
}

.circle-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    animation: circleProgress 2s ease-in-out infinite;
    stroke-linecap: round;
}

/* ===== DEMO 5: PULSE LOADING ===== */
.pulse-container {
    position: relative;
    width: 60px;
    height: 60px;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 2px solid var(--primary);
    border-radius: 50%;
    animation: pulseRing 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.pulse-ring:nth-child(2) { animation-delay: 0.5s; }
.pulse-ring:nth-child(3) { animation-delay: 1s; }

/* ===== DEMO 6: SKELETON ===== */
.skeleton-box {
    width: 100%;
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, var(--border) 25%, #f0f0f0 50%, var(--border) 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    margin-bottom: 10px;
    animation: skeletonLoading 1.5s ease-in-out infinite;
}

.skeleton-line.short {
    width: 60%;
}

/* ===== DEMO 7: MODERN SPINNER ===== */
.modern-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== DEMO 8: BAR WAVE ===== */
.bar-wave {
    display: flex;
    gap: 6px;
    align-items: center;
    height: 40px;
}

.bar-wave span {
    width: 4px;
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    animation: barWave 1.2s ease-in-out infinite;
}

.bar-wave span:nth-child(1) { animation-delay: 0s; }
.bar-wave span:nth-child(2) { animation-delay: 0.1s; }
.bar-wave span:nth-child(3) { animation-delay: 0.2s; }
.bar-wave span:nth-child(4) { animation-delay: 0.3s; }
.bar-wave span:nth-child(5) { animation-delay: 0.4s; }

/* ===== DEMO 9: SLIDING BARS ===== */
.sliding-bars {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.sliding-bar {
    height: 100%;
    width: 40%;
    background: var(--primary);
    border-radius: 4px;
    animation: slideBar 1.5s ease-in-out infinite;
}

/* ===== DEMO 10: MORPHING SHAPES ===== */
.morphing-shape {
    width: 50px;
    height: 50px;
    background: var(--primary);
    animation: morph 2s ease-in-out infinite;
}

/* ===== DEMO 11: PROGRESS STEPS ===== */
.progress-steps {
    display: flex;
    gap: 12px;
    align-items: center;
}

.step {
    width: 12px;
    height: 12px;
    background: var(--border);
    border-radius: 50%;
    transition: all 0.3s ease;
    animation: stepProgress 2s ease-in-out infinite;
}

.step:nth-child(1) { animation-delay: 0s; }
.step:nth-child(2) { animation-delay: 0.5s; }
.step:nth-child(3) { animation-delay: 1s; }
.step:nth-child(4) { animation-delay: 1.5s; }

/* ===== DEMO 12: LIQUID FILL ===== */
.liquid-container {
    width: 60px;
    height: 60px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.liquid-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--primary);
    animation: liquidFill 3s ease-in-out infinite;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

.footer p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.footer-small {
    font-size: 0.85rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes glowPulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

@keyframes slideProgress {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

@keyframes gradientWave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes dotsBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes circleProgress {
    0% { stroke-dashoffset: 283; }
    50% { stroke-dashoffset: 70; }
    100% { stroke-dashoffset: 283; }
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0;
    }
}

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes barWave {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}

@keyframes slideBar {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(250%); }
    100% { transform: translateX(-100%); }
}

@keyframes morph {
    0%, 100% {
        border-radius: 50%;
        transform: rotate(0deg);
    }
    25% {
        border-radius: 0%;
    }
    50% {
        border-radius: 50%;
        transform: rotate(180deg);
    }
    75% {
        border-radius: 0%;
    }
}

@keyframes stepProgress {
    0%, 100% {
        background: var(--border);
        transform: scale(1);
    }
    50% {
        background: var(--primary);
        transform: scale(1.3);
    }
}

@keyframes liquidFill {
    0%, 100% { height: 0%; }
    50% { height: 100%; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .loader-title {
        font-size: 2rem;
    }

    .welcome-title {
        font-size: 2rem;
    }

    .welcome-subtitle {
        font-size: 1rem;
    }

    .demo-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .navbar h2 {
        font-size: 1.1rem;
    }

    .reload-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .content-container {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .loader-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .welcome-title {
        font-size: 1.6rem;
    }

    .demo-card {
        padding: 1.5rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #fff;
        --secondary: #999;
        --accent: #4d9fff;
        --bg: #0a0a0a;
        --border: #222;
        --text: #e5e5e5;
        --text-light: #999;
    }

    .navbar {
        background: rgba(10, 10, 10, 0.95);
    }

    .demo-card {
        background: #111;
    }
}
