/* Estilos compartidos para los ejemplos interactivos de XML */
/* Tema verde, coherente con uso_xml.php */

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

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

.breadcrumb {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: #27ae60;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.example-title {
    font-size: 2.2rem;
    color: #27ae60;
    margin-bottom: 1rem;
    font-weight: 300;
}

.example-subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
}

/* Secciones */
.demo-section, .explanation-section, .concepts-section, .exercise-section, .navigation-section {
    margin-bottom: 3rem;
}

.demo-section h2, .explanation-section h2, .concepts-section h2, .exercise-section h2 {
    color: #27ae60;
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.demo-intro {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Contenedor de la demo */
.demo-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
}

.demo-form-side, .demo-output-side {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
}

.demo-form-side h3, .demo-output-side h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

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

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group textarea {
    font-family: 'Courier New', monospace;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #27ae60;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.2);
}

.demo-button {
    background: #27ae60;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 0.5rem;
    font-weight: 600;
}

.demo-button:hover {
    background: #219653;
}

.demo-button.secondary {
    background: #7f8c8d;
}

.demo-button.secondary:hover {
    background: #95a5a6;
}

.quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.quick-btn {
    background: #e8f6f3;
    color: #27ae60;
    border: 1px solid #27ae60;
    padding: 0.5rem 0.9rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

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

/* Salida de resultados */
.xml-output {
    background: #2d3436;
    color: #dfe6e9;
    padding: 1.2rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 420px;
    overflow-y: auto;
}

.result-box {
    border-radius: 8px;
    padding: 1rem 1.2rem;
    border: 2px solid #dfe6e9;
    margin-bottom: 1rem;
}

.result-box.success {
    border-color: #27ae60;
    background: #e8f6f3;
    color: #1e7e46;
}

.result-box.error {
    border-color: #e74c3c;
    background: #fdeaea;
    color: #c0392b;
}

.result-box.info {
    border-color: #3498db;
    background: #eaf4fd;
    color: #21618c;
}

.result-box strong {
    display: block;
    margin-bottom: 0.3rem;
}

.tree-view {
    font-family: monospace;
    white-space: pre;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #dfe6e9;
    margin-top: 1rem;
    overflow-x: auto;
}

/* Explicación del código */
.code-breakdown {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
}

.code-block {
    background: #2d3436;
    color: white;
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 2rem;
    overflow-x: auto;
}

.code-block h3 {
    color: #dfe6e9;
    margin-top: 0;
    margin-bottom: 1rem;
}

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

.code-block code {
    color: #4443aa;
    font-family: 'Courier New', monospace;
}

.explanation-points {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.explanation-point {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #27ae60;
}

.explanation-point h4 {
    color: #27ae60;
    margin-top: 0;
    margin-bottom: 1rem;
}

.code-line {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
    border-left: 3px solid #27ae60;
    font-family: 'Courier New', monospace;
    color: #2c3e50;
    font-weight: bold;
    line-height: 1.8;
    overflow-x: auto;
}

.concept-box {
    background: #e8f4fd;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    border-left: 3px solid #3498db;
}

.concept-box h5 {
    color: #3498db;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

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

.concept-card {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.concept-card h3 {
    color: #27ae60;
    margin-top: 0;
    margin-bottom: 1rem;
}

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

.concept-card li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Ejercicio */
.exercise {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
}

.exercise h3 {
    color: #27ae60;
    margin-top: 0;
}

.exercise ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.exercise li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.solution-toggle {
    margin-top: 1.5rem;
}

.toggle-button {
    background: #27ae60;
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    width: 100%;
    font-weight: 600;
}

.toggle-button:hover {
    background: #219653;
}

.solution-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: white;
    margin-top: 1rem;
    border-radius: 4px;
}

.solution-content.expanded {
    max-height: 3000px;
}

.solution {
    padding: 1.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.solution:last-child {
    border-bottom: none;
}

.solution h4 {
    color: #27ae60;
    margin-top: 0;
    margin-bottom: 1rem;
}

.solution pre {
    overflow-x: auto;
}

/* Navegación */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.nav-button {
    display: inline-block;
    padding: 1rem 1.5rem;
    background: #27ae60;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
    text-align: center;
    flex: 1;
}

.nav-button:hover {
    background: #219653;
    text-decoration: none;
    color: white;
}

.nav-button.prev {
    background: #7f8c8d;
}

.nav-button.prev:hover {
    background: #95a5a6;
}

/* Responsive */
@media (max-width: 768px) {
    .example-article {
        padding: 1rem;
    }

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

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

    .nav-buttons {
        flex-direction: column;
    }

    .example-title {
        font-size: 1.8rem;
    }

    .code-breakdown {
        padding: 1rem;
    }

    .explanation-point {
        padding: 1rem;
    }
}
