/* Estilos personalizados para OSDINET */
/* Colores basados en el logo corporativo */

:root {
    /* Colores principales del logo */
    --primary-color: #1565c0;
    --primary-dark: #0d47a1;
    --primary-light: #42a5f5;
    --secondary-color: #006837;
    --secondary-dark: #004a24;
    --secondary-light: #2e7d32;
    
    /* Colores de acento */
    --accent-color: #00bcd4;
    --accent-dark: #00838f;
    --accent-light: #4dd0e1;
    
    /* Colores de estado */
    --success-color: #2e7d32;
    --warning-color: #f9a825;
    --danger-color: #c62828;
    --info-color: #0288d1;
    
    /* Colores neutros */
    --dark-color: #263238;
    --light-color: #eceff1;
    --gray-color: #546e7a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
}

/* Login */
.bg-login {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--secondary-color) 100%);
}

/* Sidebar */
.sidebar {
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-section {
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    margin-top: 1rem;
}

/* Stats Cards */
.stats-card {
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stats-card .card-body {
    padding: 1.5rem;
}

/* Badges */
.badge.bg-orange {
    background-color: #fd7e14 !important;
}

/* Tablas */
.table {
    font-size: 0.9rem;
}

.table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
}

/* Formularios */
.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(79, 195, 247, 0.25);
}

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

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

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
}

/* Timeline de bitácora */
.timeline {
    position: relative;
    padding: 0;
    list-style: none;
}

.timeline:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding-left: 50px;
}

.timeline-item:before {
    content: '';
    position: absolute;
    left: 12px;
    top: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--accent-color);
}

.timeline-item.aceptado:before {
    background: var(--success-color);
    box-shadow: 0 0 0 2px var(--success-color);
}

.timeline-item.rechazado:before {
    background: var(--danger-color);
    box-shadow: 0 0 0 2px var(--danger-color);
}

.timeline-item.en_camino:before {
    background: var(--warning-color);
    box-shadow: 0 0 0 2px var(--warning-color);
}

.timeline-item.finalizado:before {
    background: var(--info-color);
    box-shadow: 0 0 0 2px var(--info-color);
}

/* Mapa */
#mapa-ingenieros {
    min-height: 400px;
}

/* Rating stars */
.rating-stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 5px;
}

.rating-stars input {
    display: none;
}

.rating-stars label {
    cursor: pointer;
    font-size: 2rem;
    color: #ddd;
    transition: color 0.2s;
}

.rating-stars label:hover,
.rating-stars label:hover ~ label,
.rating-stars input:checked ~ label {
    color: #ffc107;
}

/* Notificaciones */
.notification-item {
    transition: all 0.3s;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #e3f2fd;
    border-left: 3px solid var(--accent-color);
}

/* Loading spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        padding: 8px 8px 12px 8px;
        width: 100%;
    }
    
    .stats-card h2 {
        font-size: 1.15rem;
    }
    
    .container-fluid {
        padding: 0 6px;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Status indicators */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.status-dot.available {
    background-color: var(--success-color);
}

.status-dot.busy {
    background-color: var(--warning-color);
}

.status-dot.unavailable {
    background-color: var(--danger-color);
}

/* Traducir texto de inputs file a español */
input[type="file"]::file-selector-button {
    content: 'Examinar...';
}

input[type="file"]::-webkit-file-upload-button {
    content: 'Examinar...';
}

/* Forzar texto en español para browse button */
input[type="file"] + label::before,
input[type="file"]::before {
    content: 'Seleccionar archivo';
}

/* Actualización de colores para botones y elementos */
.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);
}

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

.btn-success:hover {
    background-color: var(--secondary-dark);
    border-color: var(--secondary-dark);
}

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

.btn-info:hover {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
}

/* Actualizar gradientes de tarjetas */
.card-header.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
}

.card-header.bg-success {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark)) !important;
}

.card-header.bg-info {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark)) !important;
}

/* Sidebar active link */
.sidebar-menu li a.active {
    background: linear-gradient(90deg, rgba(21, 101, 192, 0.3), transparent);
    border-left: 4px solid var(--accent-color);
}

/* Stats cards con gradientes */
.stats-card.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
}

.stats-card.bg-success {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark)) !important;
}

.stats-card.bg-info {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark)) !important;
}

.stats-card.bg-warning {
    background: linear-gradient(135deg, #fbc02d, #f9a825) !important;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===================================
   CORRECCIÓN DE LAYOUT - Contenido Centrado
   =================================== */

/* Asegurar que el body ocupe todo el viewport */
body {
    min-height: 100vh;
    overflow-x: hidden;
}

/* Contenedor principal fluido */
.container-fluid {
    max-width: 100%;
    padding-right: var(--bs-gutter-x, 0.75rem);
    padding-left: var(--bs-gutter-x, 0.75rem);
    margin-right: auto;
    margin-left: auto;
}

/* Main content bien alineado */
.main-content {
    margin-left: 250px;
    padding: 2rem;
    width: calc(100% - 250px);
    float: right;
}

/* Navbar superior */
.navbar {
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
}

/* Cards con mejor spacing */
.card {
    margin-bottom: 1.5rem;
}

/* Títulos bien posicionados */
.h2, h2 {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Bordes inferiores */
.border-bottom {
    margin-bottom: 1.5rem !important;
    padding-bottom: 1rem !important;
}

/* Tablas responsive */
.table-responsive {
    margin-top: 1rem;
    border-radius: 0.5rem;
}

/* Footer spacing */
.card-footer {
    padding: 1rem 1.25rem;
    background-color: rgba(0,0,0,.03);
    border-top: 1px solid rgba(0,0,0,.125);
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 1rem;
        width: 100%;
        float: none;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .container-fluid {
        padding: 0;
    }
}

/* Alinear contenido de cards */
.card-body {
    padding: 1.25rem;
}

/* Botones de acción */
.btn-group, .btn-group-vertical {
    margin: 0.25rem 0;
}

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

.form-control, .form-select {
    margin-bottom: 0.5rem;
}

/* Alertas */
.alert {
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
}

/* Estadísticas cards */
.row.g-4 {
    margin: 0 -1rem;
}

.row.g-4 > * {
    padding: 0 1rem;
}

/* ===================================
   ESCALA 90% - Elementos adicionales
   =================================== */

/* Font-size general reducido */
body {
    font-size: 14px;
}

/* Tablas DataTables */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 8px;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: 8px;
    font-size: 13px;
}

.dataTables_length select {
    padding: 0.35rem 0.5rem;
    font-size: 13px;
}

.dataTables_filter input {
    padding: 0.35rem 0.6rem;
    font-size: 13px;
    margin-left: 0.4rem;
}

/* Select2 */
.select2-container .select2-selection--single {
    padding: 0.4rem 0.6rem;
    font-size: 13px;
    height: 34px;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    font-size: 13px;
    line-height: 26px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 32px;
}

/* Iconos Bootstrap */
.bi {
    font-size: 0.9em;
}

/* Sidebar links */
.sidebar-menu li a {
    padding: 0.6rem 1.2rem;
    font-size: 13px;
}

.sidebar-brand {
    padding: 1.2rem;
    font-size: 1.15rem;
}

/* Navbar */
.navbar {
    padding: 0.6rem 1rem;
}

.nav-link {
    padding: 0.5rem 0.8rem;
    font-size: 13px;
}

/* Dropdown */
.dropdown-menu {
    font-size: 13px;
    min-width: 180px;
}

/* Tooltips */
.tooltip {
    font-size: 12px;
}

/* Pagination */
.pagination {
    margin: 8px 0 0 0;
}

.page-link {
    padding: 0.4rem 0.65rem;
    font-size: 13px;
}

/* Progress bars */
.progress {
    height: 18px;
    font-size: 11px;
}

/* List groups */
.list-group-item {
    padding: 0.6rem 0.9rem;
    font-size: 13px;
}

/* Modal */
.modal-header, .modal-body, .modal-footer {
    padding: 0.9rem;
}

.modal-title {
    font-size: 1.1rem;
}

/* Toast */
.toast {
    padding: 0.65rem 0.9rem;
    font-size: 13px;
}

/* Breadcrumb */
.breadcrumb {
    padding: 0.4rem 0;
    margin-bottom: 8px;
    font-size: 13px;
}

.breadcrumb-item {
    font-size: 13px;
}
