/* Custom CSS for Cavendis Website */

/* Custom font classes */
.font-konkhmer {
    font-family: 'Konkhmer Sleokchher', serif;
}

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

/* Prevent horizontal overflow caused by full-bleed sections */
html,
body {
    overflow-x: hidden;
}

/* Modal backdrop styles to ensure proper clickability */
#signupModal .bg-black\/80,
#infoModal .bg-black\/80,
#downloadModal .bg-black\/80,
#videoModal .bg-black\/80 {
    cursor: pointer;
    pointer-events: auto;
    z-index: 40;
}

/* Modal content should not interfere with backdrop clicks */
#signupModal .bg-white,
#infoModal .bg-white,
#downloadModal .bg-white,
#videoModal .bg-white {
    pointer-events: auto;
    z-index: 30;
}

/* Ensure backdrop is above content but below modal container */
#signupModal,
#infoModal,
#downloadModal,
#videoModal {
    z-index: 50;
}

/* Custom animations - fadeInUp removed */

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Animation classes - fade-up removed */

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

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

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Mobile Menu Transitions */
#mobileMenu {
    transition: all 0.3s ease;
}

/* Floating label styles for better mobile support */
.mc-field-group input:focus + label,
.mc-field-group input:not(:placeholder-shown) + label,
.mc-field-group select:focus + label,
.mc-field-group select:not([value=""]) + label {
    transform: translateY(-0.5rem) scale(0.875);
    background-color: white;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    color: #1b452c;
}

/* Ensure floating labels work for all input states */
.mc-field-group input:focus + label,
.mc-field-group input:valid + label,
.mc-field-group input:not([placeholder=" "]) + label {
    transform: translateY(-0.5rem) scale(0.875);
    background-color: white;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    color: #1b452c;
}

/* Special handling for email field with required attribute */
.mc-field-group input[required]:not([placeholder=" "]) + label {
    transform: translateY(-0.5rem) scale(0.875);
    background-color: white;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    color: #1b452c;
}

/* Force floating label behavior for email field */
.mc-field-group input[type="email"]:focus + label,
.mc-field-group input[type="email"]:not([placeholder=" "]) + label {
    transform: translateY(-0.5rem) scale(0.875) !important;
    background-color: white !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    color: #1b452c !important;
}

/* Ensure labels are visible on mobile */
@media (max-width: 640px) {
    .mc-field-group label {
        font-size: 0.875rem;
    }
    
    .mc-field-group input,
    .mc-field-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

#mobileMenu.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#mobileMenu:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Custom breakpoint for extra small screens */
@media (min-width: 475px) {
    .xs\:text-xs {
        font-size: 0.75rem;
        line-height: 1rem;
    }
    
    .xs\:space-x-2 > * + * {
        margin-left: 0.5rem;
    }
}

/* Form validation styling */
#email-error,
#firstname-error,
#lastname-error,
#phone-error,
#income-error,
#birthday-error,
#gdpr-error {
    transition: all 0.2s ease-in-out;
}

input:focus.ring-red-500,
select:focus.ring-red-500 {
    --tw-ring-color: rgb(239 68 68);
}

input.border-red-500,
select.border-red-500 {
    border-color: rgb(239 68 68);
}

/* GDPR checkbox error styling */
label.text-red-600 {
    color: rgb(239 68 68);
}

/* Responsive Navigation - Show/hide based on screen size */
@media (max-width: 640px) {
    .nav-links {
        display: none !important;
        width: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        visibility: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Medium screens - Text wrap and right align */
@media (min-width: 641px) and (max-width: 1080px) {
    .nav-links {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-end !important;
        align-items: center !important;
        width: auto !important;
        overflow: visible !important;
        position: relative !important;
        visibility: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 0.3rem 0.8rem !important
    }
    
    #mobileMenuBtn {
        display: none !important;
    }
}

/* Large screens - Full horizontal layout with proper spacing */
@media (min-width: 1081px) {
    .nav-links {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        align-items: center !important;
        width: auto !important;
        overflow: visible !important;
        position: relative !important;
        visibility: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 2rem !important;
    }
    
    #mobileMenuBtn {
        display: none !important;
    }
}

/* Custom button styles */
.btn-primary {
    @apply bg-green-800 text-white px-8 py-3 rounded-lg font-medium transition-all duration-300;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    @apply bg-green-700 transform scale-105;
    box-shadow: 0 10px 25px rgba(29, 88, 6, 0.3);
}

/* Video player styles */
.video-player {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
}

.video-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.video-player:hover::before {
    transform: translateX(100%);
}

/* Podcast player styles */
.podcast-episode {
    transition: all 0.3s ease;
    cursor: pointer;
}

.podcast-episode:hover {
    transform: translateX(5px);
    background-color: rgba(0, 0, 0, 0.8) !important;
}

/* Process step animations removed */

/* Team member card effects */
.team-member {
    position: relative;
}

/* Standardized Link Styles */
.link-primary {
    @apply text-gray-900 hover:text-green-700 transition-colors duration-200;
}

.link-secondary {
    @apply text-gray-600 hover:text-gray-900 transition-colors duration-200;
}

.link-accent {
    @apply text-green-600 hover:text-green-700 transition-colors duration-200;
}

.link-contact {
    @apply text-green-800 hover:text-green-600 transition-colors duration-200;
}

.link-arrow {
    @apply flex items-center space-x-2 text-sm text-gray-900 hover:text-gray-700 underline cursor-pointer transition-colors duration-200;
}

.link-arrow-lg {
    @apply flex items-center space-x-2 text-base text-gray-900 hover:text-gray-700 underline cursor-pointer transition-colors duration-200;
}

.link-social {
    @apply text-gray-400 hover:text-green-600 transition-colors duration-200;
}

.link-social-blue {
    @apply text-gray-400 hover:text-blue-600 transition-colors duration-200;
}

/* Navigation effects */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

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

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

/* City dropdown styles */
.city-dropdown {
    position: relative;
    transition: all 0.3s ease;
}

.city-dropdown:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Document preview effects */
.document-preview {
    transition: all 0.5s ease;
}

.document-preview:hover {
    transform: rotate(0deg) scale(1.05);
    z-index: 10;
}

/* Chart animation */
.chart-container {
    position: relative;
    overflow: hidden;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(249, 228, 187, 0.3), transparent);
    transform: translateX(-100%);
    animation: chartScan 3s ease-in-out infinite;
}

@keyframes chartScan {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .process-grid {
        grid-template-columns: 1fr;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    /* Mobile modal improvements */
    body {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Improve modal touch handling on mobile */
    #signupModal,
    #infoModal,
    #downloadModal,
    #videoModal {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Make modal content more mobile-friendly */
    #signupModal .bg-white,
    #infoModal .bg-white,
    #downloadModal .bg-white,
    #videoModal .bg-white {
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    /* Improve backdrop touch area on mobile */
    #signupModal .bg-black\/60,
    #infoModal .bg-black\/60,
    #downloadModal .bg-black\/60,
    #videoModal .bg-black\/60 {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-padding {
        padding: 2rem 1rem;
    }
}

/* Loading animations removed */

/* Focus styles for accessibility */
button:focus,
a:focus,
input:focus {
    outline: 2px solid #1b452c;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        color: black !important;
        background: white !important;
    }
}
