/* Sistema de Gestión de Abuso - SieteCapas */
/* Estilos globales consistentes */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --background-color: #f1f5f9;
    --card-background: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header nuevo con estilo azul moderno */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px 0;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

.header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
}

.header p {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Navegación */
.nav-menu {
    background: var(--card-background);
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    display: flex;
    gap: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a.active {
    color: var(--primary-color);
}

/* Cards */
.card {
    background-color: var(--card-background);
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 600;
}

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

.stat-card {
    background-color: var(--card-background);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    margin: 0 0 10px 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 10px 0;
}

.stat-card.primary {
    border-top: 4px solid var(--primary-color);
}

.stat-card.warning {
    border-top: 4px solid var(--warning-color);
}

.stat-card.success {
    border-top: 4px solid var(--success-color);
}

.stat-card.danger {
    border-top: 4px solid var(--danger-color);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Table wrapper - remove scroll */
.table-responsive {
    width: 100%;
}

th, td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    text-overflow: ellipsis;
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

tbody tr:hover {
    background-color: #f8fafc;
}

/* Column widths for clients table */
.clients-table th:nth-child(1), /* ID */
.clients-table td:nth-child(1) {
    width: 5%;
}

.clients-table th:nth-child(2), /* Nombre */
.clients-table td:nth-child(2) {
    width: 18%;
}

.clients-table th:nth-child(3), /* Email */
.clients-table td:nth-child(3) {
    width: 22%;
    white-space: normal;
    word-break: break-word;
}

.clients-table th:nth-child(4), /* IP Ranges */
.clients-table td:nth-child(4) {
    width: 18%;
}

.clients-table th:nth-child(5), /* Estado */
.clients-table td:nth-child(5) {
    width: 8%;
}

.clients-table th:nth-child(6), /* Incidentes */
.clients-table td:nth-child(6) {
    width: 8%;
    text-align: center;
}

.clients-table th:nth-child(7), /* Último */
.clients-table td:nth-child(7) {
    width: 10%;
}

.clients-table th:nth-child(8), /* Acciones */
.clients-table td:nth-child(8) {
    width: 11%;
    white-space: nowrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Small buttons */
.btn-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
}

.btn + .btn {
    margin-left: 5px;
}

.btn-success {
    background-color: var(--success-color);
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-secondary {
    background-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #475569;
}

/* Status Badges */
.status-badge,
.status-pending,
.status-notified,
.status-resolved {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-running,
.status-running,
.monitor-status.running {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.status-stopped,
.status-stopped,
.monitor-status.stopped {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-notified {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-resolved {
    background-color: #d1fae5;
    color: #065f46;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Alerts */
.alert {
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 500;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Code blocks */
code {
    background-color: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--primary-dark);
}

pre {
    background-color: #f1f5f9;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 30px 0;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 2rem;
    }
}

/* Utility classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mb-0 {
    margin-bottom: 0;
}

.mt-20 {
    margin-top: 20px;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

/* Loading spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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