/* --- Global Styles & Variables --- */
:root {
    --primary-color: #FF6B00;
    --primary-color-hover: #E66000;
    --brand-secondary: #FF8E40;
    --background-color: #f8f9fa;
    --text-color: #343a40;
    --heading-color: #212529;
    --divider-color: #dee2e6;
    --card-background: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --success-text: #16A34A;
    --error-text: #DC2626;
    --font-family: 'Poppins', sans-serif;
}

body.dark-mode {
    --background-color: #121212;
    --text-color: #e0e0e0;
    --heading-color: #ffffff;
    --divider-color: #333333;
    --card-background: #1e1e1e;
    --shadow-color: rgba(0, 0, 0, 0.4);
}

/* --- Reset & Pengaturan Dasar --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.7;
    transition: background-color 0.3s, color 0.3s;
}
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }

/* --- Typography --- */
h1, h2, h3 { color: var(--heading-color); margin-bottom: 1rem; font-weight: 700; line-height: 1.3; }
h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.5rem; }
h4 {
    font-size: 1.2rem;
    text-align: left;
}
p {
    font-size: 1.2rem;
    margin-bottom: .5rem;
    text-align: left;
}
span {
    font-weight: bold;
    color: var(--primary-color);
}
ul {
    font-size: 1.2rem;
    text-align: left;
    margin-left:3rem ;
}

#hero-con { padding-top: 50px;}

.content { color: #000;}
body.dark-mode .content { color: #fff;}

.footer-text {
    text-align: center;
}

/* --- Header & Logo --- */
.main-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.header-logo .logo-icon {
    stroke: var(--primary-color);
    width: 40px;
    height: 40px;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.header-logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(45deg, var(--primary-color), var(--brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.main-header.scrolled {
    background-color: var(--card-background);
    box-shadow: 0 2px 5px var(--shadow-color);
}

/* --- image --- */
.gallery-image {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

#tutorial {
    max-width: 50%;
    display: flex ;
    margin: auto;
    margin-bottom: 30px;
    margin-top: 30px;
}

/* --- Lightbox Overlay --- */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none; /* default hidden */
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
  animation: zoomIn 0.3s ease;
  transition: transform 0.2s ease;
  user-select: none; /* Mencegah seleksi teks pada gambar */
  cursor: grab;
}

.lightbox.active {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  color: white;
  cursor: pointer;
  background: none;
  border: none;
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}



/* --- Dark Mode Toggle --- */
#dark-mode-toggle {
    position: absolute;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    background: none;
    border: 1px solid var(--divider-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}
#dark-mode-toggle:hover { background-color: var(--divider-color); }
#dark-mode-toggle .moon { display: none; }
#dark-mode-toggle .sun { display: block; }
body.dark-mode #dark-mode-toggle .moon { display: block; }
body.dark-mode #dark-mode-toggle .sun { display: none; }

/* --- General Components --- */
.divider {
    height: 2px;
    width: 100%;
    background-color: var(--primary-color);
    margin: 3rem auto;
    border: none;
    border-radius: 2px;
}
.cta-button {
    display: inline-block;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--brand-secondary));
}
.cta-button:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}
.cta-button:active {
    transform: scale(0.98);
}
.cta-button:disabled {
    opacity: .6;
    cursor: not-allowed;
    filter: grayscale(40%);
}

/* --- Sections --- */
.hero-section { display: flex; align-items: center; gap: 3rem; margin-top: 75px; border-top: 1px solid var(--divider-color); }
.hero-image, .hero-content { flex: 1; }
.hero-image img { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 10px 20px var(--shadow-color); }
.content-section { text-align: center; }
.content-section h2 { margin-top: 2rem; }
.content-image-full img { width: 100%; height: auto; border-radius: 12px; margin-bottom: 1rem; box-shadow: 0 10px 20px var(--shadow-color); }

/* --- Form Section --- */
#form-section, .form-text { text-align: center;}
.form-section {
    background-color: var(--card-background);
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px var(--shadow-color);
}
#leadForm { max-width: 600px; margin: 2rem auto 0; text-align: left; }
#leadForm .cta-button {
    display: block;
    width: 100%;
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; color: var(--text-color); }
.form-group label span { color: var(--error-text); }
.form-group input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid var(--divider-color);
    border-radius: 8px;
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-family);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.15);
}
.hint { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
.error { color: var(--error-text); font-size: 13px; margin-top: 6px; display: none; }
.success-message, .error-message {
    display: none;
    text-align: center;
    font-weight: 500;
    margin-top: 1rem;
}
.error-message { color: var(--error-text); }
.success-message { color: var(--success-text); }

/* Gaya untuk pesan loading */
.loading-message {
    display: none;
    text-align: center;
    margin-top: 1rem;
    color: #37A345;
    font-size: 20px;
    font-style: italic;
    opacity: 0.8;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Gaya untuk konten di dalam modal (ID Success Modal) */
#successModal .modal-content {
    position: relative;
    background: var(--card-background);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    width: calc(100% - 40px);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Gaya untuk modal gambar */
#image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

/* Gaya untuk tombol tutup di Success Modal */
.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-color);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, color 0.2s;
}

.close-modal:hover {
    color: var(--primary-color);
}

.close-modal.visible {
    opacity: 0.7;
    visibility: visible;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

/* Gaya untuk konten Success Modal */
#successModal .icon {
    width: 60px; height: 60px;
    background-color: var(--success-text);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}
#successModal .icon svg { width: 32px; height: 32px; }
#successModal h2 {
    font-size: 27px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--heading-color);
}
#successModal p {
    font-size: 20px;
    text-align: center;
    color: var(--text-color);
    margin-bottom: 24px;
    line-height: 1.6;
}
#successModal .install-button {
    display: inline-block;
    padding: 12px 32px;
    font-size: 20px;
    font-weight: 700;
    color: white;
    background: linear-gradient(45deg, var(--primary-color), var(--brand-secondary));
    border-radius: 8px;
    text-decoration: none;
    transition: filter 0.2s ease, transform 0.2s ease;
}
#successModal .install-button:hover { filter: brightness(1.1); }
#successModal .install-button:active { transform: scale(0.98); }

/* Definisikan keyframe untuk animasi pantulan */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Terapkan animasi pada ikon saat modal sukses muncul */
#successModal.show .icon {
    animation: bounce 1s;
}

/* Gaya ikon tetap seperti yang sudah ada */
#successModal .icon {
    width: 60px;
    height: 60px;
    background-color: var(--success-text);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}


/* --- Video Section --- */
.video-section { text-align: center; }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; background: #000; border-radius: 12px; margin-bottom: 1.5rem; box-shadow: 0 10px 20px var(--shadow-color); }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* --- Footer & Animations --- */
.main-footer { text-align: center; padding: 2rem; margin-top: 2rem; border-top: 1px solid var(--divider-color); }
.fade-in-element { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.fade-in-element.is-visible { opacity: 1; transform: translateY(0); }

/* --- Responsive Design --- */
@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.5rem; }
    .hero-section { flex-direction: column; text-align: center; }
    .main-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .container { padding: 1rem; }
    .form-section { padding: 2rem 1.5rem; }
    #tutorial {
        max-width: 90%;
        display: flex;
        align-items: center;
        margin-bottom: 30px;
        margin-top: 30px;
    }
}