/**
 * ============================================================================
 * ESTILOS CSS - Sistema de Gestión de Actividades de Vendedores
 * ============================================================================
 *
 * Este archivo contiene todos los estilos personalizados de la aplicación.
 * Utiliza Bootstrap 5 como framework base.
 */

/* ============================================================================
   VARIABLES CSS
   ============================================================================ */
:root {
    /* Colores principales */
    --primary-color: #0d6efd;
    --primary-dark: #0a58ca;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;

    /* Colores de fondo */
    --bg-light: #f8f9fa;
    --bg-dark: #212529;
    --bg-card: #ffffff;

    /* Colores de texto */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;

    /* Sombras */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);

    /* Bordes */
    --border-radius: 0.5rem;
    --border-color: #dee2e6;

    /* Transiciones */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
}

/* ============================================================================
   ESTILOS GENERALES
   ============================================================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Contenido principal */
.main-content {
    flex: 1;
    padding: 1.5rem;
}

/* ============================================================================
   NAVBAR
   ============================================================================ */
.navbar {
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-link {
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.9) !important;
}

.nav-link.active {
    font-weight: 600;
}

/* ============================================================================
   TARJETAS Y CONTENEDORES
   ============================================================================ */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-normal);
}

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

.card-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

/* Tarjetas de estadísticas */
.stat-card {
    border-left: 4px solid var(--primary-color);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-card.info {
    border-left-color: var(--info-color);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================================
   PÁGINA DE LOGIN
   ============================================================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.login-card .logo {
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.login-card .logo i {
    font-size: 2.5rem;
    color: white;
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ============================================================================
   FORMULARIOS
   ============================================================================ */
.form-control,
.form-select {
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.input-group-text {
    background-color: var(--bg-light);
    border-color: var(--border-color);
}

/* Campos con iconos */
.form-icon {
    position: relative;
}

.form-icon .form-control {
    padding-left: 2.75rem;
}

.form-icon .icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    z-index: 4;
}

/* ============================================================================
   BOTONES
   ============================================================================ */
.btn {
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

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

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-icon {
    padding: 0.5rem;
    line-height: 1;
}

/* ============================================================================
   TABLAS
   ============================================================================ */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Tabla responsiva */
.table-responsive {
    border-radius: var(--border-radius);
}

/* ============================================================================
   BADGES Y ETIQUETAS
   ============================================================================ */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
    border-radius: 0.375rem;
}

/* Estados de resultado */
.badge-exitoso {
    background-color: var(--success-color);
    color: white;
}

.badge-pendiente {
    background-color: var(--warning-color);
    color: var(--text-primary);
}

.badge-sin_respuesta {
    background-color: var(--secondary-color);
    color: white;
}

.badge-rechazado {
    background-color: var(--danger-color);
    color: white;
}

.badge-en_proceso {
    background-color: var(--info-color);
    color: var(--text-primary);
}

/* ============================================================================
   MODALES
   ============================================================================ */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* ============================================================================
   ALERTAS Y NOTIFICACIONES
   ============================================================================ */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
}

.alert-dismissible .btn-close {
    padding: 1.25rem;
}

/* Toast de notificaciones */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
}

.toast {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

/* ============================================================================
   GRÁFICOS
   ============================================================================ */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ============================================================================
   LISTA DE ACTIVIDADES
   ============================================================================ */
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.activity-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================================================
   SEGUIMIENTOS PENDIENTES
   ============================================================================ */
.followup-card {
    border-left: 4px solid var(--warning-color);
}

.followup-card.overdue {
    border-left-color: var(--danger-color);
}

.followup-date {
    font-size: 0.875rem;
    font-weight: 600;
}

.followup-date.overdue {
    color: var(--danger-color);
}

/* ============================================================================
   PAGINACIÓN
   ============================================================================ */
.pagination {
    margin-bottom: 0;
}

.page-link {
    border-radius: var(--border-radius);
    margin: 0 0.125rem;
    border: none;
    color: var(--text-primary);
}

.page-link:hover {
    background-color: var(--bg-light);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
}

/* ============================================================================
   UTILIDADES
   ============================================================================ */
/* Cursor pointer */
.cursor-pointer {
    cursor: pointer;
}

/* Texto truncado */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Separadores */
.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 1rem 0;
}

/* Sombras */
.shadow-hover:hover {
    box-shadow: var(--shadow-md);
}

/* Estados vacíos */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state .icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h5 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* ============================================================================
   FOOTER
   ============================================================================ */
.footer {
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .stat-card .stat-icon {
        font-size: 2rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    .btn {
        padding: 0.5rem 1rem;
    }

    .login-card {
        margin: 1rem;
        padding: 1.5rem;
    }

    .chart-container {
        height: 250px;
    }
}

@media (max-width: 576px) {
    .navbar-brand span {
        display: none;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }
}

/* ============================================================================
   ANIMACIONES
   ============================================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

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

.pulse {
    animation: pulse 2s infinite;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
