/* Estilos para Sistema de Análisis SECOP II */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white;
    min-height: 100vh;
    padding: 20px;
}

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

header {
    background: linear-gradient(135deg, #1e88e5 0%, #1e88e5 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

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

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

/* Tabs */
.tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
    overflow-x: auto;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: #555;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-button:hover {
    background: #e0e0e0;
}

.tab-button.active {
    background: white;
    color: #1e88e5;
    border-bottom: 3px solid #1e88e5;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Cards */
.card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
    margin-top: 10px;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #555;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Status Messages */
.status-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 5px;
    font-weight: 500;
    display: none;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: linear-gradient(135deg, #1e88e5 0%, #1e88e5 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.metric-card h3 {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 10px;
    color: white;
}

.metric-value {
    font-size: 1.3em;
    font-weight: bold;
}

/* Charts */
#charts-container {
    margin-top: 20px;
}

#charts-container>div {
    margin-bottom: 30px;
}

/* Grafo */
#grafo-viz {
    background: #fafafa;
    border-radius: 5px;
}

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

.controls label {
    font-weight: 500;
    color: #555;
}

/* Nodos Principales */
#nodos-principales {
    max-height: 600px;
    overflow-y: auto;
}

.nodo-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.nodo-item:hover {
    background: #f9f9f9;
}

.nodo-item h4 {
    color: #1e88e5;
    margin-bottom: 5px;
}

.nodo-item p {
    color: #666;
    font-size: 0.9em;
}

/* Búsqueda */
#buscar-proveedor {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

#buscar-proveedor:focus {
    outline: none;
    border-color: #1e88e5;
}

#resultados-busqueda {
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    display: none;
}

#resultados-busqueda.show {
    display: block;
}

.resultado-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.resultado-item:hover {
    background: #f0f0f0;
}

/* Detalle Proveedor */
#proveedor-info {
    line-height: 1.8;
}

#proveedor-info h4 {
    color: #1e88e5;
    margin-top: 15px;
    margin-bottom: 10px;
}

#proveedor-info ul {
    list-style: none;
    padding-left: 0;
}

#proveedor-info li {
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

/* Tarjetas de métricas del proveedor */
#proveedor-info .metric-card {
    background: white;
    border: 1px solid #e0e0e0;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

#proveedor-info .metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

#proveedor-info .metric-card h4 {
    color: #1e88e5;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    border-bottom: 2px solid #1e88e5;
    padding-bottom: 10px;
}

#proveedor-info .metric-card ul {
    margin: 0;
}

#proveedor-info .metric-card li {
    padding: 8px 0;
    color: #555;
}

/* Container para gráficos */
.chart-container {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chart-container h4 {
    color: #1e88e5;
    margin-top: 0;
    margin-bottom: 15px;
}

/* Tooltip del grafo */
.graph-tooltip {
    line-height: 1.6;
    transition: opacity 0.2s;
}

.graph-tooltip strong {
    color: #1e88e5;
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

    .tabs {
        flex-direction: column;
    }

    .tab-button {
        text-align: left;
    }

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

    .controls {
        flex-direction: column;
        align-items: stretch;
    }
}