/* ========================================
   FONDO ODONTOLÓGICO MODERNO Y PROFESIONAL
======================================== */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ede8 50%, #f0f4f0 100%);
    background-attachment: fixed;
    background-size: cover;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(85, 161, 71, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(55, 106, 45, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(85, 161, 71, 0.02) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Patrón sutil de dientes */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 200px,
        rgba(85, 161, 71, 0.01) 200px,
        rgba(85, 161, 71, 0.01) 201px
    ),
    repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 200px,
        rgba(85, 161, 71, 0.01) 200px,
        rgba(85, 161, 71, 0.01) 201px
    );
    pointer-events: none;
    z-index: -1;
}

/* ========================================
   DISEÑO RESPONSIVE PARA TODAS LAS PANTALLAS
======================================== */

/* Contenedor principal responsive */
#containerdiv {
    max-width: 100%;
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    margin: 0 auto;
}

/* Pantallas pequeñas (14 pulgadas y tablets) */
@media (min-width: 768px) and (max-width: 1366px) {
    #containerdiv {
        max-width: 95%;
        padding-left: 20px;
        padding-right: 20px;
    }

    .navbar-nav .nav-link {
        padding: 0.5rem 0.9rem !important;
        font-size: 0.95rem;
    }

    .logo-orion-navbar {
        font-size: 1.1rem !important;
        padding: 0.4rem 1rem !important;
    }

    .card-body {
        padding: 1.5rem !important;
    }

    .card-header h5 {
        font-size: 1.1rem !important;
    }

    /* AG-Grid ajustes */
    .ag-theme-alpine {
        font-size: 13px !important;
    }

    .ag-header-cell,
    .ag-cell {
        padding: 0 8px !important;
    }
}

/* Pantallas medianas (laptops estándar) */
@media (min-width: 1367px) and (max-width: 1600px) {
    #containerdiv {
        max-width: 90%;
    }

    .navbar-nav .nav-link {
        padding: 0.6rem 1.1rem !important;
    }

    .card-body {
        padding: 1.8rem !important;
    }
}

/* Pantallas grandes (monitores grandes) */
@media (min-width: 1601px) {
    #containerdiv {
        max-width: 1400px;
    }

    .navbar-nav .nav-link {
        padding: 0.6rem 1.3rem !important;
    }

    .card-body {
        padding: 2.2rem !important;
    }

    .card-header h5 {
        font-size: 1.25rem !important;
    }
}

/* Móviles y tablets pequeñas */
@media (max-width: 767px) {
    body {
        font-size: 14px;
    }

    #containerdiv {
        padding-left: 10px;
        padding-right: 10px;
    }

    .navbar.bg-orionppal {
        padding: 0.5rem 0;
    }

    .logo-orion-navbar {
        font-size: 1rem !important;
        padding: 0.3rem 0.8rem !important;
        gap: 8px !important;
    }

    .logo-orion-navbar i.fa-tooth {
        font-size: 1.2rem !important;
    }

    .navbar-nav {
        padding: 1rem 0;
        background: rgba(55, 106, 45, 0.95);
        border-radius: 10px;
        margin-top: 10px;
    }

    .navbar-nav .nav-item {
        margin: 5px 10px;
    }

    .navbar-nav .nav-link {
        padding: 0.7rem 1rem !important;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.05);
    }

    .navbar-nav .nav-link:hover {
        background: rgba(255, 255, 255, 0.15);
    }

    .card {
        margin-bottom: 1.5rem;
    }

    .card-header h5 {
        font-size: 1rem !important;
    }

    .card-header img {
        max-height: 35px !important;
    }

    .card-body {
        padding: 1.2rem !important;
    }

    /* Botones responsive */
    .btn-sm,
    button {
        padding: 0.5rem 0.9rem !important;
        font-size: 0.85rem !important;
    }

    /* Inputs responsive */
    .form-control {
        font-size: 14px !important;
        padding: 0.6rem 0.8rem !important;
    }

    /* AG-Grid responsive */
    .ag-theme-alpine {
        font-size: 12px !important;
    }

    .ag-header-cell,
    .ag-cell {
        padding: 0 6px !important;
    }

    /* Ocultar columnas menos importantes en móvil si es necesario */
    .ag-header-cell[col-id="observaciones"],
    .ag-cell[col-id="observaciones"] {
        display: none !important;
    }
}

/* ========================================
   MEJORAS EN MENÚS CON ICONOS
======================================== */
.navbar-nav .nav-link i {
    margin-right: 6px;
    font-size: 0.95rem;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.navbar-nav .nav-link span {
    display: inline-block;
    transition: all 0.3s ease;
}

@media (max-width: 576px) {
    .navbar-nav .nav-link {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .navbar-nav .nav-link i {
        margin-right: 0;
        font-size: 1.1rem;
    }
}

/* ========================================
   CARDS CON MEJOR ORGANIZACIÓN
======================================== */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(85, 161, 71, 0.1);
}

.card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-2px);
}

/* ========================================
   TIPOGRAFÍA MEJORADA (Sin mayúsculas)
======================================== */
.card-header h5 {
    text-transform: none !important;
    letter-spacing: 0;
}

.logo-orion-navbar span {
    text-transform: none !important;
}

/* Mantener iconos de usuario con mejor espaciado */
.navbar .nav-item[title] .nav-link {
    padding: 0.6rem 1rem !important;
}

.navbar .iconlogout {
    font-size: 1.2rem;
}

/* ========================================
   ANIMACIONES MINIMALES Y SUTILES
======================================== */
* {
    transition-duration: 0.2s !important;
}

/* Desactivar animaciones excesivas */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   MEJORAS EN ALTURA DE GRIDS RESPONSIVE
======================================== */
.ag-theme-alpine {
    transition: height 0.3s ease;
}

@media (max-width: 767px) {
    .ag-theme-alpine {
        height: calc(100vh - 450px) !important;
        min-height: 400px !important;
    }
}

@media (min-width: 768px) and (max-width: 1366px) {
    .ag-theme-alpine {
        height: calc(100vh - 380px) !important;
        min-height: 450px !important;
    }
}

/* ========================================
   BOTONES DE FILTRO MEJORADOS
======================================== */
button[onclick*="filtrar"],
button[onclick*="aplicar"] {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

button[onclick*="filtrar"] i,
button[onclick*="aplicar"] i {
    font-size: 0.9em;
}

@media (max-width: 767px) {
    button[onclick*="filtrar"] span,
    button[onclick*="aplicar"] span {
        display: none;
    }

    button[onclick*="filtrar"],
    button[onclick*="aplicar"] {
        min-width: 40px;
        padding: 0.6rem !important;
    }

    button[onclick*="filtrar"] i,
    button[onclick*="aplicar"] i {
        margin: 0;
        font-size: 1rem;
    }
}

/* ========================================
   MEJORAS EN INPUTS DE BÚSQUEDA
======================================== */
input[placeholder*="Buscar"],
input[placeholder*="buscar"],
input[name="nombre"],
input[name="documento"] {
    padding-left: 2.5rem !important;
    background-image: none !important;
}

.form-group [type="button"] + input {
    flex: 1;
}

/* ========================================
   CONTENEDOR DE BIENVENIDA MEJORADO
======================================== */
.navbar-brand[style*="font-size:small"] {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar-brand[style*="font-size:small"]:hover {
    background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 767px) {
    .navbar-brand[style*="font-size:small"] {
        font-size: 0.75rem !important;
        padding: 0.3rem 0.6rem;
    }

    .navbar-brand[style*="font-size:small"] b {
        display: none;
    }
}

/* ========================================
   MEJORAS FINALES DE ACCESIBILIDAD
======================================== */
*:focus {
    outline: 2px solid var(--orion-primary);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline-color: var(--orion-primary);
}

/* ========================================
   OPTIMIZACIÓN PARA IMPRESIÓN
======================================== */
@media print {
    body {
        background: white !important;
    }

    body::before,
    body::after {
        display: none !important;
    }

    .navbar,
    .btn,
    button {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    .card-header {
        background: white !important;
        color: black !important;
        border-bottom: 2px solid #55A147 !important;
    }
}
