/* Estilos para el simulador */

.simulador-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 50px 20px;
    text-align: center;
}

.simulador-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.simulador-hero p {
    font-size: 1.1rem;
    opacity: 0.95;
}

.simulador-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.simulador-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.controls-section,
.results-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.controls-section h2,
.results-section h2 {
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.control-group input,
.control-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.control-group input:focus,
.control-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.2);
}

.hint {
    display: block;
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

#simulate-btn,
#reset-btn {
    width: 100%;
    margin-bottom: 0.5rem;
}

.automata-info {
    background: #f0f4ff;
    border-left: 4px solid #667eea;
    padding: 1.5rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.automata-info h3 {
    color: #667eea;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.info-content p {
    margin: 0.5rem 0;
    color: #555;
}

.info-details {
    background: white;
    padding: 1rem;
    border-radius: 3px;
    margin-top: 1rem;
}

.info-details p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.info-details strong {
    color: #667eea;
}

.info-details span {
    font-family: 'Courier New', monospace;
    background: #f5f5f5;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}


/* Result Box */
.result-box {
    background: #f9f9f9;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    margin-bottom: 1.5rem;
}

.result-status {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.result-status.accepted {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.result-status.undecidable {
    background: #ffebee;
    color: #c62828;
    border: 2px solid #ef5350;
}

.result-cadena {
    background: white;
    padding: 1rem;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.result-cadena code {
    background: #f5f5f5;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
}

/* Trace Table */
.execution-trace {
    margin: 1.5rem 0;
}

.execution-trace h4 {
    color: #667eea;
    margin-bottom: 1rem;
}

#trace-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

#trace-table th {
    background: #667eea;
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
}

#trace-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #ddd;
    font-family: 'Courier New', monospace;
}

#trace-table tr:hover {
    background: #f0f4ff;
}

#trace-table tbody tr:last-child td {
    border-bottom: 2px solid #667eea;
}

/* Resultado Footer */
.result-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid #ddd;
}

#result-message {
    color: #555;
    font-size: 1rem;
    margin: 0;
}

/* Classification Result */
.classification-result {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #f0f4ff;
    border-radius: 8px;
}

.classification-result h4 {
    color: #667eea;
    margin-top: 0;
    margin-bottom: 1rem;
}

.chomsky-hierarchy {
    max-width: 100%;
    height: auto;
    min-height: 350px;
}

.chomsky-label {
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: bold;
}

/* Trace Details */
.trace-details {
    background: white;
    border-left: 4px solid #667eea;
    padding: 1.5rem;
    border-radius: 5px;
}

.trace-item {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 5px;
}

.trace-item p {
    margin: 0.5rem 0;
    color: #555;
    font-size: 0.95rem;
}

.trace-item strong {
    color: #667eea;
}

/* Error Box */
.error-box {
    background: #f8d7da;
    border: 2px solid #f5c6cb;
    border-radius: 8px;
    padding: 1.5rem;
    color: #721c24;
}

.error-box p {
    margin: 0;
}

/* No Selection */
.no-selection {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
    font-size: 1.1rem;
}

/* Examples Section */
.examples-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.examples-section h2 {
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.example-card {
    background: #f9f9f9;
    border: 2px solid #ddd;
    border-radius: 5px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.example-card:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.example-card .cadena {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.example-card .resultado {
    font-size: 0.9rem;
    color: #666;
}

.placeholder {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
}

/* How It Works */
.how-it-works {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    text-align: center;
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 8px;
    border-top: 4px solid #667eea;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.step h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.step p {
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .simulador-wrapper {
        grid-template-columns: 1fr;
    }

    .examples-grid {
        grid-template-columns: 1fr;
    }

    #trace-table {
        font-size: 0.85rem;
    }

    #trace-table td,
    #trace-table th {
        padding: 0.5rem;
    }

    .simulador-hero h1 {
        font-size: 1.8rem;
    }
}
