* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.header-nav {
    position: absolute;
    left: 30px;
    top: 30px;
}

.back-btn {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-3px);
}

.download-example-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.download-example-btn:hover {
    background: linear-gradient(135deg, #A0522D 0%, #8B4513 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    padding: 20px;
}

/* Panel de control */
.control-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    height: fit-content;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.control-panel h2 {
    color: #8B4513;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.config-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.config-section h3 {
    color: #654321;
    margin-bottom: 15px;
    font-size: 1.1em;
    border-bottom: 2px solid #A0522D;
    padding-bottom: 5px;
}

.param {
    margin-bottom: 15px;
}

.param label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.param input,
.param select {
    width: 100%;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.param input:focus,
.param select:focus {
    outline: none;
    border-color: #A0522D;
}

.hint {
    display: block;
    font-size: 0.85em;
    color: #888;
    margin-top: 5px;
}

/* Bot\u00f3n de ayuda */
.help-btn {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: #A0522D;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    margin-left: 5px;
    transition: all 0.3s;
}

.help-btn:hover {
    background: #8B4513;
    transform: scale(1.1);
}

select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    margin-bottom: 10px;
}

/* Botones */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin: 5px;
    width: calc(50% - 10px);
}

.btn-full {
    width: calc(100% - 10px);
}

.btn-primary {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
    width: calc(100% - 10px);
}

.btn-danger:hover {
    background: #c82333;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Radio buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: background 0.3s;
}

.radio-group label:hover {
    background: #f0f0f0;
}

.radio-group input[type="radio"] {
    margin-right: 10px;
}

/* Estadísticas */
.stats-section {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
}

.stats-section h3 {
    margin-bottom: 15px;
    color: white;
}

.stats-section p {
    margin: 8px 0;
    font-size: 0.95em;
}

/* Panel de visualización */
.visualization-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.canvas-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.canvas-container h2 {
    color: #8B4513;
    margin-bottom: 15px;
}

#mainCanvas {
    width: 100%;
    height: 600px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.legend-color {
    width: 30px;
    height: 4px;
    border-radius: 2px;
}

.legend-color.ant {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff6b6b;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

/* Panel de información */
.info-panel {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: 100px;
}

.info-panel h3 {
    color: #654321;
    margin-bottom: 10px;
}

#currentState {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
}

/* Gráfico de convergencia */
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chart-container h3 {
    color: #654321;
    margin-bottom: 15px;
}

#chartCanvas {
    width: 100%;
    height: 200px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

/* Slider de velocidad */
#speedSlider {
    width: 100%;
    margin: 10px 0;
}

#speedLabel {
    display: block;
    text-align: center;
    font-weight: 600;
    color: #A0522D;
}

/* Scrollbar personalizado */
.control-panel::-webkit-scrollbar {
    width: 8px;
}

.control-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.control-panel::-webkit-scrollbar-thumb {
    background: #A0522D;
    border-radius: 10px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: #8B4513;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .control-panel {
        max-height: none;
    }
}

/* Instancia info */
#instanceInfo {
    background: #e7f3ff;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    font-size: 0.9em;
    display: none;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #654321 0%, #8B4513 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.footer-content {
    max-width: 1600px;
    margin: 0 auto;
}

.footer-content p {
    margin: 8px 0;
    font-size: 0.95em;
    line-height: 1.6;
}

.footer-content strong {
    font-weight: 600;
}

.footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 15px;
}

.footer-links a {
    color: white;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.footer-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.footer-links svg {
    width: 24px;
    height: 24px;
}

/* Animaciones */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulsing {
    animation: pulse 1s infinite;
}
