/* ============================================
   UX/UI ENHANCEMENTS - OPCIÓN C COMPLETA
   Mejoras visuales globales para toda la plataforma
   ============================================ */

/* ========== DARK MODE GLOBAL ========== */
:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --transition-speed: 0.3s;
}

body {
    scroll-behavior: smooth;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

body.dark-mode {
    background-color: #1a1a1a;
    color: #ffffff;
}

body.dark-mode .navbar,
body.dark-mode .header,
body.dark-mode header,
body.dark-mode .bg-dark,
body.dark-mode .bg-light {
    background-color: #212529 !important;
    background: #212529 !important;
    border-color: #333 !important;
    opacity: 1 !important;
}

body.dark-mode .text-dark {
    color: #ffffff !important;
}

body.dark-mode .card,
body.dark-mode .modal-content {
    background-color: #1f1f1f;
    border-color: #333;
    color: #ffffff;
}

/* ========== ANIMACIONES SUAVES ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.fade-in {
    animation: fadeIn var(--transition-speed) ease-out;
}

.slide-in-right {
    animation: slideInRight var(--transition-speed) ease-out;
}

.slide-in-left {
    animation: slideInLeft var(--transition-speed) ease-out;
}

/* ========== NAVBAR STICKY MEJORADA ========== */
header {
    background-color: #212529 !important;
    background: #212529 !important;
    transition: all var(--transition-speed) ease;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030;
    margin: 0 !important;
    left: 0 !important;
    right: 0 !important;
    opacity: 1 !important;
}

header.bg-dark {
    background-color: #212529 !important;
    background: #212529 !important;
}

.navbar {
    width: 100%;
    margin: 0;
    padding: 0.5rem 1rem !important;
    background-color: #212529 !important;
    background: #212529 !important;
    opacity: 1 !important;
}

.navbar.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0 !important;
}

.navbar-brand {
    transition: all var(--transition-speed) ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-dark {
    background-color: transparent !important;
}

header.bg-dark .navbar-dark {
    background-color: transparent !important;
}

.navbar-dark .nav-link {
    color: white !important;
}

/* ========== SMOOTH SCROLL ========== */
html {
    scroll-behavior: smooth;
}

/* ========== HEADER MEJORADO ========== */
.header-enhanced {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1050;
}

body.dark-mode .header-enhanced {
    background: linear-gradient(135deg, #1a3a52 0%, #0d1f2d 100%);
}

/* ========== SCROLL PROGRESS INDICATOR ========== */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #00d4ff);
    width: 0%;
    z-index: 2000;
    transition: width 0.1s ease;
}

/* ========== LIGHT BOX / MODAL MEJORADO ========== */
.lightbox-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.lightbox-container.hidden {
    display: none;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: scaleIn 0.3s ease-out;
}

.lightbox-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lightbox-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2001;
}

.lightbox-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* ========== IMAGE ZOOM (INTERACTIVE WITH PAN) ========== */
.zoomable-image {
    cursor: zoom-in;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.zoomable-image:active {
    cursor: grabbing;
}

.image-zoom-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

/* ========== FILTROS INTELIGENTES ========== */
.filters-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

body.dark-mode .filters-panel {
    background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.filtro {
    margin-bottom: 20px;
    animation: slideInLeft 0.4s ease-out;
}

.filtro:hover {
    transform: translateX(5px);
}

.form-select,
.form-control {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

body.dark-mode .form-select,
body.dark-mode .form-control {
    background-color: #2a2a2a;
    border-color: #444;
    color: #ffffff;
}

.form-select:focus,
.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    transform: scale(1.02);
}

.reset-filters-btn {
    background: linear-gradient(135deg, #dc3545 0%, #a71d2a 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.reset-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* ========== PRODUCT CARDS MEJORADAS ========== */
.product-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    animation: slideInRight 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.product-badge.discount {
    background: linear-gradient(135deg, #dc3545 0%, #a71d2a 100%);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    gap: 10px;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-overlay-btn {
    background: white;
    color: #007bff;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: 600;
}

.product-overlay-btn:hover {
    background: #007bff;
    color: white;
    transform: scale(1.15);
}

/* ========== RATING SYSTEM ========== */
.rating {
    display: flex;
    gap: 4px;
    align-items: center;
}

.star {
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ddd;
}

.star.filled {
    color: #ffc107;
    animation: pulse 0.3s ease;
}

.star:hover {
    transform: scale(1.2);
}

.rating-value {
    font-size: 14px;
    color: #666;
    margin-left: 8px;
}

body.dark-mode .rating-value {
    color: #aaa;
}

/* ========== REVIEWS SECTION ========== */
.reviews-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

body.dark-mode .reviews-section {
    border-top-color: #333;
}

.review-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    animation: slideInLeft 0.4s ease-out;
    transition: all 0.3s ease;
}

body.dark-mode .review-item {
    background: #1f1f1f;
    border: 1px solid #333;
}

.review-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.review-author {
    font-weight: 600;
    color: #333;
}

body.dark-mode .review-author {
    color: #fff;
}

.review-date {
    font-size: 12px;
    color: #999;
}

.review-text {
    color: #666;
    line-height: 1.6;
}

body.dark-mode .review-text {
    color: #aaa;
}

/* ========== NOTIFICACIONES MEJORADAS ========== */
.toast-notification {
    position: fixed;
    top: 90px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
    z-index: 1100;
    min-width: 300px;
}

body.dark-mode .toast-notification {
    background: #1f1f1f;
    border: 1px solid #333;
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

/* ========== TOOLTIPS MEJORADOS ========== */
.tooltip-enhanced {
    position: relative;
}

.tooltip-enhanced:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    animation: slideInLeft 0.2s ease-out;
}

.tooltip-enhanced:hover::before {
    content: '';
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
}

/* ========== SKELETON LOADER ========== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

body.dark-mode .skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
}

.skeleton-image {
    width: 100%;
    height: 250px;
    border-radius: 8px;
}

.skeleton-text {
    height: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
}

/* ========== PARALLAX EFFECT ========== */
.parallax-section {
    position: relative;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    z-index: -1;
}

/* ========== PAGE TRANSITIONS ========== */
.page-transition {
    animation: fadeIn 0.5s ease-out;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .toast-notification {
        min-width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
    }

    .product-card {
        margin-bottom: 15px;
    }

    .filters-panel {
        margin-bottom: 20px;
    }
}

/* ========== ACCESIBILIDAD ========== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Mejora para lectura de pantalla */
.visually-hidden-accessible {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========== CIRCULAR PROFILE IMAGE ========== */
.profile-image-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    transform: translateY(-50%);
    margin-bottom: -50px;
    position: relative;
    z-index: 10;
}

.profile-image-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid #ffffff;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: slideDownProfile 0.6s ease-out 0.3s both;
    background: linear-gradient(135deg, #f0f0f0, #e9ecef);
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.profile-image-wrapper:hover .profile-image {
    transform: scale(1.05);
}

@keyframes slideDownProfile {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Banner Blur/Bokeh Background Effect */
.hero-blur-bg {
    position: relative;
    overflow: hidden;
    background-color: #006bc2;
}

/* Fondo desenfocado - llena todo el espacio */
.hero-blur-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--banner-url);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    filter: blur(20px);
    z-index: 0;
}

/* Imagen limpia encima del fondo blur - centrada sin recorte */
.hero-blur-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--banner-url);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    background-attachment: fixed;
    z-index: 1;
}

.hero-blur-bg > * {
    position: relative;
    z-index: 2;
}

/* Dark Mode Support */
body.dark-mode .profile-image-wrapper {
    border-color: #2a2a2a;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #1f1f1f, #2a2a2a);
}

/* Responsive */
@media (max-width: 768px) {
    .profile-image-wrapper {
        width: 150px;
        height: 150px;
        border-width: 4px;
    }
    
    .profile-image-container {
        margin-bottom: -40px;
    }
}

@media (max-width: 576px) {
    .profile-image-wrapper {
        width: 120px;
        height: 120px;
        border-width: 3px;
    }
    
    .profile-image-container {
        margin-bottom: -30px;
    }
}

/* ========== HERO BANNER OPTIMIZATION ========== */
.hero-contain-bg {
    background-attachment: fixed !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Optimización para imagen completa sin recorte */
@media (max-width: 1024px) {
    .hero-contain-bg {
        background-attachment: scroll !important;
    }
}

/* Soporte para tema oscuro en hero */
body.dark-mode .hero-contain-bg {
    background-color: #1a1a1a;
}
