/* Custom Styles for Pilar Vivó Website */

/* ==========================================
   HEADER LOGO ENHANCEMENT
   ========================================== */
header img {
    filter: drop-shadow(0 2px 8px rgba(93, 122, 100, 0.3));
    transition: all 0.3s ease;
}

header img:hover {
    filter: drop-shadow(0 4px 12px rgba(93, 122, 100, 0.5));
    transform: scale(1.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile touch improvements */
button, a {
    touch-action: manipulation;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #FAF8F5;
}

::-webkit-scrollbar-thumb {
    background: #5D7A64;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a6150;
}

/* Smooth transitions for all links */
a {
    transition: all 0.3s ease;
}

/* Header Scroll Effect */
#header.scrolled {
    padding: 0.75rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Active Navigation Link */
.nav-link.active {
    color: #5D7A64 !important;
    font-weight: 600;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Card Hover Effects */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

/* Button Styles */
button, .btn {
    cursor: pointer;
    transition: all 0.3s ease;
}

button:active, .btn:active {
    transform: scale(0.98);
}

/* Image Lazy Loading Effect */
img {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

img.loaded {
    opacity: 1;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #5D7A64 0%, #8BA888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom Container Max Width */
.container-custom {
    max-width: 1400px;
    margin: 0 auto;
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Pulse Animation for CTA Buttons */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 25px -5px rgba(93, 122, 100, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 15px 35px -5px rgba(93, 122, 100, 0.4);
    }
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* Testimonial Card */
.testimonial-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

/* Section Divider */
.section-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #5D7A64 0%, #8BA888 100%);
    margin: 1rem auto;
    border-radius: 2px;
}

/* Stats Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-number {
    animation: countUp 0.8s ease-out;
}

/* Custom Form Styles */
input, textarea, select {
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #5D7A64;
    box-shadow: 0 0 0 3px rgba(93, 122, 100, 0.1);
}

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #E8F0E9;
    border-top: 3px solid #5D7A64;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Menu Slide */
#mobile-menu {
    transition: all 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
}

#mobile-menu.show {
    max-height: 500px;
}

/* FAQ Accordion */
.faq-answer {
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    max-height: 0;
    overflow: hidden;
}

.faq-question.active + .faq-answer {
    max-height: 500px;
    padding-top: 1rem;
}

.faq-question.active i {
    transform: rotate(180deg);
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    header, footer, .no-print {
        display: none;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles for Accessibility */
*:focus {
    outline: 2px solid #5D7A64;
    outline-offset: 2px;
}

button:focus, a:focus {
    outline: 2px solid #5D7A64;
    outline-offset: 2px;
}

/* Custom Selection Color */
::selection {
    background-color: #8BA888;
    color: white;
}

::-moz-selection {
    background-color: #8BA888;
    color: white;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    body {
        background-color: #1a1a1a;
        color: #f5f5f5;
    }
    */
}

/* Smooth Reveal on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile: Show all content immediately without animations */
@media (max-width: 768px) {
    .scroll-reveal {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}

/* Custom Border Gradient */
.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, #5D7A64, #8BA888) border-box;
}

/* Image Overlay Effect */
.image-overlay {
    position: relative;
    overflow: hidden;
}

.image-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(93, 122, 100, 0.3), rgba(139, 168, 136, 0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-overlay:hover::after {
    opacity: 1;
}

/* Cal.com Booking Widget Styles */
#cal-booking {
    min-height: 500px;
    position: relative;
}

/* Custom Badge */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
}

.badge-primary {
    background-color: #5D7A64;
}

.badge-secondary {
    background-color: #8BA888;
}

/* Glowing Effect */
.glow {
    box-shadow: 0 0 20px rgba(93, 122, 100, 0.4);
}

.glow:hover {
    box-shadow: 0 0 30px rgba(93, 122, 100, 0.6);
}

/* Gallery Image Effects */
.gallery-image {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
}

.gallery-image img {
    transition: transform 0.4s ease;
}

.gallery-image:hover img {
    transform: scale(1.1);
}

.gallery-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(93, 122, 100, 0.5) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-image:hover::after {
    opacity: 1;
}

/* Mobile Responsive Optimizations */
@media (max-width: 768px) {
    /* Reduce animations on mobile for better performance */
    .gallery-image:hover img {
        transform: scale(1.05);
    }
    
    /* Better spacing for mobile */
    section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    /* Larger tap targets (minimum 44x44px) */
    button, a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Prevent horizontal scroll */
    body, html {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Mobile menu improvements */
    #mobile-menu {
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
}

@media (max-width: 640px) {
    /* Extra small screens */
    h1 {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.75rem !important;
    }
    
    /* Stack everything vertically */
    .grid {
        gap: 1rem;
    }
    
    /* Reduce padding on cards */
    .p-8, .p-6 {
        padding: 1.25rem !important;
    }
}

/* Touch device specific */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .hover\:shadow-xl:hover {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }
    
    /* Make clickable areas more obvious */
    a, button {
        position: relative;
    }
}

/* Landscape mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .min-h-screen {
        min-height: auto;
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

/* ============================================
   PARALLAX & SCROLL ANIMATIONS
   ============================================ */

/* Fade in animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation classes */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
    opacity: 0;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
    opacity: 0;
}

.scale-in {
    animation: scaleIn 0.8s ease-out forwards;
    opacity: 0;
}

/* Parallax effect */
.parallax-section {
    position: relative;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: -50%;
    left: 0;
    width: 100%;
    height: 200%;
    background-size: cover;
    background-position: center;
    will-change: transform;
    z-index: -1;
}

/* Scroll reveal effects - Initially hidden */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile: Show all content immediately without animations */
@media (max-width: 768px) {
    .scroll-reveal {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}

/* Floating animation for hero image */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

/* Parallax hover effect on cards */
.card-parallax {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-parallax:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(93, 122, 100, 0.2);
}

/* Image parallax effect */
.image-parallax {
    transition: transform 0.5s ease-out;
    will-change: transform;
}

/* Smooth scroll snap (optional) */
@media (min-width: 768px) {
    .snap-container {
        scroll-snap-type: y proximity;
    }
    
    .snap-section {
        scroll-snap-align: start;
    }
}

/* Disable animations on reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .parallax-bg,
    .image-parallax {
        transform: none !important;
    }
}
