:root {
    --color-rojo: #E63946;
    --color-blanco: #FFFFFF;
    --color-azul: #1D3557;
    --color-gris-claro: #F1FAEE;
    --color-gris-oscuro: #457B9D;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--color-gris-claro);
}

.navbar {
    background-color: var(--color-azul);
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    color: var(--color-blanco) !important;
    font-weight: bold;
}

.btn-primary {
    background-color: var(--color-azul);
    border-color: var(--color-azul);
}

.btn-primary:hover {
    background-color: var(--color-gris-oscuro);
    border-color: var(--color-gris-oscuro);
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.card-header {
    background-color: var(--color-azul);
    color: var(--color-blanco);
    border-radius: 10px 10px 0 0 !important;
}

.table {
    background-color: var(--color-blanco);
    border-radius: 10px;
    overflow: hidden;
    padding: .1rem .5rem;
}

.table > :not(caption) > * > * {
    padding: .1rem .5rem;
    font-size: .8rem;
}

.table thead {
    background-color: var(--color-azul);
    color: var(--color-blanco);
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-azul) 0%, var(--color-gris-oscuro) 100%);
}

.login-card {
    background-color: var(--color-blanco);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.dashboard-card {
    transition: transform 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

.search-container {
    background-color: var(--color-blanco);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.form-control:focus {
    border-color: var(--color-azul);
    box-shadow: 0 0 0 0.2rem rgba(29, 53, 87, 0.25);
}

.alert {
    border-radius: 10px;
    border: none;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Estilos para el lector de códigos QR */
#reader {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

#reader video {
    width: 100%;
    border-radius: 8px;
}

#reader select {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#reader button {
    width: 100%;
    padding: 10px;
    background-color: var(--color-azul);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

#reader button:hover {
    background-color: var(--color-gris-oscuro);
}

#reader__scan_region {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

#reader__scan_region img {
    display: none;
}

#reader__dashboard {
    padding: 10px;
    background: white;
    border-radius: 8px;
    margin-top: 10px;
}

#reader__dashboard_section {
    margin-bottom: 10px;
}

#reader__dashboard_section_csr {
    display: none;
}

/* Estilos para la galería de fotos */
.galeria-fotos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.foto-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.foto-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.foto-item .foto-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.foto-item .foto-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.foto-item .btn-eliminar {
    background: rgba(255,0,0,0.7);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.foto-item .btn-eliminar:hover {
    background: rgba(255,0,0,0.9);
}

/* Estilos para el formulario de subida de fotos */
.form-subir-foto {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.form-subir-foto .form-group {
    margin-bottom: 1rem;
}

.form-subir-foto label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-subir-foto input[type="file"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-subir-foto input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-subir-foto button {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.form-subir-foto button:hover {
    background: #0056b3;
}

/* Estilos para el zoom de imágenes dentro del modal */
.zoom-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
}

.zoom-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.zoom-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.zoom-info {
    position: absolute;
    bottom: -40px;
    left: 0;
    color: white;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
    max-width: 100%;
}

.btn-close-zoom {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.btn-close-zoom:hover {
    color: #ccc;
}

/* Ajuste para el modal de fotos */
.modal-body {
    position: relative;
    min-height: 200px;
}

/* Estilos para el modal de vista previa */
.modal-preview {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    padding: 2rem;
}

.modal-preview img {
    max-width: 90%;
    max-height: 90vh;
    margin: auto;
    display: block;
}

.modal-preview .close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Estilos para el visor de imágenes */
.image-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1100;
    cursor: pointer;
}

.image-viewer img {
    max-width: 90%;
    max-height: 90vh;
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
}

.image-viewer .close-viewer {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    z-index: 1101;
}

.image-viewer .image-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: white;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
    max-width: 80%;
}

/* Estilos para el sistema de búsqueda y filtros */
.search-filters {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-filters .card-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-radius: 10px 10px 0 0;
}

.search-filters .form-control,
.search-filters .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.search-filters .form-control:focus,
.search-filters .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.search-filters .btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.search-filters .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Contador de resultados */
.results-counter {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
}

.results-counter .badge {
    font-size: 0.9rem;
    padding: 8px 12px;
}

/* Resaltado de términos de búsqueda */
mark.bg-warning {
    background-color: #fff3cd !important;
    color: #856404;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: bold;
}

/* Animaciones para filtros */
.filter-animation {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos para botones de filtros */
.filter-btn {
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.filter-btn:hover::before {
    left: 100%;
}

/* Responsive para filtros */
@media (max-width: 768px) {
    .search-filters .row > div {
        margin-bottom: 10px;
    }
    
    .search-filters .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .results-counter {
        text-align: center;
    }
    
    .results-counter .d-flex {
        flex-direction: column;
        gap: 10px;
    }
}

/* Estilos para la tabla con filtros aplicados */
.table-filtered {
    border: 2px solid #007bff;
    border-radius: 8px;
    overflow: hidden;
}

.table-filtered thead th {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.table-filtered tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

/* Indicador de filtros activos */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.filter-tag {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-tag .remove-filter {
    background: none;
    border: none;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    margin-left: 5px;
}

.filter-tag .remove-filter:hover {
    color: #ffc107;
}

/* Loading spinner para búsquedas */
.search-loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.search-loading.show {
    display: block;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Tooltip para filtros */
.filter-tooltip {
    position: relative;
    cursor: help;
}

.filter-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.filter-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
} 