/**
 * Estilos CSS - Sistema de Consultas Chacao
 * Tema azul moderno y profesional
 */

/* Variables CSS */
:root {
    --primary-color: #0056b3;
    --primary-dark: #004085;
    --primary-light: #66b3ff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --blue-gradient: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    --light-blue: #e3f2fd;
    --medium-blue: #90caf9;
    --accent-blue: #2196f3;
}

/* Estilos globales */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

/* Navbar personalizada */
.navbar-custom {
    background: var(--blue-gradient);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-bottom: 3px solid var(--primary-dark);
}

.navbar-custom .navbar-brand {
    color: white !important;
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-custom .navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    transition: all 0.3s ease;
    border-radius: 5px;
    margin: 0 2px;
}

.navbar-custom .navbar-nav .nav-link:hover,
.navbar-custom .navbar-nav .nav-link.active {
    color: white !important;
    background-color: rgba(255,255,255,0.1);
}

/* Botones personalizados */
.btn-primary-custom {
    background: var(--blue-gradient);
    border: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,86,179,0.3);
}

.btn-primary-custom:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,86,179,0.4);
}

.btn-outline-primary-custom {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-primary-custom:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* Botones de acción Bootstrap mejorados */
.btn-action {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
    height: auto;
    white-space: nowrap;
}

.btn-action i {
    font-size: 12px;
    margin-right: 4px;
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

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

/* Botones con colores Bootstrap */
.btn-action.btn-view {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
    color: white;
}

.btn-action.btn-view:hover {
    background-color: #0aa2c0;
    border-color: #0aa2c0;
    color: white;
}

.btn-action.btn-edit {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-action.btn-edit:hover {
    background-color: #5c636a;
    border-color: #5c636a;
    color: white;
}

.btn-action.btn-edit:disabled {
    background-color: #adb5bd;
    border-color: #adb5bd;
    color: white;
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.btn-action.btn-status {
    background-color: #198754;
    border-color: #198754;
    color: white;
}

.btn-action.btn-status:hover {
    background-color: #157347;
    border-color: #157347;
    color: white;
}

.btn-action.btn-delete {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-action.btn-delete:hover {
    background-color: #bb2d3b;
    border-color: #b02a37;
    color: white;
}

/* Botones sin iconos (solo texto) */
.btn-action.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-action.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* Dropdown de acciones Bootstrap */
.btn-group .btn-action {
    border-radius: 0;
}

.btn-group .btn-action:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.btn-group .btn-action:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.btn-group .btn-action:not(:last-child) {
    border-right: 1px solid rgba(255,255,255,0.2);
}

/* Ajustes para dropdown items */
.dropdown-menu {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
    font-size: 13px;
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 13px;
    line-height: 1.4;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    border-left-color: #0d6efd;
    color: #0d6efd;
}

.dropdown-item i {
    width: 14px;
    text-align: center;
    margin-right: 8px;
    font-size: 12px;
}

/* Badges de estado mejorados */
.badge {
    font-size: 11px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.encuesta-status {
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.encuesta-status.borrador {
    background-color: #6c757d;
    color: white;
}

.encuesta-status.activa {
    background-color: #198754;
    color: white;
}

.encuesta-status.finalizada {
    background-color: #dc3545;
    color: white;
}

/* Cards personalizados */
.card-custom {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.card-header-custom {
    background: var(--blue-gradient);
    color: white;
    font-weight: 600;
    border-bottom: none;
    padding: 1rem 1.5rem;
}

/* Sidebar */
.sidebar-custom {
    background: linear-gradient(180deg, #0056b3 0%, #004085 100%);
    min-height: calc(100vh - 56px);
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.sidebar-custom .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    border-radius: 5px;
    margin: 2px 10px;
    transition: all 0.3s ease;
}

.sidebar-custom .nav-link:hover,
.sidebar-custom .nav-link.active {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-custom .nav-link i {
    width: 20px;
    margin-right: 10px;
}

/* Actividades mejoradas */
.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 12px;
    border-left: 3px solid var(--primary-color);
    background: linear-gradient(90deg, rgba(0, 86, 179, 0.05) 0%, transparent 100%);
    border-radius: 0 8px 8px 0;
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: linear-gradient(90deg, rgba(0, 86, 179, 0.1) 0%, transparent 100%);
    transform: translateX(3px);
}

.activity-action {
    flex: 1;
    margin-left: 10px;
}

.activity-action .fas {
    width: 16px;
    text-align: center;
}

.activity-desc {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--light-color);
    border-radius: 4px;
    border-left: 2px solid var(--medium-blue);
}

/* Códigos de consulta */
.consulta-codigo {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--primary-color);
    background: rgba(0, 86, 179, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--primary-color);
    font-size: 0.9em;
}

.consulta-codigo:hover {
    background: rgba(0, 86, 179, 0.2);
    transform: scale(1.05);
    transition: all 0.3s ease;
}

/* Formularios */
.form-control-custom {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.form-control-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,86,179,0.25);
}

.form-label-custom {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

/* Tablas */
.table-custom {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table-custom thead {
    background: var(--blue-gradient);
    color: white;
}

.table-custom tbody tr {
    transition: all 0.3s ease;
}

.table-custom tbody tr:hover {
    background-color: var(--light-blue);
}

/* Alertas personalizadas */
.alert-custom {
    border-radius: 10px;
    border: none;
    padding: 15px 20px;
}

.alert-success-custom {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger-custom {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning-custom {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info-custom {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

/* Login específico */
.logo-container {
    width: 80px;
    height: 80px;
    background: var(--blue-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 4px 8px rgba(0,86,179,0.3);
}

.logo-container i {
    color: white;
}

/* Dashboard */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    background: var(--light-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.stat-card .stat-icon i {
    color: var(--primary-color);
    font-size: 24px;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-card .stat-label {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Encuestas */
.encuesta-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.encuesta-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.encuesta-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.encuesta-status.activa {
    background-color: #d4edda;
    color: #155724;
}

.encuesta-status.borrador {
    background-color: #fff3cd;
    color: #856404;
}

.encuesta-status.finalizada {
    background-color: #f8d7da;
    color: #721c24;
}

/* Preguntas de encuesta */
.pregunta-item {
    background: var(--light-blue);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
}

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

.pregunta-item .pregunta-tipo {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Estilos específicos para tablas de resultados */
.pregunta-respuesta .table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pregunta-respuesta .table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.pregunta-respuesta .table tbody tr {
    transition: background-color 0.2s ease;
}

.pregunta-respuesta .table tbody tr:hover {
    background-color: #f8f9fa;
}

.pregunta-respuesta .table td,
.pregunta-respuesta .table th {
    padding: 12px;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

/* Asegurar que todas las filas de la tabla sean visibles */
.pregunta-respuesta .table tbody tr {
    display: table-row !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Progress bars en tablas */
.pregunta-respuesta .progress {
    height: 20px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.pregunta-respuesta .progress-bar {
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    color: white;
    transition: width 0.6s ease;
}

/* Respuestas textuales */
.respuesta-texto {
    background: white;
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
    margin: 5px 0;
    word-wrap: break-word;
    max-width: 100%;
}

/* Charts */
.chart-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar-custom {
        min-height: auto;
    }
    
    .navbar-custom .navbar-brand {
        font-size: 1.2rem;
    }
    
    .stat-card {
        margin-bottom: 15px;
    }
    
    .card-custom {
        margin-bottom: 15px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,86,179,0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Tooltips personalizados */
.tooltip-custom {
    background: var(--dark-color);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Progress bars */
.progress-custom {
    height: 8px;
    border-radius: 4px;
    background-color: #e0e0e0;
    overflow: visible;
}

.progress-bar-custom {
    background: var(--blue-gradient);
    border-radius: 4px;
    position: relative;
}

.progress-bar-custom::after {
    content: attr(data-percent);
    position: absolute;
    right: 10px;
    top: -20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Badges */
.badge-primary-custom {
    background: var(--blue-gradient);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Paginación */
.pagination-custom .page-link {
    color: var(--primary-color);
    border: 1px solid #dee2e6;
    padding: 8px 12px;
}

.pagination-custom .page-link:hover {
    background-color: var(--light-blue);
    color: var(--primary-color);
}

.pagination-custom .page-item.active .page-link {
    background: var(--blue-gradient);
    border-color: var(--primary-color);
}

/* Print styles */
@media print {
    .sidebar-custom,
    .navbar-custom,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .card-custom {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}
