/* =====================================================
   DIGITREV INFORMATIK - Custom CSS
   ===================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
}

/* Scroll Animations - Initial States */
.scroll-animate {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate[data-animation="fade-up"] {
    transform: translateY(60px);
}

.scroll-animate[data-animation="fade-down"] {
    transform: translateY(-60px);
}

.scroll-animate[data-animation="fade-left"] {
    transform: translateX(60px);
}

.scroll-animate[data-animation="fade-right"] {
    transform: translateX(-60px);
}

/* Prevent initial horizontal overflow on mobile (animated elements off-canvas) */
@media (max-width: 768px) {
    .scroll-animate[data-animation="fade-left"],
    .scroll-animate[data-animation="fade-right"] {
        transform: translateY(24px);
    }

    /* Keep hero floating cards visible without causing horizontal overflow */
    .animate-float.absolute.-top-6.-left-6 {
        left: 0.5rem;
        top: 0.5rem;
    }

    .animate-float-delayed.absolute.-bottom-6.-right-6 {
        right: 0.5rem;
        bottom: 0.5rem;
    }
}

.scroll-animate[data-animation="fade-in"] {
    transform: scale(0.9);
}

.scroll-animate[data-animation="zoom-in"] {
    transform: scale(0.5);
}

/* Scroll Animations - Active States */
.scroll-animate.active {
    opacity: 1;
    transform: translate(0) scale(1);
}

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

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

.animate-float-delayed {
    animation: float 3s ease-in-out infinite 1.5s;
}

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

/* Counter Animation */
.counter {
    transition: all 0.5s ease;
}

/* Product Card Hover Effects */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-10px);
}

/* Service Card Hover */
.group:hover .group-hover\:bg-accent {
    background-color: var(--accent-color);
}

/* Line Clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

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

::-webkit-scrollbar-thumb {
    background: #153B58;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #18A1A6;
}

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

/* Pulse Animation for WhatsApp Button */
@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.animate-bounce::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse-ring 1.5s infinite;
    z-index: -1;
}

/* Filter Active State */
.filter-btn.active {
    background-color: #153B58 !important;
    color: white !important;
}

/* Nav hover color */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    background-color: transparent;
}

.nav-link:hover {
    color: #18A1A6 !important;
    background-color: rgba(24, 161, 166, 0.12);
}

.nav-link.active {
    color: #18A1A6 !important;
    background-color: rgba(24, 161, 166, 0.12);
    font-weight: 600;
}

/* Footer link underline color */
footer a:hover {
    text-decoration: underline;
    text-decoration-color: #18A1A6;
    text-underline-offset: 3px;
}

/* Responsive Typography */
@media (max-width: 768px) {
    .text-5xl {
        font-size: 2.5rem;
    }
    .text-4xl {
        font-size: 2rem;
    }
    .text-3xl {
        font-size: 1.75rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Gradient Text (si besoin) */
.gradient-text {
    background: linear-gradient(135deg, #153B58 0%, #18A1A6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Image Lazy Loading Placeholder */
.lazy-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* Form Focus States */
input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.2);
}

/* Hero Pattern */
.hero-pattern {
    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.05'%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");
}

/* Smooth transition for all interactive elements */
a, button, input, select, textarea {
    transition: all 0.3s ease;
}

/* Mobile Menu Animation */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

#mobile-menu.show {
    max-height: 500px;
}

/* Tooltip Style */
.tooltip {
    position: relative;
}

/* Global hover for accent buttons */
a.bg-accent:hover,
button.bg-accent:hover {
    background-color: #153B58 !important;
}

/* Reduce vertical spacing between sections */
.py-20 {
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
}

.py-16 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

.py-12 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: #0F172A;
    color: white;
    font-size: 0.75rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}
