/* style.css */
/* 
   ============================================
   VETERINARIA EL TUCÁN - ESTILOS PRINCIPALES
   ============================================
   Este archivo contiene todos los estilos del sistema.
   Está organizado por secciones para facilitar mantenimiento.
   Usa variables CSS, transiciones suaves y diseño responsive.
*/

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* VARIABLES GLOBALES */
:root {
    --primary-color: #acce00;        /* Verde lima (marca principal) */
    --secondary-color: #4a7c59;      /* Verde bosque (complementario) */
    --accent-color: #f39c12;         /* Naranja (acentos) */
    --light-green: #e8f5e8;          /* Fondo claro verde */
    --text-dark: #2c3e50;            /* Texto oscuro */
    --offcanvas-width: 280px;        /* Ancho del menú lateral */
}

/* RESET Y CUERPO */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--light-green) 0%, #ffffff 100%);
    min-height: 100vh;
    color: var(--text-dark);
}

/* Bordes medianos */
.img-rounded {
    border-radius: 12px;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 30px;
    text-align: center;
}

/* NAVBAR (barra de navegación superior) */
.navbar {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color)) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    color: white !important;
}

/* BOTONES PRINCIPALES */
.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* TABLAS */
.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.table thead th {
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    padding: 15px;
}

.table tbody tr:hover {
    background-color: var(--light-green);
}

/* MODALES (ventanas emergentes) */
.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 15px 15px 0 0;
}

/* FORMULARIOS (inputs y selects) */
.form-control, 
.form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease;
}

.form-control:focus, 
.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(76, 124, 89, 0.25);
}

/* ENCABEZADO PRINCIPAL (título del dashboard) */
.veterinaria-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.veterinaria-header h1 {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 10px;
}

.veterinaria-header p {
    color: var(--text-dark);
    margin: 0;
}

/* DASHBOARD - TARJETAS PRINCIPALES */
.dashboard-main {
    padding: 20px 0;
}

.main-section-card {
    position: relative;
    height: 250px;
    perspective: 1000px; /* Da profundidad 3D a las animaciones */
}

.main-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    backface-visibility: hidden;
    z-index: 2;
}

.main-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

.main-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.main-card h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 8px;
    text-align: center;
}

.main-card p {
    font-size: 0.9rem;
    opacity: 0.9;
    text-align: center;
    margin: 0;
}

/* SUBMENÚS (se muestran al hacer hover o clic) */
.submenu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 1;
    pointer-events: none;
}

.main-section-card:hover .submenu {
    opacity: 1;
    transform: translateY(0) scale(1);
    z-index: 3;
    pointer-events: all;
}

.main-section-card:hover .main-card {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
}

.submenu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-dark);
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.submenu-item:hover {
    background: linear-gradient(90deg, var(--light-green), #f8f9fa);
    color: var(--primary-color);
    transform: translateX(8px);
    text-decoration: none;
}

.submenu-item .icon {
    font-size: 1.2rem;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

/* GRADIENTES PARA CARDS ADICIONALES */
.bg-gradient-primary,
.bg-gradient-info,
.bg-gradient-success {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
}

/* ============================================
   SECCIÓN: LOGIN - PÁGINA DE INICIO DE SESIÓN
   ============================================ */

/* Estilo adicional para asegurar la interacción del toggle de contraseña */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.password-toggle svg {
    pointer-events: none;
    width: 20px;
    height: 20px;
}

/* Asegurar el centrado de la imagen estática */
#staticImage {
    margin: 0 auto !important;
}

/* MENÚ LATERAL (offcanvas) - ANIMACIONES PERSONALIZADAS */
.offcanvas-start {
    width: var(--offcanvas-width);
    max-width: 90vw;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    visibility: hidden;
    border-radius: 0 15px 15px 0;
    overflow: hidden;
}

.offcanvas.show {
    transform: translateX(0) !important;
    visibility: visible;
    box-shadow: 5px 0 20px rgba(0,0,0,0.2);
}

.offcanvas-backdrop {
    opacity: 0;
    transition: opacity 0.4s ease !important;
}

.offcanvas-backdrop.show {
    opacity: 0.5;
}

.offcanvas-body {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
}

.offcanvas.show .offcanvas-body {
    opacity: 1;
    transform: translateY(0);
}

.offcanvas-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* BOTÓN DE CIERRE ANIMADO */
.btn-close {
    transition: transform 0.3s ease;
}

.btn-close:hover {
    transform: rotate(90deg);
}

/* ============================================
   SECCIÓN: ASISTENTE VIRTUAL - CHAT
   ============================================ */

.chat-container {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    background: #f8f9fa;
}

.img-rounded {
    border-radius: 12px;
    transition: border-radius 0.3s ease;
}

.mensaje-usuario {
    background: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border-radius: 15px 15px 5px 15px;
    margin: 10px 0;
    max-width: 80%;
    margin-left: auto;
}
.mensaje-asistente {
    background: white;
    color: var(--text-dark);
    padding: 10px 15px;
    border-radius: 15px 15px 15px 5px;
    margin: 10px 0;
    max-width: 80%;
    border: 1px solid #ddd;
}
.asistente-avatar {
    width: 40px;
    height: 40px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    margin-right: 10px;
}

/* ============================================
   SECCIÓN: PRODUCTOS - TARJETAS POR CATEGORÍA
   ============================================ */

/* Tarjeta principal de categoría */
.categoria-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.categoria-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Encabezado de categoría con gradiente */
.categoria-header {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 12px 15px;
    border-radius: 12px 12px 0 0;
}

.categoria-header h5 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.categoria-header small {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Item individual de producto */
.producto-item {
    padding: 10px 15px;
    border-bottom: 1px dashed #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.producto-item:last-child {
    border-bottom: none;
}

.producto-item:hover {
    background-color: var(--light-green);
    border-radius: 6px;
}

/* Información del producto */
.producto-info {
    flex: 1;
}

.producto-info strong {
    font-size: 1.1rem;
    color: var(--text-dark);
}

.producto-descripcion {
    font-size: 0.9rem;
    color: #666;
    margin: 2px 0;
}

.producto-precio {
    font-weight: 600;
    color: #28a745;
    font-size: 1.05rem;
}

.producto-stock {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Grupos de botones */
.btn-group-sm {
    gap: 5px;
}

/* Botones dentro de productos */
.producto-item .btn-warning,
.producto-item .btn-danger {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Diseño responsivo para productos */
@media (max-width: 768px) {
    .categoria-card {
        margin-bottom: 15px;
    }

    .producto-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .producto-info {
        width: 100%;
    }

    .btn-group-sm {
        width: 100%;
        justify-content: flex-end;
    }

    .producto-item .btn-warning,
    .producto-item .btn-danger {
        width: auto;
    }
}

/* Mensajes automáticos */
.alert-auto-dismiss {
    position: relative;
    overflow: hidden;
}

.alert-auto-dismiss::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    animation: progress-bar 3s linear forwards;
}

@keyframes progress-bar {
    from { width: 100%; }
    to { width: 0%; }
}

/* RESPONSIVE - Diseño adaptable */
@media (max-width: 768px) {
    .main-section-card {
        height: 200px;
    }
    
    .main-icon {
        font-size: 2.5rem;
    }
    
    .main-card h3 {
        font-size: 1.2rem;
    }
    
    .submenu {
        padding: 15px;
        gap: 10px;
    }
    
    .submenu-item {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

    /* === EDITOR DE DOCUMENTOS CLÍNICOS === */

    /* Contenedor principal del modal */
    #editorModal .modal-content {
        border-radius: 12px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }

    /* Barra de herramientas */
    .toolbar {
        background: #f8f9fa;
        border-bottom: 1px solid #dee2e6;
    }

    .toolbar .btn-toolbar button {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        transition: all 0.2s ease;
        border: 1px solid #ddd;
        background: white;
        color: #495057;
    }

    .toolbar .btn-toolbar button:hover {
        background: #e9ecef;
        transform: translateY(-1px);
        border-color: #adb5bd;
    }

    .toolbar .btn-toolbar button:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    }

    /* Botón de mostrar código */
    #show-code {
        background: white;
        border: 1px solid #ddd;
        color: #6c757d;
        font-weight: bold;
        transition: all 0.2s ease;
    }

    #show-code[data-active="true"] {
        background: #0d6efd;
        color: white;
        border-color: #0d6efd;
    }

    /* Selectores y controles */
    .toolbar select,
    .toolbar input[type="color"] {
        border: 1px solid #ddd;
        padding: 6px 10px;
        border-radius: 6px;
        background: white;
        font-size: 14px;
    }

    .toolbar input[type="color"] {
        width: 32px;
        height: 32px;
        padding: 0;
        cursor: pointer;
    }

    /* Área de contenido editable */
    #content {
        min-height: 400px;
        max-height: 60vh;
        overflow-y: auto;
        padding: 20px;
        line-height: 1.6;
        font-family: 'Arial', sans-serif;
        font-size: 16px;
        background: white;
        border: 1px solid #e9ecef;
        border-radius: 0 0 8px 8px;
    }

    #content:focus {
        outline: none;
        box-shadow: inset 0 0 0 2px #0d6efd;
    }

    /* Estilos para el contenido editable */
    #content h1, #content h2, #content h3 {
        margin: 1em 0 0.5em;
        color: #0d6efd;
    }

    #content ul, #content ol {
        padding-left: 1.5em;
        margin: 0.5em 0;
    }

    #content li {
        margin: 0.3em 0;
    }

    #content a {
        color: #0d6efd;
        text-decoration: underline;
    }

    #content table {
        width: 100%;
        border-collapse: collapse;
        margin: 1em 0;
    }

    #content table, #content th, #content td {
        border: 1px solid #dee2e6;
    }

    #content th, #content td {
        padding: 8px;
        text-align: left;
    }

    /* Transiciones suaves */
    .modal-body,
    .modal-footer {
        transition: all 0.3s ease;
    }

    /* Responsive */
    @media (max-width: 768px) {
        #editorModal .modal-dialog {
            margin: 10px;
            max-width: calc(100% - 20px);
        }
        
        .toolbar {
            padding: 10px;
        }
        
        .toolbar .btn-toolbar {
            gap: 5px;
        }
        
        .toolbar button {
            width: 36px;
            height: 36px;
            font-size: 16px;
        }
        
        #content {
            padding: 15px;
            font-size: 15px;
        }
    }

    /* Efectos de carga */
    #content.loading::before {
        content: "Cargando...";
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.8);
        color: #6c757d;
        font-size: 18px;
        z-index: 10;
    }

    /* Scroll personalizado */
    #content::-webkit-scrollbar {
        width: 8px;
    }

    #content::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    #content::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 4px;
    }

    #content::-webkit-scrollbar-thumb:hover {
        background: #bbb;
    }

    /* Estilo para el título del documento */
    #editorModal .modal-header input {
        font-size: 16px;
        font-weight: 500;
        border: 2px solid transparent;
        transition: border-color 0.2s ease;
    }

    #editorModal .modal-header input:focus {
        border-color: #0d6efd;
        outline: none;
    }

    /* Animaciones */
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    #editorModal .modal-content {
        animation: fadeIn 0.3s ease-out;
    }

        /* Estilos para impresión */
    @media print {
        body * {
            visibility: hidden;
        }
        
        .documento-imprimible, 
        .documento-imprimible * {
            visibility: visible;
        }
        
        .documento-imprimible {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            padding: 2cm;
            box-sizing: border-box;
            font-family: Arial, sans-serif;
            font-size: 12pt;
            line-height: 1.6;
        }
        
        .btn, .modal, .navbar, .offcanvas, .card-header, .table, .form-control {
            display: none !important;
        }
    }

    .documento-imprimible h2 {
        text-align: center;
        margin-bottom: 20px;
        color: #000;
    }

    .documento-imprimible h4 {
        margin: 15px 0 10px;
        color: #000;
    }

    .documento-imprimible p, 
    .documento-imprimible div, 
    .documento-imprimible li {
        margin: 5px 0;
    }

    .documento-imprimible strong {
        min-width: 120px;
        display: inline-block;
    }

    .documento-imprimible ul, .documento-imprimible ol {
        margin: 10px 0;
        padding-left: 20px;
    }

    .documento-imprimible table {
        margin: 15px 0;
    }

    /* APARTADO: CALENDARIO DE CITAS */
    
            .calendario {
            max-width: 1200px;
            margin: 20px auto;
        }
        .mes-nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            font-size: 1.2em;
            font-weight: bold;
        }
        .mes-nav a {
            text-decoration: none;
            color: #0d6efd;
        }
        .dias-semana {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            text-align: center;
            font-weight: bold;
            background: #f8f9fa;
            padding: 10px 0;
            border-bottom: 1px solid #dee2e6;
        }
        .dias-semana div {
            padding: 5px;
        }
        .dias-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 1px;
            border: 1px solid #dee2e6;
        }
        .dia {
            min-height: 80px;
            padding: 5px;
            background: #fff;
            border: 1px solid #dee2e6;
            position: relative;
        }
        .dia-header {
            font-weight: bold;
            color: #0d6efd;
            margin-bottom: 5px;
        }
        .dia-vacio {
            background: #f8f9fa;
        }
        .dia-actual {
            background: #fff3cd;
        }
        .bloque-horario {
            font-size: 0.8em;
            padding: 2px 4px;
            margin: 1px 0;
            border-radius: 3px;
            cursor: pointer;
            text-align: center;
        }
        .disponible {
            background: #d1e7dd;
            color: #0f5132;
        }
        .ocupado {
            background: #f8d7da;
            color: #842029;
            text-decoration: line-through;
        }
        .modal-body .list-group-item {
            display: flex;
            justify-content: space-between;
        }

    .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    .horario-boton {
        transition: all 0.2s ease;
    }
    .horario-boton:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    #periodoSeleccionado {
        min-width: 200px;
        text-align: center;
    }

    /* APARTADO: CARTILLA CLÍNICA */

    .firma-linea { border-top: 1px solid #000; width: 200px; margin: 20px auto 0; padding-top: 5px; text-align: center; }
    .no-border td, .no-border th { border: none !important; }
    @media print {
        .btn-imprimir, .modal-footer { display: none; }
        body * { visibility: hidden; }
        #cartilla-content, #cartilla-content * { visibility: visible; }
        #cartilla-content { position: absolute; left: 0; top: 0; width: 100%; padding: 2cm; box-sizing: border-box; }
    }

    /* Animación de carga personalizada */
    @keyframes pulse {
        0% { transform: scale(0.95); opacity: 0.7; }
        70% { transform: scale(1.05); opacity: 1; }
        100% { transform: scale(0.95); opacity: 0.7; }
    }

    .pulse-animation {
        animation: pulse 1.5s infinite;
    }

    /* Efecto de desvanecimiento para la pantalla de carga */
    .loading-fade {
        animation: fadeOut 0.5s forwards;
        animation-delay: 0.2s;
    }

    @keyframes fadeOut {
        from { opacity: 1; }
        to { opacity: 0; display: none; }
    }

/* FIN DEL ARCHIVO style.css */