﻿/* Estilos específicos para el módulo de Arrays en Java */

.tutorial-article {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.article-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #ecf0f1;
    position: relative;
}

.article-title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 300;
}

.article-subtitle {
    font-size: 1.2rem;
    color: #7f8c8d;
}

.module-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0 8px 0 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: bold;
}

.badge-number {
    font-size: 1.5rem;
    line-height: 1;
}

.badge-text {
    font-size: 0.8rem;
    opacity: 0.9;
}

.module-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

.content-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #ecf0f1;
}

.content-section:last-child {
    border-bottom: none;
}

.content-section h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Introducción a Arrays */
.array-intro {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.intro-analogy {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 8px;
}

.analogy-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.analogy-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.analogy-text h4 {
    margin: 0 0 0.5rem 0;
    color: white;
    font-size: 1.5rem;
}

.analogy-text p {
    margin: 0;
    opacity: 0.9;
    line-height: 1.6;
}

.array-visual {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.array-container {
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 300px;
}

.array-label {
    text-align: center;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
}

.array-cells {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.array-cell {
    width: 60px;
    height: 60px;
    background: #3498db;
    color: white;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    position: relative;
    transition: all 0.3s ease;
}

.array-cell:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.cell-value {
    font-size: 1.2rem;
    font-weight: bold;
}

.cell-index {
    position: absolute;
    bottom: -20px;
    font-size: 0.8rem;
    color: #7f8c8d;
}

.array-indices {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.array-characteristics {
    margin-top: 1rem;
}

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

.characteristic {
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    text-align: center;
    transition: transform 0.3s ease;
}

.characteristic:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.char-icon {
    font-size: 2rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.characteristic h5 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.characteristic p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Tipos de Arrays */
.array-types {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.type-selector {
    background: #2c3e50;
    padding: 1.5rem;
    border-radius: 8px;
}

.type-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.type-btn {
    padding: 1rem 1.5rem;
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.type-btn.active {
    background: #3498db;
    font-weight: bold;
}

.type-btn:hover:not(.active) {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.type-details {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.type-detail {
    display: none;
}

.type-detail.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.detail-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-header h3 {
    margin: 0;
    font-size: 1.8rem;
}

.type-tag {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.detail-content {
    padding: 1.5rem;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h5 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.array-representation {
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.linear-array, .matrix-array {
    display: flex;
    justify-content: center;
}

.array-box {
    padding: 1.5rem;
    border-radius: 6px;
    border: 2px solid #3498db;
    min-width: 300px;
}

.array-cells-horizontal {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.cell {
    width: 70px;
    height: 70px;
    background: #3498db;
    color: white;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    position: relative;
    transition: all 0.3s ease;
}

.cell:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.cell-value {
    font-size: 1.3rem;
    font-weight: bold;
}

.cell-index {
    position: absolute;
    bottom: -20px;
    font-size: 0.8rem;
    color: #7f8c8d;
}

.cell-coords {
    position: absolute;
    bottom: -20px;
    font-size: 0.7rem;
    color: #7f8c8d;
}

.matrix-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.matrix-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.code-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.code-example {
    padding: 1rem;
    border-radius: 6px;
}

.code-example h6 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.code-example pre {
    margin: 0;
    font-size: 0.9rem;
}

/* Constructor de Arrays */
.array-builder {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    padding: 2rem;
    border-radius: 8px;
    border: 2px solid #3498db;
}

@media (max-width: 768px) {
    .array-builder {
        grid-template-columns: 1fr;
    }
}

.builder-controls {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.builder-controls h4 {
    color: #2c3e50;
    margin: 0 0 1.5rem 0;
    text-align: center;
}

.control-item {
    margin-bottom: 1.5rem;
}

.control-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ecf0f1;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #3498db;
    outline: none;
}

.slider {
    width: 100%;
    margin: 0.5rem 0;
}

.control-item span {
    display: inline-block;
    margin-left: 0.5rem;
    font-weight: bold;
    color: #3498db;
}

.control-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.generate-btn {
    background: #27ae60;
    color: white;
}

.random-btn {
    background: #9b59b6;
    color: white;
}

.clear-btn {
    background: #e74c3c;
    color: white;
}

.builder-preview {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.preview-header {
    background: #2c3e50;
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h4 {
    margin: 0;
}

.array-info {
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.array-visualization {
    padding: 2rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder {
    text-align: center;
    color: #95a5a6;
}

.placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #3498db;
}

.placeholder p {
    margin: 0;
    font-size: 1.1rem;
}

.code-preview {
    background: #2c3e50;
    padding: 1.5rem;
    border-top: 1px solid #3c3c3c;
}

.code-preview h5 {
    color: #ecf0f1;
    margin: 0 0 1rem 0;
}

.code-preview pre {
    margin: 0;
    background: #1e1e1e;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
}

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

.copy-code-btn {
    background: #3498db;
    color: white;
}

.execute-btn {
    background: #27ae60;
    color: white;
}

/* Operaciones con Arrays */
.array-operations {
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #9b59b6;
}

.operations-tabs {
    display: flex;
    background: #2c3e50;
    overflow-x: auto;
}

.op-tab {
    flex: 1;
    min-width: 120px;
    padding: 1rem;
    background: none;
    border: none;
    color: #ecf0f1;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-align: center;
}

.op-tab.active {
    background: #9b59b6;
    font-weight: bold;
}

.op-tab:hover:not(.active) {
    background: rgba(255,255,255,0.1);
}

.operations-content {
    padding: 0;
}

.op-content {
    display: none;
    padding: 2rem;
}

.op-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.op-demo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .op-demo {
        grid-template-columns: 1fr;
    }
}

.demo-array {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.array-title {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
}

.array-cells-demo {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.demo-cell {
    width: 60px;
    height: 60px;
    background: #3498db;
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.demo-cell.active {
    background: #e74c3c;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.array-indices-demo {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.demo-index {
    width: 60px;
    text-align: center;
    font-size: 0.8rem;
    color: #7f8c8d;
    font-family: 'Courier New', monospace;
}

.demo-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.access-result {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.result-label {
    color: #7f8c8d;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.result-code {
    margin-bottom: 1rem;
}

.result-code code {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
}

.result-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #27ae60;
}

.iteration-visualizer {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.iteration-step {
    border: 2px solid #3498db;
    border-radius: 6px;
    overflow: hidden;
}

.step-header {
    background: #3498db;
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.step-title {
    font-weight: bold;
}

.step-info {
    font-family: 'Courier New', monospace;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.step-content {
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.code-step pre {
    margin: 0;
    background: #2c3e50;
    border-radius: 4px;
    padding: 1rem;
    color: #ecf0f1;
    font-size: 0.9rem;
}

.step-output {
    display: flex;
    flex-direction: column;
}

.output-title {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.output-content {
    flex: 1;
    background: #1e1e1e;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 1rem;
    border-radius: 4px;
    overflow-y: auto;
    font-size: 0.9rem;
}

.iteration-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.op-explanation {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.warning-box {
    background: #fff3cd;
    border-left: 4px solid #f39c12;
    padding: 1rem;
    border-radius: 0 4px 4px 0;
    margin-top: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.warning-box i {
    color: #f39c12;
    font-size: 1.2rem;
    margin-top: 0.2rem;
}

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

.method {
    padding: 1rem;
    border-radius: 6px;
}

.method h6 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.method pre {
    margin: 0;
    font-size: 0.85rem;
}

/* Algoritmos de Arrays */
.array-algorithms {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

.algorithm-card {
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    border: 2px solid #ecf0f1;
    transition: all 0.3s ease;
}

.algorithm-card:hover {
    border-color: #3498db;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.algorithm-card.active {
    border-color: #27ae60;
    background: #e8f6f3;
}

.algo-icon {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.algo-info h5 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.algo-info p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

.algorithm-visualizer {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.visualizer-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.visualizer-header h4 {
    margin: 0;
}

.algo-stats {
    display: flex;
    gap: 1.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #f1c40f;
}

.visualization-area {
    padding: 2rem;
    border-bottom: 1px solid #ecf0f1;
}

.algorithm-array {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.algo-cell {
    width: 70px;
    height: 70px;
    background: #3498db;
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    position: relative;
}

.algo-cell.compared {
    background: #f39c12;
    transform: scale(1.1);
}

.algo-cell.swapped {
    background: #e74c3c;
    transform: scale(1.1);
}

.algo-cell.sorted {
    background: #27ae60;
}

.algo-cell.current {
    border: 3px solid #f1c40f;
}

.algo-cell-index {
    position: absolute;
    top: -20px;
    font-size: 0.8rem;
    color: #7f8c8d;
}

.algorithm-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.control-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.algorithm-output {
    padding: 1.5rem;
}

.output-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.output-header h5 {
    margin: 0;
    color: #2c3e50;
}

.result-display {
    flex: 1;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: #27ae60;
    font-weight: bold;
}

.code-implementation h5 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
}

/* Array vs ArrayList */
.comparison-section {
    padding: 2rem;
    border-radius: 8px;
    border: 2px solid #3498db;
}

.comparison-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.comparison-item {
    flex: 1;
    text-align: center;
    padding: 1.5rem;
    border-radius: 8px;
}

.comparison-item.array {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.comparison-item.arraylist {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.comparison-item h3 {
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.item-tag {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: bold;
}

.vs-separator {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.comparison-grid {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.comparison-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-bottom: 1px solid #ecf0f1;
}

.comparison-row:last-child {
    border-bottom: none;
}

.comparison-row > div {
    padding: 1rem;
    display: flex;
    align-items: center;
}

.feature {
    font-weight: bold;
    color: #2c3e50;
}

.array-value, .arraylist-value {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.badge.fixed {
    background: #3498db;
    color: white;
}

.badge.dynamic {
    background: #e74c3c;
    color: white;
}

.badge.limited {
    background: #f39c12;
    color: white;
}

.badge.easy {
    background: #27ae60;
    color: white;
}

.badge.difficult {
    background: #e74c3c;
    color: white;
}

.badge.fast {
    background: #27ae60;
    color: white;
}

.badge.slower {
    background: #f39c12;
    color: white;
}

.badge.efficient {
    background: #3498db;
    color: white;
}

.badge.more-memory {
    background: #9b59b6;
    color: white;
}

.conversion-demo {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.conversion-visual {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
    margin: 1.5rem 0;
}

.conversion-step {
    text-align: center;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px dashed #3498db;
}

.step-title {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.step-code pre {
    margin: 1rem 0;
    font-size: 0.9rem;
}

.conversion-arrow {
    font-size: 2rem;
    color: #3498db;
    text-align: center;
}

.conversion-result {
    margin-top: 1.5rem;
}

/* Ejercicios Prácticos */
.practice-exercises {
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #27ae60;
}

.exercise-tabs {
    display: flex;
    background: #2c3e50;
    overflow-x: auto;
}

.exercise-tab {
    flex: 1;
    min-width: 120px;
    padding: 1rem;
    background: none;
    border: none;
    color: #ecf0f1;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    transition: background 0.3s ease;
}

.exercise-tab.active {
    background: #27ae60;
    font-weight: bold;
}

.exercise-content {
    padding: 0;
}

.exercise-panel {
    display: none;
    padding: 2rem;
}

.exercise-panel.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.exercise-header h4 {
    margin: 0;
    color: #2c3e50;
}

.difficulty-level {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.difficulty-level.easy {
    background: #27ae60;
    color: white;
}

.difficulty-level.medium {
    background: #f39c12;
    color: white;
}

.difficulty-level.hard {
    background: #e74c3c;
    color: white;
}

.exercise-description {
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.requirements h5 {
    color: #2c3e50;
    margin: 1rem 0 0.5rem 0;
}

.requirements ul {
    margin: 0;
    padding-left: 1.5rem;
}

.requirements li {
    margin-bottom: 0.25rem;
    color: #666;
}

.example-output {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-family: 'Courier New', monospace;
}

.example-output h5 {
    margin: 0 0 0.5rem 0;
    color: #ecf0f1;
}

.exercise-editor {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.editor-header {
    background: #2d2d2d;
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-editor {
    width: 100%;
    min-height: 200px;
    background: none;
    border: none;
    color: #d4d4d4;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    padding: 1rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
}

.exercise-output {
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 100px;
}

.output-placeholder {
    text-align: center;
    color: #95a5a6;
    padding: 2rem;
}

.output-placeholder i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

/* Juego: Ordena el Array */
.array-game {
    padding: 2rem;
    border-radius: 8px;
    border: 2px solid #f39c12;
}

.game-instructions {
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.game-instructions h4 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.game-info {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.25rem;
}

.info-value {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1rem;
}

.difficulty-select {
    padding: 0.25rem 0.5rem;
    border: 2px solid #ecf0f1;
    border-radius: 4px;
    font-size: 0.9rem;
}

.game-area {
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.array-container-game {
    margin-bottom: 2rem;
}

.array-cells-game {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.game-cell {
    width: 80px;
    height: 80px;
    background: #3498db;
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.5rem;
    cursor: move;
    user-select: none;
    transition: all 0.3s ease;
    position: relative;
}

.game-cell:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.game-cell.dragging {
    opacity: 0.5;
}

.game-cell.over {
    border: 3px dashed #f39c12;
}

.game-cell.correct-position {
    background: #27ae60;
}

.game-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.game-feedback {
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    margin-top: 1rem;
}

.feedback-message {
    font-weight: bold;
    color: #2c3e50;
}

.sorting-algorithm {
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.algorithm-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.step-number {
    width: 30px;
    height: 30px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-text {
    color: #666;
}

/* Test de Conocimientos */
.knowledge-test {
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 2px solid #9b59b6;
}

.test-progress {
    height: 8px;
    border-radius: 4px;
    margin-bottom: 1rem;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: #9b59b6;
    border-radius: 4px;
    width: 10%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.test-question {
    margin-bottom: 2rem;
}

.test-question h4 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.test-options label {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.test-options label:hover {
    border-color: #3498db;
    transform: translateY(-2px);
}

.test-options input[type="radio"] {
    width: 20px;
    height: 20px;
}

.option-letter {
    width: 30px;
    height: 30px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    color: #666;
}

.question-feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    display: none;
}

.question-feedback.correct {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #27ae60;
}

.question-feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #e74c3c;
}

.test-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.test-results {
    display: none;
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
    text-align: center;
}

/* Resumen y Recursos */
.summary-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.summary-card {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-top: 4px solid #3498db;
}

.summary-card h4 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-card ul {
    margin: 0;
    padding-left: 1.5rem;
}

.summary-card li {
    margin-bottom: 0.5rem;
    color: #666;
    line-height: 1.4;
}

.quick-reference {
    padding: 2rem;
    border-radius: 8px;
    border: 2px solid #f39c12;
}

.quick-reference h4 {
    color: #2c3e50;
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.reference-item {
    padding: 1rem;
    border-radius: 6px;
}

.reference-item h5 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.reference-item pre {
    margin: 0;
    font-size: 0.9rem;
}

.next-module {
    text-align: center;
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
}

.next-module h4 {
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.next-module p {
    margin: 0 0 1.5rem 0;
    opacity: 0.9;
}

.next-module-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #3498db;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.next-module-btn:hover {
    transform: translateY(-2px);
}

/* Recursos Adicionales */
.additional-resources {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.resource-category {
    padding: 1.5rem;
    border-radius: 8px;
}

.resource-category h4 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.resource-category ul {
    margin: 0;
    padding-left: 1.5rem;
}

.resource-category li {
    margin-bottom: 0.5rem;
}

.resource-category a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.resource-category a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Botones generales */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Animaciones */
@keyframes highlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.highlight {
    animation: highlight 0.5s ease;
}

/* Estados de validación */
.correct-answer {
    background: #27ae60 !important;
    color: white !important;
}

.incorrect-answer {
    background: #e74c3c !important;
    color: white !important;
}