/* Estilos para el navbar y elementos comunes */
.navbar-soft {
    background-color: #fff;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 12px;
    margin: 1rem 0;
    padding: 0.5rem 1rem;
}

/* Estilos UI Soft para el fondo y contenedores */
.soft-ui-bg {
    background-color: #f8f9fa;
}

/* Estilos para tarjetas UI Soft */
.card, .soft-ui-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    background-color: #fff;
}

.card:hover, .soft-ui-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
}

.card-body {
    padding: 1.5rem;
}

/* Estilos específicos para los enlaces del navbar */
.navbar-nav .nav-link {
    color: #344767;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link.active {
    color: #3a7afe;
    background-color: rgba(58, 122, 254, 0.1);
}

.navbar-nav .nav-link i {
    color: #3a7afe;
    margin-right: 0.5rem;
}

/* Estilos para el menú desplegable */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    padding: 0.5rem;
}

.dropdown-item {
    color: #344767;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: #3a7afe;
    background-color: rgba(58, 122, 254, 0.1);
}

/* Estilos para el ícono de usuario */
#userDropdown {
    background: transparent !important;
    border: none !important;
    padding: 0.5rem !important;
    margin: 0 0.25rem !important;
    transition: all 0.2s ease !important;
}

#userDropdown i {
    color: #6c757d;
    transition: all 0.2s ease;
}

#userDropdown:hover i,
#userDropdown:focus i,
#userDropdown.show i {
    color: #0d6efd;
    transform: scale(1.1);
}

/* Asegurar que el menú desplegable se muestre por encima de otros elementos */
.dropdown-menu {
    z-index: 99999 !important; /* Aumentado para asegurar que esté por encima de todo */
    position: absolute !important;
    display: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}
.show > .dropdown-menu {
    display: block !important;
}
/* Asegurar que el botón del menú sea clickeable */
.dropdown-toggle { 
    cursor: pointer;
    position: relative;
    z-index: 1;
}
/* Asegurar que el menú no se cierre al hacer clic dentro */
.dropdown-menu {
    pointer-events: auto !important;
}
/* Asegurar que el navbar tenga un z-index adecuado */
.navbar {
    position: relative;
    z-index: 1000 !important;
    background: transparent;
    border-radius: 0;
    margin: 0;
    max-width: none;
    padding: 0;
}
body {
    background-color: #f8f9fa;
}

/* Estilos para el área de arrastrar y soltar imágenes */
#imagePreview {
    min-height: 150px;
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

#imagePreview.border-primary {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
}

/* Estilo para las miniaturas de imágenes */
#imagePreview .col-md-3 {
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
}

#imagePreview img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 0.25rem;
}

#imagePreview .btn-danger {
    opacity: 0;
    transition: opacity 0.2s ease;
    width: 25px;
    height: 25px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

#imagePreview .col-md-3:hover .btn-danger {
    opacity: 1;
}

#imagePreview .col-md-3:hover img {
    transform: scale(1.02);
}

/* Contador de imágenes */
.image-counter {
    display: block;
    font-size: 0.875em;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Navbar */
.navbar-brand {
    font-weight: bold;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    padding: 1.25rem;
}

/* Formularios */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Imágenes */
.image-preview {
    max-width: 200px;
    margin: 10px 0;
    border-radius: 4px;
}

/* Firma */
.signature-pad {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 20px;
}

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

.table th {
    background-color: #f8f9fa;
}

/* Botones */
.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #4da6ff 100%);
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0069d9 0%, #3395ff 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}

/* Modal */
.modal-content {
    border-radius: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .image-preview {
        max-width: 150px;
    }
}

/* --- Soft UI Styles for Index Page --- */

.soft-ui-bg {
    background-color: #eef0f4; /* A soft, off-white background */
    color: #5b6478;
}

/* Soft UI Navbar */
.navbar-soft {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    margin: 20px auto;
    padding: 0.5rem 1rem;
    max-width: 95%;
    box-shadow: 
        5px 5px 15px rgba(163, 177, 198, 0.4),
        -5px -5px 15px rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

/* Efecto hover para la barra de navegación */
.navbar-soft:hover {
    box-shadow: 
        8px 8px 20px rgba(163, 177, 198, 0.5),
        -8px -8px 20px rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

/* Estilos para la marca y enlaces de la barra de navegación */
.navbar-soft .navbar-brand {
    font-size: 1.4rem;
    color: #4a6cf7;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.navbar-soft .navbar-brand:hover {
    color: #3a5bd9;
    transform: scale(1.02);
}

.navbar-soft .nav-link {
    color: #5b6478;
    font-weight: 500;
    margin: 0 0.2rem;
    transition: all 0.2s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
}

.navbar-soft .nav-link i {
    font-size: 0.9em;
    margin-right: 0.4rem;
}

.navbar-soft .nav-link:hover,
.navbar-soft .nav-link.active {
    color: #4a6cf7;
    background: rgba(74, 108, 247, 0.1);
}

/* Menú desplegable */
.navbar-soft .dropdown-menu {
    border: none;
    border-radius: 12px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar-soft .dropdown-item {
    padding: 0.5rem 1.5rem;
    color: #5b6478;
    font-weight: 400;
    transition: all 0.2s ease;
}

.navbar-soft .dropdown-item:hover,
.navbar-soft .dropdown-item:focus {
    background: rgba(74, 108, 247, 0.1);
    color: #4a6cf7;
    padding-left: 1.75rem;
}

.navbar-soft .dropdown-divider {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin: 0.3rem 0;
}

/* Botón de menú en móviles */
.navbar-toggler {
    padding: 0.5rem;
    border: none;
    box-shadow: none !important;
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: none;
}

/* Mejoras para móviles */
@media (max-width: 991.98px) {
    .navbar-soft {
        margin: 10px auto;
        padding: 0.5rem;
    }
    
    .navbar-nav {
        padding: 1rem 0;
    }
    
    .nav-link {
        margin: 0.2rem 0;
        padding: 0.75rem 1.25rem !important;
    }
    
    .dropdown-menu {
        margin: 0.5rem 1rem;
        border-radius: 12px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    }
}

.navbar-soft .nav-link:hover {
    color: #007bff !important;
}

.navbar-soft .navbar-toggler-icon {
    /* A filter to make the default Bootstrap icon visible on a light background */
    filter: invert(35%) sepia(11%) saturate(957%) hue-rotate(176deg) brightness(95%) contrast(86%);
}

/* Estilo para imagen de fondo del login */
.login-bg-image {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    height: 80vh;
    width: 35%; /* 50% * 0.7 = 35% */
    background: url('../img/imagen_login.png') no-repeat center/cover;
    clip-path: polygon(15% 0, 100% 0, 100% 100%, 0 100%);
    border-top-left-radius: 1rem;
    border-bottom-left-radius: 1rem;
    z-index: 0;
}

/* Asegurar que el contenido esté por encima de la imagen de fondo */
.navbar-soft,
.container {
    position: relative;
    z-index: 1;
}

.jumbotron.soft-ui-container {
    background: #eef0f4;
    border-radius: 20px;
    padding: 2rem 3rem;
    box-shadow: 
        9px 9px 16px rgb(163 177 198 / 60%), 
        -9px -9px 16px rgb(255 255 255 / 50%);
    border: none;
    text-align: center;
}

/* --- Template Styles for Web View --- */
.template-header, .template-footer {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 15px;
    background-color: #fff; /* Fondo blanco para eliminar el gris */
    border: 1px solid #dee2e6;
    border-radius: 15px;
    margin-bottom: 20px;
}

.template-header {
    display: flex;
    align-items: center;
}

.template-logo {
    max-width: 300px; /* Tamaño base aumentado un 50% */
    max-height: 140px; /* Altura máxima ajustada proporcionalmente */
    margin-right: 20px;
}

.template-header-text {
    font-size: 1rem;
    text-align: left;
    flex-grow: 1;
}

.template-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 20px;
}

.template-footer-text {
    font-size: 0.9rem;
    text-align: left;
}

.signature-block {
    text-align: center;
}

.template-signature {
    max-height: 50px;
    max-width: 180px;
    display: block;
    margin: 0 auto 5px;
    object-fit: contain;
    filter: contrast(1.5) brightness(1.1); /* Ajusta el contraste y brillo para limpiar el fondo */
    mix-blend-mode: multiply; /* Mantiene los negros y hace transparente el blanco */
}

.signature-line {
    border-top: 1px solid #333;
    width: 200px;
    margin: 0 auto 5px;
}

.signature-block p {
    font-size: 0.8rem;
    margin: 0;
    color: #6c757d;
}

/* --- Image Resize Controls --- */
.resizable-container {
    position: relative;
    display: inline-block; /* Ajusta el contenedor al tamaño de la imagen */
}

.resize-controls {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0; /* Oculto por defecto */
    transition: opacity 0.3s ease-in-out;
}

.resizable-container:hover .resize-controls {
    opacity: 1; /* Visible en hover */
}

.btn-resize {
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 12px;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-resize:hover {
    background-color: white;
}

/* ==========================================================================
   Estilos para la Generación de PDF con html2canvas
   ========================================================================== */

/* Oculta el wrapper por defecto */
#pdf-render-wrapper {
    display: none;
}

/* Cuando el cuerpo tiene la clase activa, preparamos el entorno para la "foto" */
body.pdf-generation-active {
    /* Ocultamos todo lo que no sea el wrapper del PDF para evitar interferencias */
    background-color: #f8f9fa !important; /* Fondo gris suave */
}

body.pdf-generation-active > *:not(#pdf-render-wrapper) {
    display: none !important;
}

/* Mostramos y estilizamos el wrapper */
#pdf-render-wrapper {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 216mm; /* Ancho carta */
    min-height: 279mm; /* Alto carta */
    padding: 8mm;
    background-color: #f0f2f5; /* Fondo suave */
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    border-radius: 12px;
    box-sizing: border-box;
    z-index: 100;
}


/* Aplicamos los estilos de tarjeta a las secciones dentro del wrapper */
#pdf-render-wrapper .report-section,
#pdf-render-wrapper .template-header,
#pdf-render-wrapper .template-footer {
    background: #ffffff;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    overflow: hidden;
}

/* Estilos específicos para el contenido del reporte en el PDF */
#pdf-render-wrapper h5 {
    font-size: 11pt;
    font-weight: bold;
    margin-bottom: 6px;
    border-bottom: none;
}

#pdf-render-wrapper h6 {
    font-size: 10pt;
    margin-bottom: 4px;
}

#pdf-render-wrapper p {
    font-size: 9pt;
    line-height: 1.15;
    margin-bottom: 0.25rem;
}

/* Para el PDF, la transparencia se maneja con JS para evitar conflictos. */
#pdf-render-wrapper .template-signature {
    filter: none;
    mix-blend-mode: normal;
    background-color: transparent;
}

/* Ocultar los controles de redimensionamiento en el PDF */
#pdf-render-wrapper .resize-controls {
    display: none !important;
}


.jumbotron.soft-ui-container h1 {
    color: #343a40;
    font-weight: 600;
}

.card.soft-ui-card {
    background: #f9fbfd; /* Lighter card background for better contrast */
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 
        5px 5px 10px rgba(163, 177, 198, 0.6),
        -5px -5px 10px rgba(255, 255, 255, 0.9); /* Adjusted light shadow for new bg */
    border: none;
    transition: all 0.3s ease-in-out;
    height: 100%; /* Make cards same height */
}

.card.soft-ui-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        10px 10px 20px rgba(163, 177, 198, 0.6),
        -10px -10px 20px rgba(255, 255, 255, 0.9); /* Adjusted light shadow for new bg */
}

.card.soft-ui-card .card-title {
    color: #007bff;
    font-weight: 500;
}

.card.soft-ui-card .card-text {
    color: #6c757d;
}

.card.soft-ui-card .input-group-text {
    background: #fff;
    border: 1.2px solid #e9ecf1;
    border-right: none;
    border-radius: 10px 0 0 10px;
    color: #6c8bbd;
    box-shadow: 0 1.5px 6px rgba(60,60,100,0.06);
    font-size: 1.1em;
    padding-right: 0.7em;
}

#appt-table-search.form-control {
    border: 1.2px solid #e9ecf1;
    border-left: none;
    border-radius: 0 10px 10px 0;
    box-shadow: 0 1.5px 6px rgba(60,60,100,0.06);
    font-size: 0.95em;
    font-weight: 400;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    padding-left: 0.7em;
    padding-top: 0.32em;
    padding-bottom: 0.32em;
    letter-spacing: 0.01em;
}


@media (max-width: 767.98px) {
    #appt-table-search {
        margin-top: 0.5rem;
    }
}

.btn-soft {
    border-radius: 10px;
    font-weight: 500;
    padding: 12px 24px;
    border: none;
    box-shadow: 
        4px 4px 8px rgba(163, 177, 198, 0.6),
        -4px -4px 8px rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease-in-out;
}

.btn-soft.btn-sm {
    padding: 0.4rem 0.65rem;
    border-radius: 0.65rem;
    line-height: 1.2;
}

.btn-soft.btn-icon-only {
    padding: 0;
}

.btn-soft:active {
    box-shadow: 
        inset 2px 2px 4px rgba(163, 177, 198, 0.6),
        inset -2px -2px 4px rgba(255, 255, 255, 0.8);
}

.btn-soft.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #4da6ff 100%);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.btn-soft.btn-primary:hover {
    background: linear-gradient(135deg, #0069d9 0%, #3395ff 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}

.btn-soft.btn-secondary {
    background-color: #eef0f4;
    color: #343a40;
}

/* Remove default card shadow on index page */
.soft-ui-bg .card {
    box-shadow: none;
}

/* Soft UI Form Controls */
.form-control-soft {
    background-color: #eef0f4;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    box-shadow: 
        inset 3px 3px 6px rgba(163, 177, 198, 0.6),
        inset -3px -3px 6px rgba(255, 255, 255, 0.5);
    color: #5b6478;
    transition: all 0.2s ease-in-out;
}

.form-control-soft:focus {
    background-color: #eef0f4;
    color: #5b6478;
    box-shadow: 
        inset 5px 5px 8px rgba(163, 177, 198, 0.6),
        inset -5px -5px 8px rgba(255, 255, 255, 0.5);
    outline: none;
}

/* Soft UI Form Select */
.form-select-soft {
    background-color: #eef0f4;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    box-shadow:
        inset 3px 3px 6px rgba(163, 177, 198, 0.6),
        inset -3px -3px 6px rgba(255, 255, 255, 0.5);
    color: #5b6478;
    transition: all 0.2s ease-in-out;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
}

.form-select-soft:focus {
    background-color: #eef0f4;
    color: #5b6478;
    box-shadow:
        inset 5px 5px 8px rgba(163, 177, 198, 0.6),
        inset -5px -5px 8px rgba(255, 255, 255, 0.5);
    outline: none;
}

.soft-ui-card .card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.5rem;
    margin-bottom: 0;
}

/* Feature list inside Jumbotron */
.feature-list {
    columns: 2;
    -webkit-columns: 2;
    -moz-columns: 2;
    text-align: left;
    display: inline-block; /* Center the column block */
    padding-left: 0;
    list-style-position: inside;
}

.feature-list li {
    padding: 5px 0;
    font-size: 1.1rem;
}

.feature-list li i {
    margin-right: 10px; /* Space between icon and text */
    color: #007bff; /* Icon color */
    width: 20px; /* Ensure icons align nicely */
}

/* Soft UI Table */
.soft-ui-card .table {
    border-collapse: separate;
    border-spacing: 0 10px; /* Vertical spacing between rows */
    width: 100%;
    margin: 0;
    background: transparent;
    overflow: visible;
    padding: 0 1.5rem;
}

.soft-ui-card .table thead th {
    border-bottom: none;
    color: #8392ab;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.soft-ui-card .table tbody tr {
    background-color: #f8f9fa;
    border-radius: 10px;
    box-shadow: 6px 6px 12px rgba(163, 177, 198, 0.6), -6px -6px 12px rgba(255, 255, 255, 0.9);
    overflow: visible;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.soft-ui-card .table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 6px 6px 12px rgba(163, 177, 198, 0.6), -6px -6px 12px rgba(255, 255, 255, 0.9);
}

.soft-ui-card .table td, .soft-ui-card .table th {
    border-top: none;
    vertical-align: middle;
    padding: 0.62rem 1.5rem;
    font-weight: 400;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    font-size: 0.97em;
    letter-spacing: 0.01em;
}

.soft-ui-card .table td p, .soft-ui-card .table th p {
    margin-top: 0.23em;
    margin-bottom: 0.23em;
}

.soft-ui-card .table td:first-child, .soft-ui-card .table th:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.soft-ui-card .table td:last-child, .soft-ui-card .table th:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* Soft UI Modal */
.soft-ui-bg .modal-content {
    border: none;
    border-radius: 15px;
    background-color: #eef0f4;
    box-shadow: 8px 8px 16px rgba(163, 177, 198, 0.6), -8px -8px 16px rgba(255, 255, 255, 0.5);
}

.soft-ui-bg .modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.soft-ui-bg .modal-footer {
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Report View Sections */
.report-section {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 12px;
    background-color: #f8f9fa;
}

.report-section h5 {
    font-weight: 600;
    color: #344767;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 0.5rem;
}




