
/**
 * KhudraX Website Custom Styles
 * 
 * This file contains custom CSS that works alongside Tailwind CSS
 * for specific styling needs and animations.
 */

/* CSS Variables for consistent colors */
:root {
    --khudra-primary: #3bb371;
    --khudra-olive: #4b4c2b;
    --khudra-sand: #949362;
    --khudra-primary-rgb: 59, 179, 113;
    --khudra-olive-rgb: 75, 76, 43;
    --khudra-sand-rgb: 148, 147, 98;
}

/* Custom utility classes */
.khudra-primary { color: var(--khudra-primary); }
.khudra-olive { color: var(--khudra-olive); }
.khudra-sand { color: var(--khudra-sand); }

.bg-khudra-primary { background-color: var(--khudra-primary); }
.bg-khudra-olive { background-color: var(--khudra-olive); }
.bg-khudra-sand { background-color: var(--khudra-sand); }

.text-khudra-primary { color: var(--khudra-primary); }
.text-khudra-olive { color: var(--khudra-olive); }
.text-khudra-sand { color: var(--khudra-sand); }

.border-khudra-primary { border-color: var(--khudra-primary); }
.border-khudra-olive { border-color: var(--khudra-olive); }
.border-khudra-sand { border-color: var(--khudra-sand); }

/* Navigation styles */
.navbar-blur {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link {
    color: #374151;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.nav-link:hover {
    color: var(--khudra-primary);
}

.nav-link.active {
    color: var(--khudra-primary);
    font-weight: 600;
}

.mobile-nav-link {
    color: #374151;
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.mobile-nav-link:hover {
    color: var(--khudra-primary);
    background-color: #f9fafb;
}

.mobile-nav-link.active {
    color: var(--khudra-primary);
    background-color: rgba(59, 179, 113, 0.1);
    font-weight: 600;
}

/* Hero section with parallax effect */
.hero-parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    min-height: 100vh;
    min-height: -webkit-fill-available; /* iOS Safari fix */
}

.hero-parallax::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 179, 113, 0.8) 0%, rgba(75, 76, 43, 0.6) 100%);
    z-index: 1;
}

.hero-parallax .hero-content {
    position: relative;
    z-index: 2;
}

/* On mobile, disable parallax for performance */
@media (max-width: 768px) {
    .hero-parallax {
        background-attachment: scroll;
        min-height: calc(100vh - 64px); /* Account for fixed nav */
    }
}

/* Hero Logo Animation - Subtle floating effect */
.hero-logo {
    animation: logoFloat 6s ease-in-out infinite;
    transform-origin: center;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    25% {
        transform: translateY(-8px) scale(1.02);
    }
    50% {
        transform: translateY(0px) scale(1);
    }
    75% {
        transform: translateY(-5px) scale(1.01);
    }
}

/* Ensure the logo container maintains its position */
.hero-logo-container {
    position: relative;
    display: inline-block;
}

/* Glass effect for cards */
.glass-effect {
    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);
}

/* Service cards with hover effects */
.service-card {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

/* Button styles */
.btn-khudra-primary {
    background-color: var(--khudra-primary);
    color: white;
    transition: all 0.3s ease;
}

.btn-khudra-primary:hover {
    background-color: var(--khudra-olive);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 179, 113, 0.3);
}

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

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Animation classes */
.animate-count-up {
    animation: countUp 0.8s ease-out forwards;
}

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

.animate-pulse-gentle {
    animation: pulse 2s ease-in-out infinite;
}

.split-text {
    overflow: hidden;
    position: relative;
}

.split-text span {
    display: inline-block;
    opacity: 0;
    animation: slideUp 0.6s ease-out forwards;
}

/* Map styles */
.province-path {
    cursor: pointer;
    transition: all 0.3s ease;
    stroke: #ffffff;
    stroke-width: 1.5;
}

.province-path.visited {
    fill: var(--khudra-primary);
}

.province-path.unvisited {
    fill: #cccccc;
}

.province-path:hover {
    stroke-width: 2;
    filter: brightness(1.1);
    transform: scale(1.02);
    transform-origin: center;
}

.province-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
}

.map-legend {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 10px;
    border: 1px solid #ddd;
}

/* Form styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--khudra-olive);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--khudra-primary);
    box-shadow: 0 0 0 3px rgba(59, 179, 113, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Notification styles */
.notification {
    animation: slideInRight 0.3s ease-out forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading spinner */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--khudra-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Activity cards */
.activity-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.activity-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.activity-card .image-wrapper {
    position: relative;
    overflow: hidden;
}

.activity-card .image-wrapper img {
    transition: transform 0.3s ease;
}

.activity-card:hover .image-wrapper img {
    transform: scale(1.05);
}

/* Reservation form */
.reservation-form {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 100%);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Stats counters */
.stats-counter {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--khudra-primary);
    display: block;
    line-height: 1;
}

/* Stats counter text (for non-numeric counters) */
.stats-counter-text {
    font-size: 2.5rem;
    font-weight: bold;
    display: block;
    line-height: 1;
}

/* Infinity and special icons */
.unlimited-icon,
.always-icon {
    display: inline-block;
    font-size: 4rem;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.9;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Impact stats styling */
.impact-stat {
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.impact-stat:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Hero logo animation */
.hero-logo-container {
    animation: heroLogoAppear 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-logo {
    transition: all 0.5s ease;
}

.hero-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(3px 3px 15px rgba(59, 179, 113, 0.6));
}

@keyframes heroLogoAppear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Hero title animation (keep for backwards compatibility) */
.hero-title {
    animation: heroTitleAppear 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heroTitleAppear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Text cycling animation */
.text-cycling-wrapper {
    overflow: hidden;
}

.text-cycling-text {
    animation: textSlideIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-block;
}

@keyframes textSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes textSlideOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px);
    }
}

/* Testimonial cards */
.testimonial-card {
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    border-color: var(--khudra-primary);
}

/* Hidden testimonials - will be shown dynamically */
.hidden-testimonial {
    animation: fadeInUp 0.6s ease-out forwards;
}

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

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .hero-parallax {
        background-attachment: scroll;
    }
    
    .service-card {
        margin-bottom: 2rem;
    }
    
    .stats-counter {
        font-size: 2rem;
    }
    
    .reservation-form {
        padding: 1.5rem;
    }
}

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

/* Focus styles for accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    outline: 2px solid var(--khudra-primary);
    outline-offset: 2px;
}

/* Hide scrollbar but keep functionality */
.hide-scrollbar {
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
    scrollbar-width: none;  /* Firefox */
}

.hide-scrollbar::-webkit-scrollbar { 
    display: none;  /* Safari and Chrome */
}

/* Province details modal */
.modal-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

/* Custom checkbox and radio styles */
.custom-checkbox,
.custom-radio {
    position: relative;
    cursor: pointer;
}

.custom-checkbox input,
.custom-radio input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #eee;
    border-radius: 3px;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
}

.custom-checkbox:hover input ~ .checkmark {
    background-color: #ccc;
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--khudra-primary);
    border-color: var(--khudra-primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

/* ========================================
   MAP SVG STYLES - Remove all borders/outlines
   ======================================== */

/* Remove any outline or border from SVG paths */
#cambodia-map svg path,
#cambodia-map-container svg path,
svg path[data-province-name] {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Remove focus outline from SVG elements */
#cambodia-map svg,
#cambodia-map svg *,
#cambodia-map-container svg,
#cambodia-map-container svg * {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Remove any selection or focus effects */
svg path:focus,
svg path:active,
svg path:focus-visible {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Ensure smooth rendering without artifacts */
#cambodia-map svg,
#cambodia-map-container svg {
    shape-rendering: geometricPrecision;
    outline: none !important;
}
