/**
 * Custom Styles
 * Rasha Tours Lanka
 */

/* Base Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
.font-display {
    font-family: 'Playfair Display', serif;
}

/* Hero Canvas */
#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

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

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

::-webkit-scrollbar-thumb {
    background: #0ea5e9;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0284c7;
}

/* Line Clamp Utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Hover Effects */
.tour-card {
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

/* Tour Card Image Container */
.tour-card .image-container,
.tour-card > div:first-child {
    position: relative;
    width: 100%;
    min-height: 208px; /* h-52 = 13rem = 208px */
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    overflow: hidden;
}

.tour-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.tour-card:hover img {
    transform: scale(1.1);
}

/* Broken Image Fallback */
.tour-card img[src$=".svg"],
.tour-card img.p-8 {
    object-fit: contain;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
}

/* Badge Styles */
.tour-card .absolute {
    z-index: 10;
}

/* Ensure equal card heights in grid */
.grid .tour-card {
    height: 100%;
}

/* Button Hover Animation */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-primary:hover::after {
    width: 300px;
    height: 300px;
}

/* WhatsApp Button Animation */
.whatsapp-float {
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Contact Button Animations */
.contact-btn-pulse {
    animation: contact-pulse 2s ease-in-out infinite;
}

@keyframes contact-pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(14, 165, 233, 0.6);
    }
}

/* Contact Label Animation - accounts for translate-y-1/2 */
.contact-label-animate {
    animation: label-bounce 2.5s ease-in-out infinite;
}

@keyframes label-bounce {
    0%, 100% {
        transform: translateY(-50%) translateX(0);
    }
    50% {
        transform: translateY(-50%) translateX(-6px);
    }
}

/* Contact Float Container */
#contact-float {
    overflow: visible !important;
}

/* Ensure button is fully visible */
#contact-btn {
    position: relative;
    z-index: 51;
}

/* Ensure popup doesn't go off-screen on mobile */
@media (max-width: 640px) {
    #contact-popup {
        right: 0;
        max-width: calc(100vw - 32px);
    }
}

/* Contact Label Transitions */
#contact-label {
    transition: opacity 0.3s ease-in-out;
    z-index: 49;
}

/* Ensure html and body don't clip the floating button */
html, body {
    overflow-x: clip;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0ea5e9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Skeleton Loading */
.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; }
}

/* Breadcrumb */
.breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #fff;
}

/* Active Navigation */
nav a.active {
    color: #0ea5e9;
    font-weight: 600;
}

/* Dropdown Animation */
.group:hover .group-hover\:visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Hero Gradient Overlay */
.hero-overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 100%);
}

/* Tour Card Price Tag */
.price-tag {
    position: relative;
}

.price-tag::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 0;
    border-width: 15px 10px 15px 0;
    border-style: solid;
    border-color: transparent #0ea5e9 transparent transparent;
}

/* Testimonial Quote Icon */
.testimonial-quote::before {
    content: '"';
    font-size: 4rem;
    font-family: Georgia, serif;
    color: rgba(14, 165, 233, 0.2);
    position: absolute;
    top: -20px;
    left: 10px;
}

/* Image Hover Zoom */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.5s ease;
}

.img-zoom:hover img {
    transform: scale(1.1);
}

/* Stats Counter Animation */
.stat-number {
    display: inline-block;
}

/* Form Focus States */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Swiper Customization */
.swiper-button-next,
.swiper-button-prev {
    color: #fff !important;
    background: rgba(0, 0, 0, 0.5);
    width: 50px !important;
    height: 50px !important;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: rgba(249, 115, 22, 0.8);
    transform: scale(1.1);
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 20px !important;
}

.swiper-pagination-bullet {
    background: #fff !important;
    opacity: 0.5 !important;
    width: 12px !important;
    height: 12px !important;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    opacity: 1 !important;
    background: #f97316 !important;
    width: 36px !important;
    border-radius: 6px !important;
}

/* Hero Slider Specific Styles */
.hero-swiper {
    height: 100vh;
    min-height: 600px;
}

.hero-swiper .swiper-slide {
    position: relative;
}

.hero-swiper .swiper-button-next,
.hero-swiper .swiper-button-prev {
    display: none;
}

@media (min-width: 768px) {
    .hero-swiper .swiper-button-next,
    .hero-swiper .swiper-button-prev {
        display: flex;
    }
}

.hero-pagination {
    bottom: 30px !important;
}

/* Hero Slide Content Animation */
.slide-title,
.slide-subtitle,
.slide-buttons {
    opacity: 1;
    transform: translateY(0);
}

/* Ken Burns Effect for Background Images */
.hero-swiper .swiper-slide-active .bg-cover {
    animation: kenburns 20s ease-out forwards;
}

@keyframes kenburns {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.1);
    }
}

/* Slide Content Text Shadow for better readability */
.hero-swiper .slide-title {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-swiper .slide-subtitle {
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .tour-card {
        margin-bottom: 1rem;
    }
}

/* Print Styles */
@media print {
    header, footer, .whatsapp-float, .back-to-top {
        display: none !important;
    }

    body {
        background: #fff;
    }
}

/* 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 Visible */
:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

/* Reduce 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 (Future) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here when needed */
}
