/**
 * Estilos Principales
 * Sistema de Administración de Veterinaria
 */

/* Variables de colores */
:root {
    --color-primario: #5fa89c;
    --color-secundario: #4a8a7f;
    --color-exito: #28a745;
    --color-peligro: #dc3545;
    --color-advertencia: #ffc107;
    --color-info: #17a2b8;
    --color-fondo: #f8f9fa;
    --color-texto: #333;
    --color-texto-claro: #6c757d;
}

/* Estilos generales */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-fondo);
    background-image: url('../images/fondo-animales.jpg');
    background-repeat: repeat;
    background-attachment: fixed;
    background-size: 400px;
    color: var(--color-texto);
    min-height: 100vh;
    padding-top: 95px; /* Espacio para el navbar fijo de dos filas */
}

/* Navbar de dos filas */
.navbar {
    padding: 0 !important;
}

.navbar-brand {
    font-size: 1.2rem;
    font-weight: bold;
}

.navbar-brand img {
    height: 35px;
}

.navbar-nav .nav-link {
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

@media (max-width: 1400px) {
    .navbar-nav .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
}

@media (max-width: 992px) {
    body {
        padding-top: 70px;
    }
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
    }
}

/* Login page sin padding */
body.login-page {
    padding-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-login {
    max-width: 200px;
    height: auto;
}

/* Overlay para mejorar legibilidad sobre el fondo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.92);
    z-index: -1;
}

/* Contenedor principal */
.container-fluid {
    max-width: 1400px;
}

/* Header/Navbar */
.navbar {
    background: linear-gradient(135deg, var(--color-primario) 0%, var(--color-secundario) 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 1.5rem;
    color: white !important;
}

.navbar-brand img {
    height: 50px;
    margin-right: 15px;
    filter: brightness(0) invert(1);
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
    border-radius: 5px;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white !important;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    background-color: white;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    border-bottom: none;
    font-weight: 600;
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Botones */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primario) 0%, var(--color-secundario) 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-secundario) 0%, var(--color-primario) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(95, 168, 156, 0.4);
}

.btn-success:hover,
.btn-danger:hover,
.btn-warning:hover,
.btn-info:hover,
.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Formularios */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.6rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-primario);
    box-shadow: 0 0 0 0.2rem rgba(95, 168, 156, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--color-texto);
    margin-bottom: 0.5rem;
}

/* Tablas */
.table {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--color-primario);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(95, 168, 156, 0.05);
}

.table tbody td {
    vertical-align: middle;
    padding: 1rem;
}

/* Badges */
.badge {
    padding: 0.5rem 0.8rem;
    font-weight: 500;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* Alertas */
.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert i {
    margin-right: 0.5rem;
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    max-width: 450px;
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--color-primario) 0%, var(--color-secundario) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-header img {
    height: 80px;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
}

.login-body {
    padding: 2rem;
    background-color: white;
}

/* Estadísticas/Dashboard */
.stat-card {
    border-left: 4px solid;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateX(5px);
}

.stat-card.stat-primary {
    border-left-color: var(--color-primario);
}

.stat-card.stat-success {
    border-left-color: var(--color-exito);
}

.stat-card.stat-danger {
    border-left-color: var(--color-peligro);
}

.stat-card.stat-warning {
    border-left-color: var(--color-advertencia);
}

.stat-card.stat-info {
    border-left-color: var(--color-info);
}

/* Tabs */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--color-texto-claro);
    font-weight: 500;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: var(--color-primario);
}

.nav-tabs .nav-link.active {
    color: var(--color-primario);
    border-bottom: 3px solid var(--color-primario);
    background-color: transparent;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--color-primario) 0%, var(--color-secundario) 100%);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
}

footer a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

footer a:hover {
    opacity: 0.8;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Utilidades */
.hover-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.text-muted {
    color: var(--color-texto-claro) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-brand img {
        height: 40px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--color-secundario);
}

/* Impresión */
@media print {
    body {
        background: white;
    }
    
    body::before {
        display: none;
    }
    
    .navbar,
    .btn,
    footer {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Estilos para código de barras */
.barcode-container {
    text-align: center;
    padding: 1rem;
    background-color: white;
    border-radius: 10px;
}

.barcode-container svg {
    max-width: 100%;
    height: auto;
}

/* Estilos para enlaces de WhatsApp y Telegram */
.btn-whatsapp {
    background-color: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background-color: #1fb855;
    color: white;
}

.btn-telegram {
    background-color: #0088cc;
    color: white;
}

.btn-telegram:hover {
    background-color: #006699;
    color: white;
}

/* Estilos para lista de mascotas */
.mascota-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
}

.mascota-item:hover {
    background-color: rgba(95, 168, 156, 0.05);
}

.mascota-item:last-child {
    border-bottom: none;
}

.mascota-foto {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
}

/* Estilos para calendario */
.calendar-day {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    background-color: var(--color-primario);
    color: white;
    cursor: pointer;
}

.calendar-day.has-event {
    background-color: rgba(95, 168, 156, 0.1);
    font-weight: bold;
}

/* Loading spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Estilos para input de búsqueda */
.search-input {
    position: relative;
}

.search-input input {
    padding-left: 2.5rem;
}

.search-input i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-texto-claro);
}
