/* Variables */
:root {
    --primary-color: #714B67;
    --primary-light: #8F6B81;
    --secondary-color: #00A09D;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: #e0e0e0;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: rgba(26, 26, 46, 0.95);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

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

.nav-links a {
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--primary-color);
    color: white;
}

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

/* Hero */
.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--gray-color);
}

/* Cards */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.card h2 {
    color: white;
    margin-bottom: 1rem;
}

.card ul {
    list-style: none;
    margin: 1rem 0;
}

.card ul li {
    padding: 0.3rem 0;
    color: #b0b0b0;
}

.card ul li::before {
    content: "→ ";
    color: var(--secondary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #218838;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

/* Info Section */
.info-section {
    margin: 3rem 0;
}

.info-section h2 {
    color: white;
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.exam-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 10px;
}

.exam-item.included {
    border-left: 4px solid var(--success-color);
}

.exam-item.excluded {
    border-left: 4px solid var(--danger-color);
}

.exam-item h3 {
    margin-bottom: 1rem;
    color: white;
}

.exam-item ul {
    list-style: none;
}

.exam-item ul li {
    padding: 0.4rem 0;
    color: #b0b0b0;
}

/* Tips */
.tips-section {
    margin: 3rem 0;
}

.tips-section h2 {
    color: white;
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.tip {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
}

.tip-number {
    background: var(--secondary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--gray-color);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 3rem;
}

/* Resumen Page Styles */
.summary-nav {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.summary-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    justify-content: center;
}

.summary-nav a {
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.summary-nav a:hover {
    background: var(--primary-color);
}

.summary-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-section h2 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.summary-section h3 {
    color: white;
    margin: 1.5rem 0 0.5rem;
}

.summary-section p {
    margin-bottom: 1rem;
    color: #c0c0c0;
}

.code-example {
    background: #282c34;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.code-example pre {
    margin: 0;
    color: #abb2bf;
}

.code-example code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
}

.syntax-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.syntax-table th,
.syntax-table td {
    padding: 0.8rem;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.syntax-table th {
    background: rgba(113, 75, 103, 0.3);
    color: white;
}

.syntax-table td {
    background: rgba(255, 255, 255, 0.02);
}

.syntax-table code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Ejercicios Page Styles */
.exercise-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 20px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-fill {
    background: var(--success-color);
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

.exercise {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.exercise-title {
    color: white;
    font-size: 1.2rem;
}

.exercise-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.exercise-description {
    color: #b0b0b0;
    margin-bottom: 1rem;
}

.code-block {
    background: #282c34;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    white-space: pre-wrap;
}

.code-context {
    color: #abb2bf;
}

.code-todo {
    background: rgba(255, 193, 7, 0.2);
    border-left: 3px solid var(--warning-color);
    padding: 0.5rem;
    margin: 0.5rem 0;
    color: var(--warning-color);
}

.answer-area {
    margin: 1rem 0;
}

.answer-area label {
    display: block;
    margin-bottom: 0.5rem;
    color: white;
}

.answer-input {
    width: 100%;
    min-height: 100px;
    background: #1e1e1e;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    color: #e0e0e0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.answer-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.exercise-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.result-area {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    display: none;
}

.result-area.correct {
    display: block;
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid var(--success-color);
}

.result-area.incorrect {
    display: block;
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid var(--danger-color);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.result-area.correct .result-header {
    color: var(--success-color);
}

.result-area.incorrect .result-header {
    color: var(--danger-color);
}

.solution-code {
    background: #282c34;
    border-radius: 5px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.solution-code pre {
    margin: 0;
    color: #98c379;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .exercise-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Syntax highlighting for code */
.keyword { color: #c678dd; }
.string { color: #98c379; }
.function { color: #61afef; }
.decorator { color: #e5c07b; }
.comment { color: #5c6370; font-style: italic; }
.class-name { color: #e5c07b; }
.number { color: #d19a66; }
.xml-tag { color: #e06c75; }
.xml-attr { color: #d19a66; }
.xml-value { color: #98c379; }

/* Stats Section */
.stats-section {
    margin: 3rem 0;
    text-align: center;
}

.stats-section h2 {
    color: white;
    margin-bottom: 1.5rem;
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem 2rem;
    border-radius: 10px;
    min-width: 120px;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.stat-label {
    color: #b0b0b0;
    font-size: 0.9rem;
}

/* Exercise completed state */
.exercise.completed {
    border-left: 4px solid var(--success-color);
}

.exercise.completed .exercise-title::after {
    content: " ✅";
}

/* Better code block styling */
.code-block code {
    display: block;
    color: #abb2bf;
    line-height: 1.5;
}

.code-todo {
    background: rgba(255, 193, 7, 0.15);
    border-left: 3px solid var(--warning-color);
    padding: 0.5rem;
    margin: 0.5rem 0;
    color: #e5c07b;
    font-family: 'Consolas', 'Monaco', monospace;
}

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

.result-area.correct,
.result-area.incorrect {
    animation: fadeIn 0.3s ease;
}

/* Mobile improvements */
@media (max-width: 480px) {
    .exercise-actions {
        flex-direction: column;
    }
    
    .stats-grid {
        gap: 1rem;
    }
    
    .stat-card {
        min-width: 100px;
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}
