:root {
    --primary-red: #CE1226;
    --bg-cream: #F1E5D1;
    --soft-white: #FAF9F6;
    --text-dark: #2D2D2D;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--soft-white);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-content {
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Lingkaran Animasi */
.spinner {
    width: 120px;
    height: 120px;
    border: 5px solid var(--bg-cream);
    border-top: 5px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: -35px;
}

.loader-logo {
    width: 100px;
    animation: pulse 1.5s ease-in-out infinite;
}

.loader-text {
    font-size: 14px;
    color: var(--primary-red);
    font-weight: 600;
    letter-spacing: 1px;
    margin-top: 80px;
}


/* Keyframes Animasi */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Class untuk menghilangkan preloader via JS */
#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--soft-white);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    /* Mencegah scroll horizontal */
}


/* Navigasi */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    /* margin-bottom: 10vh; */
    /* background-color: transparent; */
    background-color: rgb(250 249 246);
    /* backdrop-filter: blur(0px); */
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: none;
    transition: all 0.4s ease;
}

/* Class ini akan aktif saat di scroll */
.navbar.scrolled {
    padding: 15px 5%;
    background-color: rgb(255 255 255 / 95%);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    /* Shadow muncul saat scroll */
}

/* Tambahkan sedikit margin-top pada elemen setelah navbar 
   agar konten tidak tertutup karena navbar sekarang 'fixed' */

.logo-img {
    height: 60px;
    /* Sedikit lebih kecil agar aman di layar kecil */
    width: auto;
}

/* Styling Teks di Samping Logo */
.logo-text {
    font-size: 14px;
    font-weight: 500;
    color: #555;
    padding: 4px 10px;
    border-radius: 6px;
    background-color: rgba(206, 18, 38, 0.05);
    /* Highlight tipis warna merah logo */
    border-left: 2px solid var(--primary-red);
    /* Aksen garis tipis di kiri */
    white-space: nowrap;
    /* Agar teks tidak turun ke bawah */
}

/* Penyesuaian khusus logo wrapper */
.logo {
    display: flex;
    align-items: center;
}

/* --- Penyesuaian Mobile (Sembunyikan teks di layar sangat kecil jika terlalu penuh) --- */
@media (max-width: 600px) {
    .logo-text {
        font-size: 11px;
        padding: 3px 6px;
        /* Opsional: display: none; jika ingin logo saja di HP super kecil */
    }
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 15px;
    transition: 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-red);
}

/* Tombol Auth */
.auth-buttons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.btn-login {
    text-decoration: none;
    color: var(--primary-red);
    font-weight: 700;
}

.btn-register {
    text-decoration: none;
    background-color: var(--primary-red);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 700;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(206, 18, 38, 0.2);
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(206, 18, 38, 0.3);
}

/* Styling Dropdown Desktop */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: block;
    /* Selalu block, tapi kontrol visibility via opacity */
    opacity: 0;
    visibility: hidden;
    position: absolute;
    background-color: #fff;
    min-width: 550px;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    padding: 20px;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    z-index: 1002;
    margin-top: 10px;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.dropdown-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Pastikan ada area 'jembatan' agar kursor tidak terputus saat pindah ke bawah */
.dropdown::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 20px;
    bottom: -20px;
    left: 0;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.dropdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: 10px;
    transition: 0.3s;
    text-align: left;
}

.dropdown-item:hover {
    background-color: var(--soft-white);
}

.item-icon {
    font-size: 24px;
    padding: 10px;
    border-radius: 12px;
    background: #f9f9f9;
}

.item-text {
    display: flex;
    flex-direction: column;
}

.item-title {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 14px;
}

.item-desc {
    font-size: 12px;
    color: #777;
    font-weight: 400;
}

/* Warna Icon (Sesuai gambar referensi Anda) */
.item-icon.red {
    background: rgba(206, 18, 38, 0.1);
}

.item-icon.purple {
    background: rgba(168, 85, 247, 0.1);
}

.item-icon.yellow {
    background: rgba(234, 179, 8, 0.1);
}

.item-icon.green {
    background: rgba(34, 197, 94, 0.1);
}

/* --- Penyesuaian Mobile (992px ke bawah) --- */
@media (max-width: 992px) {
    .logo-img {
        height: 44px;
        /* Sedikit lebih kecil agar aman di layar kecil */
        width: auto;
    }

    .dropdown-content {
        position: static;
        display: none;
        /* Default tertutup di mobile */
        min-width: 100%;
        box-shadow: none;
        background: transparent;
        transform: none;
        padding: 0;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    .dropdown-grid {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 10px 0;
    }

    /* Sesuai instruksi: Di HP hanya judul saja */
    .item-desc,
    .item-icon {
        display: none;
    }

    .dropdown-item {
        padding: 10px 20px;
        justify-content: center;
    }

    .item-title {
        font-size: 18px;
        /* Lebih besar di mobile */
        color: var(--text-dark);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: row;
    /* Default samping-sampingan */
    align-items: center;
    padding: 40px 8%;
    gap: 40px;
    min-height: calc(100vh - 80px);
}

.hero-content {
    flex: 1;
}




.badge {
    background-color: rgba(206, 18, 38, 0.1);
    color: var(--primary-red);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 20px;
}

.hero-content h1 {
    font-size: clamp(32px, 5vw, 64px);
    /* Font adaptif */
    line-height: 1.1;
    margin-bottom: 20px;
}

.highlight {
    color: var(--primary-red);
}

.hero-content p {
    font-size: 18px;
    color: #555;
    margin-bottom: 40px;
    max-width: 550px;
}

.hero-cta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    /* Tombol akan turun jika tidak muat */
}

.btn-primary {
    text-decoration: none;
    background-color: var(--primary-red);
    color: white;
    padding: 16px 35px;
    border-radius: 12px;
    font-weight: 700;
    transition: 0.3s;
}

.btn-secondary {
    text-decoration: none;
    border: 2px solid var(--primary-red);
    color: var(--primary-red);
    padding: 14px 35px;
    border-radius: 12px;
    font-weight: 700;
}

.btn-primary,
.btn-secondary {
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    flex: 1;
    /* Tombol akan melebar seimbang di mobile */
    min-width: 160px;
}

/* Visual Mockup */
.hero-image {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
}

.hero-image img {
    width: 100%;
    max-width: 400px;
    height: auto;
    z-index: 2;
}

.blob-bg {
    position: absolute;
    width: 120%;
    height: 120%;
    background-color: var(--bg-cream);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    z-index: 1;
    top: -10%;
    animation: blobMorph 10s infinite alternate;
}

@media (max-width: 992px) {

    /* Untuk Tablet: Sembunyikan Nav Links jika ingin menggunakan hamburger nantinya */
    .nav-links,
    .auth-buttons {
        display: none;
    }
}

@media (max-width: 768px) {

    /* Untuk HP: Tampilan menjadi tumpuk ke bawah */
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 20px;
    }

    .hero-image {
        order: -1;
        /* Gambar muncul duluan di mobile */
        margin-bottom: 20px;
    }

    .hero-content p {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-cta {
        justify-content: center;
    }

    .blob-bg {
        width: 100%;
        height: 100%;
    }
}

@keyframes blobMorph {
    from {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }

    to {
        border-radius: 60% 40% 30% 70% / 50% 60% 40% 60%;
    }
}

/* 1. Efek Smooth Scroll (Gulir Halus) */
html {
    scroll-behavior: smooth;
}

/* 2. Kustomisasi Scrollbar untuk Chrome, Safari, dan Edge */
::-webkit-scrollbar {
    width: 10px;
    /* Lebar scrollbar */
}

/* Bagian Latar Belakang Scrollbar */
::-webkit-scrollbar-track {
    background: var(--soft-white);
}

/* Bagian "Pegangan" Scrollbar (Thumb) */
::-webkit-scrollbar-thumb {
    background: #e5bfa5;
    /* Warna cream gelap agar tidak terlalu kontras saat diam */
    border-radius: 10px;
    border: 2px solid var(--soft-white);
    /* Memberi jarak agar terlihat melayang */
    transition: 0.3s;
}

/* Warna saat kursor menyentuh scrollbar */
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-red);
    /* Berubah menjadi merah Ceritera saat disentuh */
}

/* 3. Kustomisasi Scrollbar untuk Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #e5bfa5 var(--soft-white);
}

/* Tambahan: Animasi Fade-In saat halaman dibuka agar scroll terasa elegan */
body {
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Styling dasar Hamburger */
.hamburger {
    display: none;
    /* Sembunyikan di desktop */
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1100;
}

.hamburger span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: var(--primary-red);
    border-radius: 2px;
    transition: 0.3s;
}

.mobile-only {
    display: none;
}

/* --- Responsive Menu Mobile --- */
@media (max-width: 992px) {
    .hamburger {
        display: flex;
        /* Munculkan hamburger di tablet/HP */
    }

    .auth-buttons {
        display: none;
        /* Sembunyikan tombol auth asli di navbar */
    }

    .mobile-only {
        display: block;
        /* Munculkan tombol auth di dalam list menu */
        margin-top: 10px;
    }

    .nav-links {
        position: fixed;
        right: -100%;
        /* Sembunyi di kanan */
        top: 0;
        width: 100%;
        /* Full screen di mobile agar lebih fokus */
        height: 100vh;
        background-color: var(--bg-cream);
        /* Warna cream sesuai logo */
        display: flex;
        /* Memastikan tetap flex */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 25px;
        transition: 0.4s ease-in-out;
        z-index: 999;
        /* Di bawah hamburger tapi di atas konten lain */
    }

    .nav-links.active {
        right: 0;
        /* Muncul saat class 'active' ditambah oleh JS */
    }

    .hamburger {
        display: flex;
        z-index: 1001;
        /* Harus paling tinggi agar tombol 'X' bisa diklik */
        position: relative;
    }

    /* Penyesuaian Link di Mobile */
    .nav-links a {
        font-size: 20px;
        color: var(--text-dark);
    }

    /* Animasi Hamburger menjadi 'X' saat diklik */
    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

.btn-register-mobile {
    background-color: var(--primary-red);
    color: white !important;
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 700;
}

/* Container umum */
.container {
    padding: 80px 8%;
}

.container-template {
    padding: 40px 8%;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 36px;
    margin: 15px 0;
    color: var(--text-dark);
}

/* Template Page Specific */
.template-header {
    text-align: center;
    padding: 60px 0 30px;
}

.filter-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 25px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    background-color: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
}

.templates {
    background-color: var(--soft-white);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.template-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: 0.3s;
}

.template-card:hover {
    transform: translateY(-10px);
}

.template-img {
    position: relative;
    height: 350px;
    overflow: hidden;
}

.template-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.template-card:hover .template-img img {
    transform: scale(1.1);
}

/* Overlay saat Hover */
.template-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(206, 18, 38, 0.7);
    /* Merah Ceritera Transparan */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.3s;
}

.template-card:hover .template-overlay {
    opacity: 1;
}

.btn-view {
    text-decoration: none;
    background: white;
    color: var(--primary-red);
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
}

.template-info {
    padding: 20px;
    text-align: center;
}

.template-info h3 {
    font-size: 20px;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.template-info .category {
    font-size: 14px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Bagian Bawah Section */
.template-footer {
    text-align: center;
    margin-top: 50px;
}

.template-footer p {
    margin-bottom: 20px;
    color: #666;
}

.btn-all {
    text-decoration: none;
    color: var(--primary-red);
    font-weight: 700;
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 5px;
    transition: 0.3s;
}

.btn-all:hover {
    letter-spacing: 1px;
}

/* Responsive penyesuaian untuk HP */
@media (max-width: 768px) {
    .template-img {
        height: 280px;
    }
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 80px;
}

/* Animasi saat filter berubah */
.template-card {
    animation: fadeIn 0.5s ease forwards;
}

/* Search Bar Styles */
.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    padding: 0 8%;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.search-box input {
    width: 100%;
    padding: 15px 25px;
    padding-right: 50px;
    border: 2px solid var(--bg-cream);
    border-radius: 50px;
    font-family: inherit;
    font-size: 16px;
    outline: none;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.search-box input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 8px 20px rgba(206, 18, 38, 0.1);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-red);
    font-size: 18px;
    pointer-events: none;
}

/* Footer Styling */
.main-footer {
    background-color: var(--bg-cream);
    padding: 80px 0 0 0;
    color: var(--text-dark);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 50px;
}

.footer-logo {
    height: 45px;
    margin-bottom: 20px;
}

.footer-about p {
    font-size: 14px;
    color: #555;
    margin-bottom: 20px;
    max-width: 300px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    text-decoration: none;
    color: var(--primary-red);
    font-size: 14px;
    font-weight: 700;
    transition: 0.3s;
}

.social-links a:hover {
    opacity: 0.7;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 25px;
    font-weight: 800;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links ul li a {
    text-decoration: none;
    color: #555;
    font-size: 14px;
    transition: 0.3s;
}

.footer-links ul li a:hover {
    color: var(--primary-red);
    padding-left: 5px;
}

.footer-contact p {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
}

/* Copyright Area */
.footer-bottom {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 25px 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 13px;
    color: #888;
}

/* Footer Responsive */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-about p {
        margin: 0 auto 20px;
    }

    .social-links {
        justify-content: center;
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.7s ease-out;
    visibility: hidden;
}

/* Gaya saat elemen masuk ke viewport (ditambah via JS) */
.fade-in-up.appear {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* Efek stagger: berikan delay sedikit pada setiap kartu agar muncul bergantian */
.feature-card.fade-in-up:nth-child(1) {
    transition-delay: 0.1s;
}

.feature-card.fade-in-up:nth-child(2) {
    transition-delay: 0.2s;
}

.feature-card.fade-in-up:nth-child(3) {
    transition-delay: 0.3s;
}

.feature-card.fade-in-up:nth-child(4) {
    transition-delay: 0.1s;
}

/* Efek Fade In + Zoom Kecil */
.fade-in-zoom {
    opacity: 0;
    transform: scale(0.9) translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
}

.fade-in-zoom.appear {
    opacity: 1;
    transform: scale(1) translateY(0);
    visibility: visible;
}

/* Delay bergantian untuk grid template */
.template-card.fade-in-zoom:nth-child(1) {
    transition-delay: 0.1s;
}

.template-card.fade-in-zoom:nth-child(2) {
    transition-delay: 0.3s;
}

.template-card.fade-in-zoom:nth-child(3) {
    transition-delay: 0.5s;
}