:root { 
    --cpac-blue: #004289; 
    --cpac-light-blue: #0076c0;
    --slate-gray: #f8fafc;
}

body { 
    font-family: 'Sarabun', sans-serif; 
    color: #1e293b; 
    line-height: 1.8; 
    background-color: #ffffff; 
    overflow-x: hidden; 
    max-width: 100%;
    position: relative;
}

h1, h2, h3, h4, .font-kanit { 
    font-family: 'Kanit', sans-serif; 
    letter-spacing: -0.01em; 
}

/* --- Preloader Styles --- */
#preloader {
    position: fixed;
    inset: 0;
    background-color: var(--cpac-blue);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.text-pulse-glow {
    animation: pulseGlow 1.2s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: scale(0.98); opacity: 0.5; text-shadow: 0 0 0px rgba(255, 255, 255, 0); }
    100% { transform: scale(1.05); opacity: 1; text-shadow: 0 0 20px rgba(255, 255, 255, 0.5); }
}

.header-shadow { 
    box-shadow: 0 2px 15px rgba(0,0,0,0.05); 
    transition: all 0.3s ease; 
}

/* --- Hero Section & Zoom Effect --- */
.hero-cpac {
    position: relative;
    overflow: hidden;
    z-index: 1;
    min-height: calc(100svh - 80px) !important; 
    background: none !important; 
}

.hero-cpac::before {
    content: "";
    position: absolute;
    top: -10%; left: -10%; width: 120%; height: 120%;
    background: linear-gradient(90deg, rgba(0, 66, 137, 0.9) 0%, rgba(0, 66, 137, 0.4) 100%), 
                url('https://images.unsplash.com/photo-1541888946425-d81bb19240f5?q=80&w=1600');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-animation: heroZoomV2 15s linear infinite alternate;
    animation: heroZoomV2 15s linear infinite alternate;
}

@-webkit-keyframes heroZoomV2 {
    0% { -webkit-transform: scale(1); }
    100% { -webkit-transform: scale(1.15); }
}

@keyframes heroZoomV2 {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

/* --- Card Effects (Modern & Premium) --- */
.card-modern, .shine-effect {
    position: relative;
    overflow: hidden;
}

.card-modern::after, .shine-effect::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(30deg);
    transition: all 0.7s;
    pointer-events: none;
    z-index: 1;
}

.card-modern:hover::after, .shine-effect:hover::after {
    left: 120%;
}

.card-modern:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 66, 137, 0.2) !important;
}

.card-premium {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-premium:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 66, 137, 0.15) !important;
}

.card-premium::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-25deg);
    transition: 0.7s;
}

.card-premium:hover::before {
    left: 125%;
}

.service-card-hover {
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.service-card-hover:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 66, 137, 0.15);
}

/* --- Navigation & Menus --- */
#mobile-menu {
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    transform: translateX(100%);
}

#mobile-menu.active { transform: translateX(0); }

.desktop-dropdown { position: relative; }

.desktop-dropdown-content {
    display: block;
    visibility: hidden;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.3s ease;
    pointer-events: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 240px;
    z-index: 50;
}

.desktop-dropdown:hover .desktop-dropdown-content {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.mobile-sub-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1); 
}

.mobile-sub-content.open {
    max-height: 1000px; 
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-sub-inner {
    padding-left: 1rem;
    padding-bottom: 1rem;
    background: #f8fafc;
}

.rotate-icon { transition: transform 0.4s; }
.rotate-icon.active, .rotate-180 { transform: rotate(180deg); }

/* --- FAQ Accordion --- */
.accordion-content, .faq-content {
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-header i {
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-header i {
    transform: rotate(180deg);
}

/* --- Swiper & Components --- */
.swiper-button-next, .swiper-button-prev { 
    color: var(--cpac-blue) !important; 
    scale: 0.7; 
    transition: 0.3s; 
}

.swiper-button-next:hover, .swiper-button-prev:hover { scale: 0.9; }

.swiper-pagination-bullet-active { 
    background: var(--cpac-blue) !important; 
    width: 24px !important; 
    border-radius: 4px !important; 
    transition: 0.3s; 
}

.float-contact-sync { 
    animation: fluidBounce 3s ease-in-out infinite; 
}

#floating-status {
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-img-wrap { overflow: hidden; border-radius: 8px; }
.project-img-wrap img { transition: transform 0.8s ease; }
.swiper-slide:hover img { transform: scale(1.1); }

/* --- Animations --- */
@keyframes fluidBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes bounceSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.animate-bounce-slow {
    animation: bounceSlow 3s ease-in-out infinite;
}

@keyframes cardSlider {
    0%, 28%   { transform: translateX(0); } 
    33%, 61%  { transform: translateX(-25%); } 
    66%, 94%  { transform: translateX(-50%); } 
    100%      { transform: translateX(-75%); } 
}

.animate-card-slider {
    animation: cardSlider 15s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

.delay-1 { animation-delay: 0s; }
.delay-2 { animation-delay: -5s; }
.delay-3 { animation-delay: -10s; }

[data-aos] { pointer-events: none; }
.aos-animate { pointer-events: auto; }

/* Scroll Trigger Animations */
.trigger-card .draw-line-effect { width: 0%; opacity: 0; }
.trigger-card .pop-icon-effect { transform: scale(0.5) translateY(20px); opacity: 0; }

.aos-animate.trigger-card .draw-line-effect { animation: drawLineEffect 0.8s ease-out forwards; }
.aos-animate.trigger-card .pop-icon-effect { animation: popIconEffect 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

.aos-animate.delay-step-1 .draw-line-effect { animation-delay: 0.1s; }
.aos-animate.delay-step-1 .pop-icon-effect { animation-delay: 0.3s; }
.aos-animate.delay-step-2 .draw-line-effect { animation-delay: 0.3s; }
.aos-animate.delay-step-2 .pop-icon-effect { animation-delay: 0.5s; }
.aos-animate.delay-step-3 .draw-line-effect { animation-delay: 0.5s; }
.aos-animate.delay-step-3 .pop-icon-effect { animation-delay: 0.7s; }
.aos-animate.delay-step-4 .draw-line-effect { animation-delay: 0.7s; }
.aos-animate.delay-step-4 .pop-icon-effect { animation-delay: 0.9s; }

@keyframes drawLineEffect {
    0% { width: 0%; opacity: 0; }
    100% { width: 100%; opacity: 1; }
}

@keyframes popIconEffect {
    0% { transform: scale(0.5) translateY(20px); opacity: 0; }
    70% { transform: scale(1.1) translateY(-5px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes stepFlashDark {
    0% { background-color: #1e293b; transform: scale(1); box-shadow: none; }
    30% { background-color: #2563eb; transform: scale(1.1); box-shadow: 0 0 25px rgba(37, 99, 235, 0.8); }
    100% { background-color: #1e293b; transform: scale(1); box-shadow: none; }
}

.trigger-step.aos-animate .flash-circle {
    animation: stepFlashDark 1.2s ease-in-out forwards;
}

@keyframes floatShield {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}
.animate-float-shield {
    animation: floatShield 6s ease-in-out infinite;
}

@keyframes iconPopScroll {
    0% { transform: scale(0.5) translateY(15px); opacity: 0; color: #94a3b8; }
    60% { transform: scale(1.2) translateY(-5px); color: #3b82f6; opacity: 1; }
    100% { transform: scale(1) translateY(0); color: #004289; opacity: 1; }
}
.tech-card .tech-icon { opacity: 0; }
.tech-card.aos-animate .tech-icon {
    animation: iconPopScroll 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes checkBlinkScroll {
    0% { transform: scale(0.5); opacity: 0; background-color: transparent; box-shadow: none; }
    20% { transform: scale(1.4); opacity: 1; background-color: #22c55e; box-shadow: 0 0 20px #22c55e; color: #fff; }
    50% { transform: scale(1); background-color: transparent; box-shadow: none; color: #4ade80; }
    75% { transform: scale(1.3); background-color: #22c55e; box-shadow: 0 0 15px #22c55e; color: #fff; }
    100% { transform: scale(1); opacity: 1; background-color: rgba(34, 197, 94, 0.15); box-shadow: 0 0 10px rgba(34, 197, 94, 0.3); color: #4ade80; }
}
.safe-list .check-icon { opacity: 0; }
.safe-list.aos-animate .check-icon {
    animation: checkBlinkScroll 1s ease-in-out forwards;
}

@keyframes led-blink {
    0%, 100% { opacity: 1; scale: 1; }
    50% { opacity: 0.4; scale: 0.9; }
}
.animate-led {
    animation: led-blink 1.5s ease-in-out infinite;
}

/* --- Fonts --- */
@font-face { font-family: 'Kanit'; src: url('../fonts/kanit-v17-latin_thai-300.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Kanit'; src: url('../fonts/kanit-v17-latin_thai-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Kanit'; src: url('../fonts/kanit-v17-latin_thai-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Kanit'; src: url('../fonts/kanit-v17-latin_thai-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Kanit'; src: url('../fonts/kanit-v17-latin_thai-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Sarabun'; src: url('../fonts/sarabun-v17-latin_thai-300.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Sarabun'; src: url('../fonts/sarabun-v17-latin_thai-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Sarabun'; src: url('../fonts/sarabun-v17-latin_thai-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Sarabun'; src: url('../fonts/sarabun-v17-latin_thai-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }