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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* Panel de Identificación */
.identification-panel {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.id-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 1rem;
}

.input-large {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.input-large:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Botón Principal de Diagnóstico */
.btn-start-diagnostic {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-start-diagnostic:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-start-diagnostic:active {
    transform: translateY(0);
}

.btn-start-diagnostic:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.5rem;
}

/* Barra de Progreso Global */
.global-progress-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-header span {
    font-weight: 600;
    color: #555;
}

#progress-percentage {
    font-size: 1.2rem;
    color: #667eea;
}

.progress-bar-global {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill-global {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 15px;
}

.current-test {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 8px;
}

/* Resumen de Diagnóstico */
.diagnostic-summary {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.summary-header {
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
}

.summary-header h2 {
    color: #333;
    margin-bottom: 10px;
}

.summary-location {
    font-size: 1.1rem;
    color: #667eea;
    font-weight: 600;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.summary-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.summary-item h3 {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.summary-item .unit {
    font-size: 1rem;
    color: #888;
    margin-left: 5px;
}

.summary-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-save {
    padding: 15px 30px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-save:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-secondary-small {
    padding: 15px 25px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary-small:hover {
    background: #5a6268;
}

/* Herramientas Individuales */
.individual-tools {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.tools-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tools-header h3 {
    color: #555;
}

.btn-toggle {
    padding: 8px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-toggle:hover {
    background: #5568d3;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.tool-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    border: 2px solid #f0f0f0;
    transition: all 0.3s;
}

.tool-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.tool-card.full-width {
    grid-column: 1 / -1;
}

.tool-card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.btn-primary {
    width: 100%;
    padding: 12px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.results {
    margin-bottom: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    margin-bottom: 8px;
    border-radius: 6px;
}

.result-item .label {
    color: #666;
    font-weight: 600;
}

.result-item .value {
    color: #333;
    font-weight: 700;
}

/* WiFi List */
.wifi-list {
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.wifi-item {
    padding: 12px;
    background: #f8f9fa;
    margin-bottom: 8px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wifi-info {
    flex: 1;
}

.wifi-ssid {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.wifi-details {
    font-size: 0.85rem;
    color: #666;
}

.signal-bars {
    display: flex;
    gap: 2px;
    align-items: flex-end;
}

.signal-bar {
    width: 4px;
    background: #ddd;
    border-radius: 2px;
}

.signal-bar.active {
    background: #28a745;
}

.signal-bar:nth-child(1) { height: 8px; }
.signal-bar:nth-child(2) { height: 12px; }
.signal-bar:nth-child(3) { height: 16px; }
.signal-bar:nth-child(4) { height: 20px; }
.signal-bar:nth-child(5) { height: 24px; }

/* Site Classifier */
.site-classifier textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    margin-bottom: 15px;
    resize: vertical;
}

.classification-results {
    margin-top: 20px;
}

.classification-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.stat-item .count {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.stat-item .label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.category-section {
    margin-bottom: 20px;
}

.category-section h4 {
    margin-bottom: 10px;
    color: #555;
}

.classification-item {
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.classification-item.allowed {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.classification-item.blocked {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.classification-item.unknown {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.allowed {
    background: #28a745;
    color: white;
}

.status-badge.blocked {
    background: #dc3545;
    color: white;
}

/* Category Management */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.tab-content {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.tab-content.hidden {
    display: none;
}

.category-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.category-name {
    font-weight: 600;
    color: #333;
}

.category-count {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.site-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.site-tag {
    background: #e9ecef;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.remove-site {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: 20px;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 25px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
}

.history-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-location {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.history-date {
    color: #888;
    font-size: 0.9rem;
}

.history-data {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.history-data-item {
    background: white;
    padding: 10px;
    border-radius: 6px;
}

.history-data-item .label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 4px;
}

.history-data-item .value {
    font-weight: 700;
    color: #333;
}

/* Loading Spinner */
.loading {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin: 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .id-fields {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .btn-start-diagnostic {
        font-size: 1.1rem;
        padding: 18px;
    }

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

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

    .summary-actions {
        flex-direction: column;
    }

    .btn-save,
    .btn-secondary-small {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    header p {
        font-size: 1rem;
    }

    .identification-panel,
    .diagnostic-summary,
    .individual-tools {
        padding: 15px;
    }

    .btn-start-diagnostic {
        font-size: 1rem;
        padding: 15px;
    }
}

.hidden {
    display: none !important;
}

/* Network Discovery */
.network-discovery {
    padding: 10px 0;
}

.discovery-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.network-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.network-info.show {
    display: block;
}

.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.device-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s;
}

.device-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.device-card.router {
    border-left: 4px solid #ff6b6b;
}

.device-card.access-point {
    border-left: 4px solid #4ecdc4;
}

.device-card.switch {
    border-left: 4px solid #95e1d3;
}

.device-card.server {
    border-left: 4px solid #667eea;
}

.device-card.workstation {
    border-left: 4px solid #a8dadc;
}

.device-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.device-icon {
    font-size: 2rem;
}

.device-name {
    flex: 1;
}

.device-type {
    font-size: 0.85rem;
    font-weight: 600;
    color: #667eea;
    text-transform: uppercase;
}

.device-ip {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}

.device-details {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.device-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.9rem;
}

.device-detail-item .label {
    color: #666;
}

.device-detail-item .value {
    font-weight: 600;
    color: #333;
}

.topology-diagram {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    min-height: 400px;
    display: none;
}

.topology-diagram.show {
    display: block;
}

.topology-canvas {
    width: 100%;
    height: 500px;
    background: white;
    border-radius: 8px;
    position: relative;
}

.topology-node {
    position: absolute;
    padding: 15px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    text-align: center;
    min-width: 120px;
    cursor: pointer;
    transition: all 0.3s;
}

.topology-node:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.topology-node.host {
    background: #e3f2fd;
    border-color: #2196f3;
}

.topology-node.router {
    background: #fff3e0;
    border-color: #ff9800;
}

.topology-node.switch {
    background: #e8f5e9;
    border-color: #4caf50;
}

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

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

.legend-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-icon.router { background: #ff6b6b; }
.legend-icon.access-point { background: #4ecdc4; }
.legend-icon.switch { background: #95e1d3; }
.legend-icon.server { background: #667eea; }
.legend-icon.workstation { background: #a8dadc; }

@media (max-width: 768px) {
    .discovery-actions {
        flex-direction: column;
    }
    
    .devices-grid {
        grid-template-columns: 1fr;
    }
}
