﻿/* ========================================
   KJA Ashadi & Rekan - Custom Styles
   ======================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #374151;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    line-height: 1.3;
    color: #1E3A5F;
}

/* Navbar Styles */
.nav-link {
    padding: 0.5rem 1rem;
    color: #374151;
    font-weight: 500;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #C41E3A;
    background: #fef2f2;
}

/* Language Toggle */
.lang-btn {
    padding: 0.25rem 0.5rem;
    color: #9ca3af;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.2s;
    border-radius: 0.25rem;
    cursor: pointer;
    background: transparent;
    border: none;
}

.lang-btn.active {
    color: #E8611A;
}

.lang-btn:hover {
    color: #E8611A;
}

/* Mobile Dropdown */
.mobile-submenu {
    overflow: hidden;
    transition: all 0.3s;
}

.mobile-dropdown button i {
    transition: transform 0.3s ease;
}

.mobile-dropdown.open button i {
    transform: rotate(180deg);
}

/* Animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.animate-fade-in {
    animation: fade-in 0.8s ease forwards;
}

.animate-slide-up {
    animation: slide-up 0.8s ease forwards;
}

.animate-marquee {
    animation: marquee 30s linear infinite;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #1E3A5F;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #334e68;
}

/* Selection Color */
::selection {
    background: #C41E3A;
    color: white;
}

/* Focus States */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #E8611A;
    box-shadow: 0 0 0 3px rgba(232, 97, 26, 0.1);
}

/* Page Header (for inner pages) */
.page-header {
    position: relative;
    padding: 5rem 0;
    overflow: hidden;
    background-image: url('../images/page-header-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    background: linear-gradient(135deg, rgba(21, 44, 74, 0.7) 0%, rgba(196, 30, 58, 0.55) 55%, rgba(232, 97, 26, 0.45) 100%);
}

.page-header > * {
    position: relative;
    z-index: 2;
}

.page-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    opacity: 0.1;
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23ffffff" fill-opacity="0.15"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
}

@media (max-width: 768px) {
    .page-header {
        background-attachment: scroll;
    }
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.breadcrumb a {
    color: #d1d5db;
    transition: color 0.2s;
}

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

.breadcrumb .separator {
    color: #6b7280;
}

/* Team Card */
.team-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #f3f4f6;
    transition: all 0.3s;
}

.team-card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-0.5rem);
}

/* Client Logo */
.client-logo {
    filter: none;
    transition: all 0.3s;
}

.client-logo:hover {
    transform: scale(1.1);
}

/* Service Card */
.service-card {
    position: relative;
    overflow: hidden;
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #f3f4f6;
    transition: all 0.3s;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #C41E3A, #E8611A);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s;
}

.service-card:hover::before {
    transform: scaleX(1);
}

/* FAQ Accordion */
.faq-item {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s;
}

.faq-item .faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    cursor: pointer;
    background: white;
}

.faq-item .faq-question:hover {
    background: #f9fafb;
}

.faq-item .faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
}

.faq-item.active .faq-answer {
    max-height: 24rem;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-item .faq-question i {
    transition: transform 0.3s;
}

/* Testimonial */
.testimonial-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #f3f4f6;
    position: relative;
}

/* Stats */
.stat-item {
    text-align: center;
}

.stat-item .stat-number {
    font-size: 2.25rem;
    font-weight: 700;
    color: #E8611A;
    margin-bottom: 0.5rem;
}

.stat-item .stat-label {
    color: #4b5563;
    font-size: 0.875rem;
}

/* CTA Section */
.cta-section {
    position: relative;
    padding: 4rem 0;
    overflow: hidden;
    background: linear-gradient(to right, #C41E3A, #E8611A);
}

/* Animation Delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .page-header {
        padding: 3rem 0;
    }
    
    .animate-marquee {
        animation-duration: 20s;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-marquee {
        animation: none;
    }
}

/* Footer Title */
.footer-title {
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 2rem;
    height: 2px;
    background: linear-gradient(to right, #E8611A, #C41E3A);
    border-radius: 2px;
}

/* Footer Styles */
.footer-link {
    position: relative;
    transition: all 0.2s;
}

.footer-link:hover {
    color: #fb923c;
    padding-left: 0.25rem;
}

/* Navbar Scroll Effect */
#navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Navigation Dropdown Animations */
.group:hover .dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-panel {
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition: all 0.3s;
}

/* Marquee container needs pause on hover */
.animate-marquee:hover {
    animation-play-state: paused;
}

/* WhatsApp Invitation Popup */
.wa-popup-enter {
    animation: wa-popup-in 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes wa-popup-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wa-typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 2px 0;
}

.wa-typing span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #9ca3af;
    animation: wa-blink 1.2s infinite both;
}

.wa-typing span:nth-child(2) { animation-delay: 0.2s; }
.wa-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wa-blink {
    0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

.wa-greet-hide {
    opacity: 0;
    transform: translateY(6px);
}

.wa-greet-show {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.wa-badge-pulse {
    animation: wa-pulse 1.6s infinite;
}

@keyframes wa-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
    50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

.wa-float-active {
    transform: rotate(90deg);
}

.wa-float-link {
    transition: transform 0.3s ease;
}

/* Ensure popup never exceeds tiny/short screens */
#wa-popup .wa-popup-card {
    max-height: calc(100vh - 7.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

#wa-popup .wa-popup-card::-webkit-scrollbar {
    width: 4px;
}

#wa-popup .wa-popup-card::-webkit-scrollbar-track {
    background: transparent;
}

#wa-popup .wa-popup-card::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

@media (max-width: 420px) {
    #wa-popup {
        right: 0.75rem;
        width: calc(100vw - 1.5rem);
    }

    #wa-popup .wa-popup-card {
        max-height: calc(100vh - 6.5rem);
    }
}