/* Estilos para la página de diagramas */

.diagramas-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 50px 20px;
    text-align: center;
}

.diagramas-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.diagramas-hero p {
    font-size: 1.1rem;
    opacity: 0.95;
}

.diagramas-container {
    background-color: #f5f5f5;
    padding: 2rem 0;
}

.diagram-section {
    background: white;
    margin-bottom: 2rem;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.diagram-section h2 {
    color: #667eea;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.diagram-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: start;
}

.diagram-info h3 {
    color: #667eea;
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

.diagram-info p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.formal-definition {
    background: #f0f4ff;
    border-left: 4px solid #667eea;
    padding: 1.5rem;
    border-radius: 5px;
    margin: 1.5rem 0;
}

.formal-definition h4 {
    color: #667eea;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.formal-definition ul {
    list-style: none;
    padding-left: 0;
}

.formal-definition li {
    margin-bottom: 0.5rem;
    color: #333;
    padding-left: 1.5rem;
    position: relative;
}

.formal-definition li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #667eea;
}

/* Tabla de Transición */
.transition-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
}

.transition-table th {
    background: #667eea;
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border: 1px solid #667eea;
}

.transition-table td {
    padding: 0.75rem;
    border: 1px solid #ddd;
    text-align: center;
}

.transition-table tr:hover {
    background: #f0f4ff;
}

.transition-table code {
    background: #f5f5f5;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* Diagrama Visual */
.diagram-visual {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
}

.state-diagram {
    max-width: 100%;
    height: auto;
}

/* Elementos SVG -->
.state {
    fill: #e8f0ff;
    stroke: #667eea;
    stroke-width: 2;
}

.state.accepting {
    fill: #e8ffe8;
    stroke: #28a745;
    stroke-width: 2;
}

.state-label {
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    text-anchor: middle;
    fill: #333;
}

.state-label.small {
    font-size: 12px;
}

.transition {
    stroke: #667eea;
    stroke-width: 2;
    fill: none;
    marker-end: url(#arrowhead);
}

.arrow-head {
    fill: #667eea;
}

.arrow-initial {
    stroke: #333;
    stroke-width: 2;
}

.arrow-head-initial {
    fill: #333;
}

.transition-label {
    font-family: Arial, sans-serif;
    font-size: 12px;
    fill: #667eea;
    font-weight: bold;
    text-anchor: middle;
}

/* Ejemplos */
.examples-info {
    background: #fff9e6;
    border-left: 4px solid #ffc107;
    padding: 1.5rem;
    border-radius: 5px;
}

.examples-info h4 {
    color: #ff9800;
    margin-top: 0;
    margin-bottom: 1rem;
}

.examples-info ul {
    list-style: none;
    padding-left: 0;
}

.examples-info li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 0.95rem;
}

.examples-info li:before {
    position: absolute;
    left: 0;
    font-weight: bold;
}

.examples-info code {
    background: #fff0d9;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #667eea;
    font-weight: bold;
}

/* Conceptos Clave */
.concepts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.concept {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.concept h4 {
    color: #667eea;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.concept p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Info Section (Conceptos) */
.diagram-section.info-section {
    background: linear-gradient(135deg, #f0f4ff 0%, #fff9e6 100%);
    border: 2px solid #667eea;
}

.diagram-section.info-section h2 {
    border-bottom: 2px solid #667eea;
}

/* Responsive */
@media (max-width: 1024px) {
    .diagram-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .diagram-visual {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .diagram-section {
        padding: 1.5rem;
    }

    .diagram-section h2 {
        font-size: 1.4rem;
    }

    .transition-table {
        font-size: 0.85rem;
    }

    .transition-table th,
    .transition-table td {
        padding: 0.5rem;
    }

    .concepts-grid {
        grid-template-columns: 1fr;
    }

    .diagramas-hero h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 600px) {
    .state-diagram {
        transform: scale(0.8);
        transform-origin: center;
    }

    .diagram-visual {
        min-height: 250px;
    }

    .transition-table {
        font-size: 0.75rem;
    }
}
