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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --dark-bg: #1e1b4b;
    --light-bg: #f8fafc;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --card-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--light-bg);
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--card-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo h1 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
}

.hero-content h2 {
    font-size: 3rem;
    color: var(--dark-bg);
    margin-bottom: 0.5rem;
}

.hero-content h3 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Hero Animation */
.hero-animation {
    display: flex;
    justify-content: center;
    align-items: center;
}

.robot-container {
    position: relative;
}

.robot {
    font-size: 10rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.speech-bubble {
    position: absolute;
    top: 20%;
    right: -50%;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    white-space: nowrap;
    animation: fadeInOut 4s ease-in-out infinite;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 20%;
    border: 10px solid transparent;
    border-bottom-color: white;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0;
    }
    25%, 75% {
        opacity: 1;
    }
}

/* Stats Section */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s;
}

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

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-light);
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Roadmap Section */
.roadmap {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.roadmap h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 3rem;
}

.roadmap-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.roadmap-item {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--card-shadow-lg);
    position: relative;
    transition: transform 0.3s;
}

.roadmap-item:hover {
    transform: scale(1.05);
}

.module-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.roadmap-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.roadmap-item p {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 1rem;
}

.module-topics {
    list-style: none;
    margin: 1rem 0;
}

.module-topics li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.module-topics li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.progress-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
}

/* Modules Section */
.modules-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.modules-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--dark-bg);
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.module-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
}

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



.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.module-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.module-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.card-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    align-self: flex-end;
}

.card-lock {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
}

/* About Section */
.about {
    padding: 4rem 2rem;
    background: white;
}

.about h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--dark-bg);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.about-card {
    text-align: center;
    padding: 2rem;
}

.about-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.about-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.about-card p {
    color: var(--text-light);
}

/* Footer */
footer {
    background: var(--dark-bg);
    color: white;
    padding: 2rem;
    text-align: center;
}

.footer-content p {
    margin: 0.5rem 0;
    opacity: 0.8;
}

.footer-content a {
    color: white;
    text-decoration: underline;
    transition: opacity 0.3s;
}

.footer-content a:hover {
    opacity: 0.7;
}

/* Responsive */
/* Responsive Breakpoints */

/* Tablet y móviles grandes (768px - 1023px) */
@media (max-width: 1023px) {
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .roadmap-step {
        flex-direction: column;
        text-align: center;
    }
}

/* Móviles (hasta 768px) */
@media (max-width: 768px) {
    /* Navbar */
    .navbar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .nav-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Hero */
    .hero {
        grid-template-columns: 1fr;
        padding: 2rem 1rem;
        gap: 2rem;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-content h3 {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .robot {
        font-size: 6rem;
    }
    
    /* Stats */
    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 2rem 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* Progress Bar */
    .progress-container {
        margin: 2rem 1rem;
    }
    
    /* Modules Grid */
    .modules-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .module-card {
        padding: 1.5rem;
    }
    
    .card-icon {
        font-size: 2.5rem;
    }
    
    /* Roadmap */
    .roadmap {
        padding: 3rem 1rem;
    }
    
    .roadmap-step {
        padding: 1.5rem;
    }
    
    /* About Grid */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    /* Footer */
    footer {
        padding: 2rem 1rem;
    }
}

/* Móviles pequeños (hasta 480px) */
@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .hero-content h3 {
        font-size: 1.25rem;
    }
    
    .robot {
        font-size: 4rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .card-icon {
        font-size: 2rem;
    }
    
    .module-card h3 {
        font-size: 1.25rem;
    }
    
    /* Modals en móviles pequeños */
    .locked-content,
    .celebration-content,
    .quiz-results-content {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    .locked-icon,
    .celebration-icon {
        font-size: 3rem;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    .score-text {
        font-size: 2rem;
    }
}

/* Progress System Styles */
.locked-modal {
    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;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.locked-content {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.4s ease;
}

.locked-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: shake 0.5s ease;
}

.locked-content h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.locked-content p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.locked-content .tip {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 1rem;
    border-radius: 12px;
    border-left: 4px solid var(--warning);
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.locked-content .btn {
    margin-top: 1rem;
    padding: 0.875rem 2rem;
}

/* Module cards locked state */
.module-card.locked {
    position: relative;
    opacity: 0.6;
    filter: grayscale(50%);
    cursor: not-allowed;
}

.module-card.locked:hover {
    transform: none;
}

.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

.lock-overlay .lock-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.module-card.completed {
    border: 2px solid var(--success);
    background: linear-gradient(135deg, #f0fdf4 0%, white 100%);
}

.module-card.completed::after {
    content: '✅';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
}

/* Roadmap items states */
.roadmap-item.locked {
    opacity: 0.6;
    filter: grayscale(50%);
}

.roadmap-item.locked .btn {
    background: var(--text-light);
    cursor: not-allowed;
}

.roadmap-item.completed {
    border-color: var(--success);
    background: linear-gradient(135deg, #f0fdf4 0%, white 100%);
}

.roadmap-item.available {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Progress bar */
.progress-container {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    margin: 2rem auto;
    max-width: 1200px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.progress-text {
    text-align: center;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Celebration Modal */
.celebration-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.celebration-content {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: bounceIn 0.6s ease;
}

.celebration-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: rotateScale 1s ease infinite;
}

.celebration-content h2 {
    color: var(--success);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.celebration-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 2rem 0;
}

.celebration-stats .stat-item {
    text-align: center;
}

.celebration-stats .stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.celebration-stats .stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Confetti */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 9999;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes rotateScale {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(-10deg) scale(1.1);
    }
    75% {
        transform: rotate(10deg) scale(1.1);
    }
}

/* Quiz Results Modal */
.quiz-results-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.quiz-results-content {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.5s ease;
}

.quiz-results-content.passed {
    border-top: 5px solid var(--success);
}

.quiz-results-content.failed {
    border-top: 5px solid var(--warning);
}

.quiz-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.quiz-results-content h2 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.quiz-results-content.passed h2 {
    color: var(--success);
}

.quiz-results-content.failed h2 {
    color: var(--warning);
}

.quiz-score {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.score-circle {
    position: relative;
    width: 150px;
    height: 150px;
}

.score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-dark);
}

.quiz-message {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.next-module-hint, .retry-hint {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.quiz-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.quiz-actions .btn {
    min-width: 150px;
}
