/* PreScreen Thailand - Custom Styles */

/* CSS Variables */
:root {
    --royal-blue: #0047AB;
    --amber-yellow: #FFBF00;
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --dark-gray: #333333;
    --black: #000000;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* FIX: Apply overflow-x hidden to BOTH html and body to stop mobile sliding */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Ensure images don't overflow their containers */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Header Sticky Behavior */
#header {
    transition: all 0.3s ease;
}

#header.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Hero Section */
#hero {
    position: relative;
    background-image: linear-gradient(135deg, var(--royal-blue), #0033a0);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

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

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

/* CTA Buttons */
.cta-primary,
.cta-secondary {
    transition: all 0.3s ease;
    cursor: pointer;
}

.cta-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(255, 191, 0, 0.4);
}

.cta-secondary:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.3);
}

/* Pulse Animation for CTA */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.whatsapp-btn {
    animation: pulse 2s ease-in-out infinite;
}

.whatsapp-btn:hover {
    animation: none;
}

/* Section Animations */
.section-fade-in {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.section-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Differentiator Cards */
.differentiator-card {
    transition: all 0.3s ease;
}

.differentiator-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 71, 171, 0.15);
}

.differentiator-card i {
    transition: all 0.3s ease;
}

.differentiator-card:hover i {
    transform: scale(1.1) rotate(5deg);
}

/* Service Cards - Glassmorphism */
.service-card {
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7)) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow:
        0 8px 32px rgba(0, 71, 171, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 1px 3px rgba(0, 0, 0, 0.1);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--amber-yellow) !important;
    box-shadow:
        0 20px 50px rgba(0, 71, 171, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85)) !important;
}

.service-card i {
    transition: all 0.3s ease;
}

.service-card:hover i {
    transform: rotate(360deg);
}

/* Process Steps */
.process-step {
    transition: all 0.4s ease;
}

.process-step:hover .w-24 {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(0, 71, 171, 0.3);
}

/* Timeline Line Animation */
.timeline-line {
    transform-origin: left;
    animation: drawLine 2s ease-out forwards;
}

@keyframes drawLine {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* Pricing and Guarantee Cards - Glassmorphism */
.pricing-card {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8)) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(255, 191, 0, 0.5) !important;
    box-shadow:
        0 8px 32px rgba(255, 191, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 0 1px rgba(255, 191, 0, 0.1);
}

.guarantee-card {
    transition: all 0.3s ease;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow:
        0 8px 32px rgba(0, 71, 171, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.pricing-card:hover,
.guarantee-card:hover {
    transform: scale(1.02);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Contact Buttons */
.whatsapp-btn,
.email-btn {
    transition: all 0.3s ease;
}

.whatsapp-btn:hover,
.email-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Back to Top Button */
#backToTop {
    transition: all 0.3s ease;
}

#backToTop:hover {
    transform: scale(1.1);
}

/* Smooth Scroll Padding for Fixed Header */
section {
    scroll-margin-top: 80px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    /* Reduce parallax and heavy animations on mobile */
    #hero {
        background-attachment: scroll;
    }

    .floating-icon {
        display: none;
    }

    /* Simplify hover effects on mobile */
    .differentiator-card:hover,
    .service-card:hover,
    .process-step:hover .w-24,
    .pricing-card:hover,
    .guarantee-card:hover {
        transform: none;
    }

    /* Make timeline vertical on mobile */
    .timeline-line {
        display: none;
    }
}

/* Tablet Breakpoint */
@media (min-width: 640px) and (max-width: 1024px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.hero-content {
    animation: fadeIn 1s ease-in;
}

/* Accessibility: Focus States */
a:focus,
button:focus {
    outline: 3px solid var(--amber-yellow);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    header,
    #backToTop,
    .whatsapp-btn,
    footer {
        display: none;
    }

    section {
        page-break-inside: avoid;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--royal-blue);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--amber-yellow);
}

/* Selection Color */
::selection {
    background-color: var(--amber-yellow);
    color: var(--royal-blue);
}

::-moz-selection {
    background-color: var(--amber-yellow);
    color: var(--royal-blue);
}

/* Image Optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lazy Loading */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Performance: Reduce Motion for Users with Vestibular Disorders */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    /* Uncomment when implementing dark mode */
    /*
    body {
        background-color: var(--dark-gray);
        color: var(--white);
    }
    */
}

/* Gradient Text Effect for Special Headings */
.gradient-text {
    background: linear-gradient(135deg, var(--royal-blue), var(--amber-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card Glow Effect */
.card-glow {
    position: relative;
    overflow: hidden;
}

.card-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 191, 0, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-glow:hover::before {
    opacity: 1;
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    h3 {
        font-size: 1.25rem;
        line-height: 1.4;
    }

    p {
        font-size: 1rem;
        line-height: 1.6;
    }
}

/* Container Max Width */
.container {
    max-width: 1200px;
}

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

.box-shadow-lg {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

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

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

/* Success/Error Messages (Future Form Implementation) */
.message-success {
    background-color: #10b981;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.message-error {
    background-color: #ef4444;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

/* Logo Animation on Load */
@keyframes logoScale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

#header .w-10 {
    animation: logoScale 2s ease-in-out infinite;
}

/* Hero Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

#hero {
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

/* Mobile Navigation Slide Animation */
@media (max-width: 768px) {
    .mobile-menu-enter {
        transform: translateX(100%);
    }

    .mobile-menu-enter-active {
        transform: translateX(0);
        transition: transform 0.3s ease-out;
    }

    .mobile-menu-exit {
        transform: translateX(0);
    }

    .mobile-menu-exit-active {
        transform: translateX(100%);
        transition: transform 0.2s ease-in;
    }
}

/* ========================================
   PREMIUM VISUAL ENHANCEMENTS
   ======================================== */

/* Scroll Reveal Animation */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for cards */
.scroll-reveal[data-delay="1"] { transition-delay: 0s; }
.scroll-reveal[data-delay="2"] { transition-delay: 0.2s; }
.scroll-reveal[data-delay="3"] { transition-delay: 0.4s; }
.scroll-reveal[data-delay="4"] { transition-delay: 0.6s; }

/* Shimmer CTA Animation */
@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.cta-shimmer {
    position: relative;
    overflow: hidden;
}

.cta-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 6s ease-in-out infinite;
}

/* Premium Section Headings - Serif Style */
.section-heading-premium {
    font-family: 'Playfair Display', serif;
    letter-spacing: 0.02em;
}

/* Differentiator Cards - Enhanced Glass Effect */
.differentiator-card {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7)) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow:
        0 8px 32px rgba(0, 71, 171, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 1px 3px rgba(0, 0, 0, 0.08);
}

.differentiator-card:hover {
    transform: translateY(-10px);
    box-shadow:
        0 20px 40px rgba(0, 71, 171, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85)) !important;
}

/* Stats Cards Glass Effect */
.stats-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.75)) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow:
        0 8px 32px rgba(0, 71, 171, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 15px 35px rgba(0, 71, 171, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85)) !important;
}

/* Process Step Enhanced Animation */
.process-step {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s ease-out;
}

.process-step.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Premium Gold Accent Glow */
.gold-glow {
    box-shadow: 0 0 20px rgba(255, 191, 0, 0.3);
}

.gold-glow:hover {
    box-shadow: 0 0 30px rgba(255, 191, 0, 0.5);
}
