/* Custom Styles for Dive With George */

/* Smooth Scrolling - Optimizado */
html {
    scroll-behavior: smooth;
}

/* Body */
body {
    overflow-x: hidden;
    background: linear-gradient(to bottom, #e0f2fe 0%, #dbeafe 50%, #e0e7ff 100%); /* Fondo oceánico suave */
}

/* Optimización de animaciones */
* {
    will-change: auto;
}

/* Animations - Reducidas para mejor performance */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Flip Card Styles - Interactive Cards */
.flip-card {
    perspective: 1000px;
    position: relative;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.flip-card-front {
    transform: rotateY(0deg);
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Hover effect for flip cards */
.flip-card:hover {
    transform: translateY(-5px);
    transition: transform 0.3s ease;
}

/* Language Selector Styles */
.language-selector {
    position: relative;
}

.language-selector button {
    cursor: pointer;
    user-select: none;
}

#languageMenu {
    z-index: 1000;
    animation: fadeInDown 0.3s ease-out;
}

#languageMenu button {
    white-space: nowrap;
    font-size: 0.875rem;
    color: #374151;
}

#languageMenu button:hover {
    background-color: #f3f4f6;
}

/* WhatsApp Floating Button Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

.pulse-animation:hover {
    animation: none;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

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

/* Certification Logos in Navbar */
.certification-logos img {
    transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
}

.certification-logos img:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Navbar logo styling */
nav img {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

nav img:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Wave Animation - Optimizada */
.waves-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 15vh;
    min-height: 100px;
    max-height: 150px;
    transform: translateZ(0); /* GPU acceleration */
}

.waves {
    position: relative;
    width: 100%;
    height: 100%;
    margin-bottom: -7px;
    transform: translateZ(0); /* GPU acceleration */
}

.parallax > use {
    animation: move-forever 20s cubic-bezier(.55,.5,.45,.5) infinite;
}

.parallax > use:nth-child(1) {
    animation-delay: -2s;
    animation-duration: 6s;
}

.parallax > use:nth-child(2) {
    animation-delay: -3s;
    animation-duration: 8s;
}

.parallax > use:nth-child(3) {
    animation-delay: -4s;
    animation-duration: 10s;
}

.parallax > use:nth-child(4) {
    animation-delay: -5s;
    animation-duration: 15s;
}

@keyframes move-forever {
    0% {
        transform: translate3d(-90px,0,0);
    }
    100% { 
        transform: translate3d(85px,0,0);
    }
}

/* Navbar Scroll Effect */
.navbar-scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Nav Links Hover Effect */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #096dd9;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile Nav Links */
.mobile-nav-link {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Form Focus States */
input:focus,
textarea:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

/* Button Hover Effects - Optimizado */
button,
a.inline-block {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Removido el efecto before para mejor performance */

/* Card Hover Effects - Optimizado */
.hover\:shadow-2xl {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Cookie Banner Animation */
.cookie-banner-hidden {
    transform: translateY(100%);
}

/* Scroll to Top Button */
#scrollToTop {
    transition: opacity 0.3s, transform 0.3s;
}

#scrollToTop.show {
    opacity: 1;
    pointer-events: all;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Responsive Typography */
@media (max-width: 768px) {
    .waves-container {
        height: 10vh;
        min-height: 60px;
    }
}

/* Image Overlay Effects */
.overlay-gradient {
    background: linear-gradient(135deg, rgba(24, 144, 255, 0.9) 0%, rgba(9, 109, 217, 0.8) 100%);
}

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

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

::-webkit-scrollbar-thumb {
    background: #1890ff;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #096dd9;
}

/* Selection Color */
::selection {
    background-color: #1890ff;
    color: white;
}

::-moz-selection {
    background-color: #1890ff;
    color: white;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1890ff;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
    outline: 2px solid #1890ff;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* Utility Classes */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.box-shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.transition-all {
    transition: all 0.2s ease; /* Reducido de 0.3s */
}

/* Performance Optimizations */
img {
    content-visibility: auto;
}

section {
    contain: layout style paint;
}

/* Navbar con efecto océano */
#navbar {
    background: linear-gradient(to right, #f0f9ff, #e0f2fe) !important;
}

#navbar.navbar-scrolled {
    background: linear-gradient(to right, #e0f2fe, #dbeafe) !important;
}

/* Mejorar contraste en cards */
.bg-gradient-to-br {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

/* Form Validation Styles */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #f5222d;
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
    border-color: #52c41a;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Backdrop Blur */
.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Glass Morphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Floating Animation */
@keyframes floating {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.animate-floating {
    animation: floating 3s ease-in-out infinite;
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s linear infinite;
}

/* ==================== GALLERY STYLES ==================== */

/* Gallery Grid Animation - Optimizado */
.gallery-item {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-item img {
    transition: transform 0.3s ease;
}

/* Lightbox Styles */
#lightbox {
    animation: fadeIn 0.2s ease;
}

#lightbox.hidden {
    display: none !important;
}

#lightboxImage {
    animation: zoomIn 0.25s ease;
    transition: opacity 0.2s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Lightbox Controls Hover - Optimizado */
#closeLightbox:hover,
#prevImage:hover,
#nextImage:hover {
    transform: scale(1.05);
}

#closeLightbox,
#prevImage,
#nextImage {
    transition: all 0.2s ease;
}

/* Gallery Item Numbers/Counter */
.gallery-counter {
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

/* Gallery Masonry Effect (optional) */
@media (min-width: 768px) {
    .gallery-masonry {
        column-count: 2;
        column-gap: 1.5rem;
    }
    
    .gallery-masonry .gallery-item {
        break-inside: avoid;
        margin-bottom: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .gallery-masonry {
        column-count: 3;
    }
}

/* Gallery Skeleton Loading */
.gallery-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Gallery Item Badge */
.gallery-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(24, 144, 255, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Prevent text selection in lightbox */
#lightbox * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* Keyboard Navigation Hint */
.keyboard-hint {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    z-index: 60;
    animation: fadeIn 0.5s ease;
}

/* Mobile Gallery Optimizations */
@media (max-width: 768px) {
    .gallery-item {
        margin-bottom: 1rem;
    }
    
    #prevImage,
    #nextImage {
        font-size: 2rem;
    }
    
    #lightboxCaption {
        font-size: 1rem;
        bottom: 4rem;
    }
}

