/* Estilos espec�ficos para la p�gina de Sockets en Dart */

.tutorial-article {
    max-width: 1200px;
    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;
}

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

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

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #3498db;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.content-section {
    margin-bottom: 3rem;
}

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

/* Caracter�sticas principales */
.feature-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.feature-item {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid #ecf0f1;
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.feature-item h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* Arquitectura de Sockets */
.structure-visual {
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.socket-architecture {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 2rem;
}

.socket-client, .socket-server {
    flex: 1;
    display: flex;
    justify-content: center;
}

.socket-node {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 2px solid #3498db;
    text-align: center;
    position: relative;
    min-width: 150px;
}

.socket-node i {
    font-size: 2rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.socket-connector {
    position: absolute;
    top: 50%;
    width: 30px;
    height: 2px;
    background: #3498db;
}

.socket-connector.right {
    right: -30px;
}

.socket-connector.left {
    left: -30px;
}

.socket-network {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.network-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3498db, transparent);
    margin: 1rem 0;
}

.network-icon i {
    font-size: 2rem;
    color: #7f8c8d;
    padding: 0.5rem;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.data-flow {
    display: flex;
    justify-content: space-around;
    margin-top: 2rem;
    gap: 2rem;
}

.flow-request, .flow-response {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid #ecf0f1;
}

.flow-request i {
    color: #27ae60;
}

.flow-response i {
    color: #e74c3c;
}

/* Ejemplos de c�digo */
.code-example {
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.code-example h4 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

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

.code-example code {
    font-family: 'Courier New', monospace;
    color: #2c3e50;
    line-height: 1.5;
}

.example-code {
    background: #2c3e50;
    border-radius: 6px;
    overflow: hidden;
    margin: 1rem 0;
}

.example-code.full-width {
    width: 100%;
}

.example-code pre {
    margin: 0;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    max-height: 400px;
    overflow-y: auto;
}

.example-code h4 {
    background: #34495e;
    color: white;
    padding: 0.75rem 1rem;
    margin: 0;
    font-size: 1rem;
}

.server-example, .client-example {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.code-explanation {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.explanation-step {
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.explanation-step h4 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

/* Demo interactivo */
.interactive-demo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
    padding: 2rem;
    border-radius: 8px;
}

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

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    color: #2c3e50;
}

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

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

.demo-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.demo-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.demo-btn.small {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.send-btn {
    background: #27ae60;
}

.send-btn:hover {
    background: #219653;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: #27ae60;
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: #e74c3c;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.client-count {
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
    text-align: center;
}

.log-controls {
    display: flex;
    gap: 0.5rem;
}

/* Terminal */
.terminal-container {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.terminal-header {
    background: #3c3c3c;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-title {
    color: #cccccc;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.terminal-controls {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
}

.control-btn.minimize {
    background: #f39c12;
}

.control-btn.maximize {
    background: #27ae60;
}

.control-btn.close {
    background: #e74c3c;
}

.terminal-body {
    padding: 1rem;
    height: 300px;
    display: flex;
    flex-direction: column;
}

.terminal-logs {
    flex: 1;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.log-entry {
    padding: 0.25rem 0;
    border-bottom: 1px solid #333;
}

.log-time {
    color: #999;
    margin-right: 1rem;
}

.log-source {
    font-weight: bold;
    margin-right: 0.5rem;
}

.log-entry.server .log-source {
    color: #3498db;
}

.log-entry.client .log-source {
    color: #9b59b6;
}

.log-entry.info .log-source {
    color: #f39c12;
}

.log-entry.error .log-source {
    color: #e74c3c;
}

.log-message {
    color: #cccccc;
}

.terminal-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #2c2c2c;
    border-radius: 4px;
}

.prompt {
    color: #27ae60;
    font-weight: bold;
}

.terminal-input input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.terminal-input input:focus {
    outline: none;
}

/* Panel de clientes */
.clients-panel {
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e1e8ed;
    margin-top: 1rem;
}

.clients-panel h4 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clients-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.client-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.client-avatar {
    width: 32px;
    height: 32px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.client-info {
    flex: 1;
}

.client-name {
    font-weight: 600;
    color: #2c3e50;
}

.client-status {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.client-status.online {
    color: #27ae60;
}

/* Propiedades */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

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

.property-item h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.property-values {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.value-tag {
    background: #3498db;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Casos de uso */
.use-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

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

.use-case h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mejores pr�cticas */
.best-practices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.practice-tip {
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.practice-tip h4 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Ejercicios */
.exercises {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.exercise {
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #27ae60;
}

.exercise h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 1rem;
}

.exercise-hint {
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.exercise-hint p {
    margin: 0;
    font-style: italic;
}

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

.resource-item {
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

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

.resource-item a {
    color: #3498db;
    text-decoration: none;
}

.resource-item a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .interactive-demo {
        grid-template-columns: 1fr;
    }
    
    .socket-architecture {
        flex-direction: column;
        gap: 2rem;
    }
    
    .data-flow {
        flex-direction: column;
        align-items: center;
    }
}
