/* Google Font loaded via <link> in HTML head for better performance */

html {
    scroll-behavior: smooth;
}

* {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

.hero-video {
    width: 100%;
    height: 100vh;
    object-fit: cover;
    object-position: center center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    opacity: 1;
}

/* Poster / fallback background saat video belum siap */
#home {
    background: url('banner1.webp') center center / cover no-repeat;
    /* Fallback jika webp gagal */
    background-color: #111;
}

/* ── Tablet (≤ 768px) ── */
@media (max-width: 768px) {
    #home {
        background-position: center 30%;
        /* Kompensasi address bar mobile browser */
        min-height: 100vh;
        min-height: 100svh;
    }
    .hero-video {
        height: 100vh;
        height: 100svh;
        object-position: center 30%;
    }
}

/* ── Mobile (≤ 640px) ── */
@media (max-width: 640px) {
    #home {
        background-position: center 25%;
        min-height: 100svh;
    }
    .hero-video {
        height: 100svh;
        object-position: center 25%;
    }
}

/* ── Mobile kecil (≤ 480px) ── */
@media (max-width: 480px) {
    #home {
        background-position: center 20%;
    }
    .hero-video {
        object-position: center 20%;
    }
}

/* ── Mobile sangat kecil (≤ 370px) ── */
@media (max-width: 370px) {
    #home {
        background-position: center 15%;
    }
    .hero-video {
        object-position: center 15%;
    }
}

.nav-scrolled {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

/* Mobile Menu Overlay */
.mobile-menu::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.mobile-menu.active::before {
    opacity: 1;
    pointer-events: auto;
}

.model-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.model-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.gradient-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.7));
}

.animate-fade-in {
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Typography Optimization */
@media (max-width: 640px) {
    h1 {
        font-size: 1.875rem; /* 30px */
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }
    
    p {
        font-size: 0.95rem;
    }
}

/* Extra small phones (< 480px) */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem; /* 24px */
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1rem;
    }
    
    p {
        font-size: 0.875rem;
    }
}

/* Very small phones (< 370px) */
@media (max-width: 370px) {
    h1 {
        font-size: 1.25rem;
        line-height: 1.15;
    }
    
    h2 {
        font-size: 1.125rem;
    }
}

/* Floating Contact Buttons */
.floating-contact {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    left: 30px;
    bottom: 30px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
    transform: translateY(10px);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

.back-to-top i {
    font-size: 18px;
}

.contact-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.contact-btn:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.contact-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    filter: blur(10px);
    opacity: 0.5;
    z-index: -1;
}

.whatsapp-btn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.phone-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.contact-btn i {
    font-size: 26px;
    color: white;
}

.contact-tooltip {
    position: absolute;
    right: 75px;
    background: white;
    color: #333;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.contact-btn:hover .contact-tooltip {
    opacity: 1;
}

.pulse-ring {
    position: absolute;
    border: 3px solid;
    border-radius: 50%;
    width: 100%;
    height: 100%;
    animation: pulse 2s ease-out infinite;
}

.whatsapp-btn .pulse-ring {
    border-color: #25D366;
}

.phone-btn .pulse-ring {
    border-color: #667eea;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .floating-contact {
        right: 12px;
        bottom: 80px;
        gap: 10px;
    }
    .contact-btn {
        width: 44px;
        height: 44px;
    }
    .contact-btn i {
        font-size: 18px;
    }
    .contact-tooltip {
        display: none;
    }
}

@media (max-width: 480px) {
    .floating-contact {
        right: 8px;
        bottom: 60px;
        gap: 8px;
    }
    .contact-btn {
        width: 40px;
        height: 40px;
    }
    .contact-btn i {
        font-size: 16px;
    }
}

/* Mobile Navbar Optimization */
@media (max-width: 768px) {
    #navbar {
        padding: 0;
    }
    
    .mobile-menu {
        width: 100vw;
        max-width: 280px;
        height: 100vh;
        overflow-y: auto;
        transform: translateX(-100%);
        top: 0;
        transition: transform 0.3s ease;
    }
    
    .mobile-menu.active {
        transform: translateX(0);
    }
    
    #mobile-menu-btn {
        padding: 8px;
    }
}

/* Extra small mobile optimization (< 400px width) */
@media (max-width: 400px) {
    .floating-contact {
        right: 6px;
        bottom: 50px;
        gap: 6px;
    }
    
    .contact-btn {
        width: 36px;
        height: 36px;
    }
    
    .contact-btn i {
        font-size: 14px;
    }
}

/* Hero button optimization for small screens */
@media (max-width: 400px) {
    #home a {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}
.lang-btn {
    transition: all 0.3s ease;
}

.lang-btn.active {
    background: white;
    color: black;
}

.lang-btn:not(.active) {
    background: transparent;
    color: white;
    border: 1px solid white;
}

.lang-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Testimonial Carousel */
#testimonial-carousel {
    display: flex;
}

.testimonial-slide {
    flex-shrink: 0;
    position: relative;
}

@media (max-width: 768px) {
    .testimonial-slide {
        min-width: 100% !important;
    }
}

@media (min-width: 769px) {
    .testimonial-slide {
        min-width: calc(33.333% - 8px) !important;
    }
}

/* Image Container with Aspect Ratio Fix */
.testimonial-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background-color: #000;
}

.testimonial-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.testimonial-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 12px 16px;
}

@media (max-width: 480px) {
    .testimonial-image-container {
        aspect-ratio: 4 / 5;
    }
    
    .testimonial-overlay {
        padding: 10px 10px;
    }
}

@media (max-width: 640px) {
    .testimonial-image-container {
        aspect-ratio: 4 / 5;
    }
    
    .testimonial-overlay {
        padding: 12px 12px;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .testimonial-image-container {
        aspect-ratio: 3 / 4;
    }
    
    .testimonial-overlay {
        padding: 16px;
    }
}

@media (min-width: 769px) {
    .testimonial-image-container {
        aspect-ratio: 3 / 4;
    }
    
    .testimonial-overlay {
        padding: 24px;
    }
}

/* =============================================
   BENTO GRID – Serah Terima Pelanggan
   ============================================= */

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 230px;
    gap: 10px;
}

/* --- Desktop placement (≥ 1024 px) --- */
.bento-1  { grid-column: 1 / 3; grid-row: 1 / 3; } /* 2×2 hero */
.bento-2  { grid-column: 3 / 4; grid-row: 1 / 2; }
.bento-3  { grid-column: 4 / 5; grid-row: 1 / 2; }
.bento-4  { grid-column: 3 / 5; grid-row: 2 / 3; } /* wide 2×1 */
.bento-5  { grid-column: 1 / 2; grid-row: 3 / 4; }
.bento-6  { grid-column: 2 / 4; grid-row: 3 / 4; } /* wide 2×1 */
.bento-7  { grid-column: 4 / 5; grid-row: 3 / 5; } /* tall 1×2 */
.bento-8  { grid-column: 1 / 3; grid-row: 4 / 5; } /* wide 2×1 */
.bento-9  { grid-column: 3 / 4; grid-row: 4 / 5; }
.bento-10 { grid-column: 1 / 3; grid-row: 5 / 6; } /* wide 2×1 */
.bento-11 { grid-column: 3 / 5; grid-row: 5 / 6; } /* wide 2×1 */

/* --- Tablet (641 px – 1023 px): 3 cols --- */
@media (min-width: 641px) and (max-width: 1023px) {
    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 200px;
    }
    .bento-1  { grid-column: 1 / 3; grid-row: 1 / 3; }
    .bento-2  { grid-column: 3 / 4; grid-row: 1 / 2; }
    .bento-3  { grid-column: 3 / 4; grid-row: 2 / 3; }
    .bento-4  { grid-column: 1 / 2; grid-row: 3 / 4; }
    .bento-5  { grid-column: 2 / 4; grid-row: 3 / 4; }
    .bento-6  { grid-column: 1 / 3; grid-row: 4 / 5; }
    .bento-7  { grid-column: 3 / 4; grid-row: 4 / 6; }
    .bento-8  { grid-column: 1 / 2; grid-row: 5 / 6; }
    .bento-9  { grid-column: 2 / 3; grid-row: 5 / 6; }
    .bento-10 { grid-column: 1 / 3; grid-row: 6 / 7; }
    .bento-11 { grid-column: 3 / 4; grid-row: 6 / 7; }
}

/* --- Mobile (≤ 640 px): 2 cols, simple flow --- */
@media (max-width: 640px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 160px;
        gap: 6px;
    }
    /* Reset all explicit placements */
    .bento-1, .bento-2, .bento-3, .bento-4, .bento-5,
    .bento-6, .bento-7, .bento-8, .bento-9, .bento-10,
    .bento-11 {
        grid-column: auto;
        grid-row: auto;
    }
    /* Keep first photo as a wide hero on mobile */
    .bento-1 { grid-column: 1 / 3; grid-row: auto; height: 200px; }
}

/* --- Shared item styles --- */
.bento-item {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: #111;
    cursor: pointer;
}

.bento-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bento-item:hover img {
    transform: scale(1.07);
}

/* Dark gradient overlay, revealed on hover */
.bento-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.15) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    display: flex;
    align-items: flex-end;
    padding: 18px 20px;
}

.bento-item:hover .bento-overlay {
    opacity: 1;
}

.bento-label {
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    transform: translateY(6px);
    transition: transform 0.35s ease;
}

.bento-item:hover .bento-label {
    transform: translateY(0);
}

/* =============================================
   ANIMATION STATES – For JS-driven animations
   ============================================= */

.fade-in-pending {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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