/**
 * Estilos personalizados para HelpMyPet
 *
 * Este archivo contiene las variables CSS y estilos personalizados
 * para dar identidad visual al proyecto HelpMyPet.
 */

/* ========== VARIABLES DE COLOR ========== */
:root {
    /* Colores principales - Paleta cálida y amigable para mascotas */
    --color-primary: #667eea;        /* Azul suave */
    --color-secondary: #764ba2;      /* Púrpura */
    --color-accent: #f093fb;         /* Rosa claro */
    --color-success: #4ade80;        /* Verde */
    --color-danger: #f87171;         /* Rojo coral */
    --color-warning: #fbbf24;        /* Amarillo cálido */
    --color-info: #60a5fa;           /* Azul cielo */

    /* Colores neutros */
    --color-light: #f8f9fa;
    --color-dark: #2d3748;
    --color-muted: #6b7280;

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Bordes redondeados */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 1rem;

    /* Espaciado */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

/* ========== ESTILOS GLOBALES ========== */

/* Tipografía mejorada */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--color-dark);
    line-height: 1.6;
}

/* Enlaces */
a {
    transition: all 0.3s ease;
}

a:hover {
    opacity: 0.8;
}

/* ========== NAVBAR PERSONALIZADA ========== */

.navbar {
    background: white !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: var(--color-light);
}

/* ========== BOTONES PERSONALIZADOS ========== */

.btn {
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8e 100%);
}

/* ========== CARDS MEJORADAS ========== */

.card {
    border: none;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card-img-top {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ========== BADGES ========== */

.badge {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
}

/* ========== ALERTS PERSONALIZADAS ========== */

.alert {
    border: none;
    border-radius: var(--radius-md);
    border-left: 4px solid;
}

.alert-success {
    background-color: #d1fae5;
    border-left-color: var(--color-success);
    color: #065f46;
}

.alert-danger {
    background-color: #fee2e2;
    border-left-color: var(--color-danger);
    color: #991b1b;
}

.alert-warning {
    background-color: #fef3c7;
    border-left-color: var(--color-warning);
    color: #92400e;
}

.alert-info {
    background-color: #dbeafe;
    border-left-color: var(--color-info);
    color: #1e40af;
}

/* ========== FORMULARIOS ========== */

.form-control,
.form-select {
    border-radius: var(--radius-md);
    border: 2px solid #e5e7eb;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: var(--spacing-sm);
}

/* ========== FOOTER ========== */

footer {
    background-color: var(--color-light);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: auto;
}

/* ========== UTILIDADES ========== */

/* Gradientes de fondo */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}

/* Sombras */
.shadow-soft {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

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

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

/* ========== RESPONSIVE ========== */

/* Ajustes para dispositivos móviles */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }

    .display-3 {
        font-size: 2.5rem;
    }

    .display-5 {
        font-size: 2rem;
    }

    .lead {
        font-size: 1.1rem;
    }
}

/* ========== ESTILOS ESPECÍFICOS DE PÁGINAS ========== */

/* Hero section en la landing page */
.hero-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
}

/* Cards de mascotas */
.pet-card {
    transition: all 0.3s ease;
}

.pet-card:hover {
    transform: translateY(-10px);
}

/* Código QR */
.qr-code-container {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

/* Vista pública optimizada para móvil */
@media (max-width: 576px) {
    .pet-name {
        font-size: 2rem;
    }

    .pet-type {
        font-size: 1rem;
    }

    .contact-btn {
        font-size: 1rem;
        padding: 12px;
    }
}

/* ========== DASHBOARD - ESTILOS PERSONALIZADOS ========== */

/* Encabezado del dashboard */
.dashboard-header {
    padding: 1rem 0;
    border-bottom: 2px solid var(--color-light);
}

/* Cards de estadísticas del dashboard */
.card-stat-mascotas,
.card-stat-escaneos,
.card-stat-perdidas,
.card-stat-adopcion {
    border: none;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Colores de fondo para cada tipo de card de estadística */
.card-stat-mascotas {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.card-stat-escaneos {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.card-stat-perdidas {
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
}

.card-stat-adopcion {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
}

/* Efecto hover para las cards de estadísticas */
.card-stat-mascotas:hover,
.card-stat-escaneos:hover,
.card-stat-perdidas:hover,
.card-stat-adopcion:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Alerta especial para mascotas perdidas */
.danger-alert {
    border-left: 4px solid #dc3545 !important;
    background: linear-gradient(135deg, #fee 0%, #fdd 100%) !important;
    animation: pulse 2s infinite;
}

/* Animación de pulsación para alertas urgentes */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.95;
    }
}

/* Números grandes de las estadísticas */
.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 10px 0;
    color: var(--color-dark);
}

/* Íconos de las estadísticas */
.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.8;
}

/* Contenedor del gráfico de Chart.js */
#graficoEscaneos {
    min-height: 300px;
    width: 100%;
}

/* Miniaturas de mascotas en listas */
.mascota-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-light);
}

/* Placeholder para miniaturas sin foto */
.mascota-thumbnail-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--color-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-muted);
    border: 2px solid var(--color-light);
}

/* Items de lista del dashboard */
.list-group-item {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.list-group-item:hover {
    background-color: #f8f9fa;
}

/* Badges personalizados por estado de mascota */
.badge-activo {
    background-color: var(--color-success);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-perdido {
    background-color: var(--color-danger);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-en_adopcion {
    background-color: var(--color-warning);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-encontrado {
    background-color: var(--color-info);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Estado vacío cuando no hay mascotas */
.empty-state {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 3rem;
}

/* Card headers del dashboard */
.card-header {
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* ========== RESPONSIVE DASHBOARD ========== */

/* Tablets y pantallas medianas */
@media (max-width: 992px) {
    .stat-number {
        font-size: 2rem;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .dashboard-header h1 {
        font-size: 2rem;
    }
}

/* Móviles */
@media (max-width: 768px) {
    .stat-number {
        font-size: 2rem;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .card-stat-mascotas,
    .card-stat-escaneos,
    .card-stat-perdidas,
    .card-stat-adopcion {
        padding: 0.75rem;
        margin-bottom: 15px;
    }

    .dashboard-header h1 {
        font-size: 1.75rem;
    }

    .dashboard-header p {
        font-size: 0.9rem;
    }

    /* Ajustar altura del gráfico en móviles */
    #graficoEscaneos {
        min-height: 250px;
    }

    /* Ajustar miniaturas en móviles */
    .mascota-thumbnail,
    .mascota-thumbnail-placeholder {
        width: 40px;
        height: 40px;
    }

    /* Botones más pequeños en móviles */
    .btn-lg {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }

    /* Ajustar columnas de las listas en móviles */
    .list-group-item .row > div {
        margin-bottom: 0.5rem;
    }
}

/* Móviles pequeños */
@media (max-width: 576px) {
    .stat-number {
        font-size: 1.75rem;
    }

    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state i {
        font-size: 3.5rem !important;
    }

    .empty-state h2 {
        font-size: 1.5rem;
    }

    .empty-state .lead {
        font-size: 1rem;
    }

    /* Cards en columna completa */
    .card-stat-mascotas,
    .card-stat-escaneos,
    .card-stat-perdidas,
    .card-stat-adopcion {
        margin-bottom: 10px;
    }
}

/* ========== BADGE DE NOTIFICACIONES EN NAVBAR ========== */

/* Contenedor del badge de notificaciones */
.nav-item .nav-link.position-relative {
    padding-right: 2rem !important; /* Espacio para el badge */
}

/* Estilo del badge de notificaciones */
.nav-link .badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
    font-weight: 700;
    animation: badge-pulse 2s infinite;
}

/* Animación de pulso para el badge */
@keyframes badge-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* Efecto hover en el enlace de notificaciones */
.nav-link.position-relative:hover .badge {
    animation: badge-bounce 0.5s ease;
}

/* Animación de rebote al hacer hover */
@keyframes badge-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* Responsive: ajustar badge en móviles */
@media (max-width: 768px) {
    .nav-link .badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.35rem;
    }
}

/* ========== IMPRESIÓN ========== */

/* Estilos para imprimir códigos QR */
@media print {
    body * {
        visibility: hidden;
    }

    .qr-code-container,
    .qr-code-container * {
        visibility: visible;
    }

    .qr-code-container {
        position: absolute;
        left: 0;
        top: 0;
    }
}
