/* ========================================================
   PRODUK CSS (Full Fixed & Synchronized)
   ======================================================== */

/* 1. ROOT VARIABLES */
:root {
    --cyan:       #06b6d4;
    --gold:       #facc15;
    --bg-body:    #ffffff;
    --text-main:  #1f2937;
    --card-bg:    #ffffff;
    --review-bg:  #fafafa;
    --border:     #e5e7eb;
    --gray:       #9ca3af;
    --input-bg:   #ffffff;
}

[data-theme='dark'] {
    --bg-body:    #121212;
    --text-main:  #ffffff;
    --card-bg:    #1e1e1e;
    --review-bg:  #1a1a1a;
    --border:     #333333;
    --gray:       #d1d5db;
    --input-bg:   #2a2a2a;
}

/* 2. LAYOUT & GENERAL */
html {
    background-color: var(--bg-body);
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
    font-family: 'Poppins', sans-serif;
    margin: 0;
    min-height: 100vh;
}

#rating { display: none; scroll-margin-top: 90px; }
#rating.show { display: block; }

/* 3. PRODUCT CARD */
.product-card {
    position: relative; 
    overflow: hidden; 
    z-index: 1;
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 25px; 
    padding: 25px; 
    margin-bottom: 25px;
    transition: 0.4s; 
    background-color: var(--card-bg);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.15), 0 0 35px rgba(139, 92, 246, 0.1);
}

.product-card:hover {
    transform: translateY(-10px);
    border-color: var(--cyan);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.5), 0 0 60px rgba(139, 92, 246, 0.3);
}

.product-card::before {
    content: ''; 
    position: absolute; 
    top: 0; 
    left: -150%; 
    width: 80%; 
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transform: skewX(-25deg); 
    animation: shine 4s linear infinite; 
    pointer-events: none;
}

.badge { 
    display: inline-block; 
    background: var(--cyan); 
    color: #fff; 
    padding: 5px 10px; 
    border-radius: 8px; 
    font-size: 12px; 
    margin-bottom: 15px; 
}

.product-name { 
    font-size: 30px; 
    font-weight: 700; 
    color: var(--text-main); 
}

.price { 
    font-size: 50px; 
    font-weight: bold; 
    background: linear-gradient(90deg, #8b5cf6, #06b6d4); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
    color: transparent; 
}

.features { margin: 20px 0; color: var(--text-main); }
.features li { margin-bottom: 10px; }

/* 4. RATING & REVIEW SECTION */
.rating-section { max-width: 500px; margin: 30px auto; padding: 0 15px; }

.rating-box {
    padding: 25px; 
    border-radius: 20px;
    border: 1px solid var(--border); 
    background: var(--card-bg);
    display: flex; 
    flex-direction: column; 
    gap: 12px;
}

/* Form element scoped khusus agar tidak mengacaukan elemen luar */
.rating-box input, 
.rating-box select, 
.rating-box textarea,
.product-card select {
    width: 100%; 
    padding: 12px;
    border: 1px solid var(--border); 
    border-radius: 12px;
    font-size: 14px; 
    box-sizing: border-box;
    background-color: var(--input-bg); 
    color: var(--text-main);
}

.stars { display: flex; justify-content: center; gap: 5px; font-size: 30px; cursor: pointer; margin: 10px 0; }
.stars span { opacity: 0.4; transition: 0.3s; }
.stars span.active { opacity: 1; }

.btn-submit {
    width: 100%; 
    padding: 14px; 
    background: var(--cyan); 
    color: #fff;
    border: none; 
    border-radius: 12px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: 0.3s;
}
.btn-submit:hover { opacity: 0.9; }

.review-item {
    margin-top: 20px; 
    padding: 20px; 
    border-radius: 20px;
    border: 1px solid var(--border); 
    background: var(--review-bg); 
    color: var(--text-main);
}

.rating-summary-box {
    display: flex; 
    flex-direction: row;
    align-items: center; 
    justify-content: center;
    gap: 25px; 
    padding: 20px;
    width: 100%; 
    max-width: 470px;
    margin: 20px auto; 
    background: var(--card-bg);
    border: 1px solid var(--border); 
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

#avgRating { font-size: 40px; font-weight: 800; color: #facc15; }
.rating-summary-box small { color: var(--gray); }

/* 5. SOCIAL & SIDEBAR RATING */
.social-section { text-align: center; margin: 50px 0; }
.social-section h3 { margin-bottom: 20px; font-size: 24px; font-weight: 700; }
.social-links { display: flex; justify-content: center; }
.discord-logo { width: 45px; height: 45px; }

.sidebar-rating { 
    margin: auto 20px 20px 20px; 
    padding: 15px; 
    border: 1px solid var(--border); 
    border-radius: 15px; 
    text-align: center; 
}
.sidebar-rating h3 { margin: 0 0 10px; color: var(--gold); }
.sidebar-rating p { margin: 0; font-size: 24px; font-weight: 700; color: var(--text-main); }
.sidebar-rating small { color: var(--gray); }

@keyframes shine { 
    0%   { left: -150%; } 
    100% { left: 200%; } 
}

/* 6. DARK MODE SPECIFIC ADJUSTMENTS & OVERRIDES */
[data-theme='dark'] .sidebar {
    background-color: #000000;
    border-color: #333333;
}

[data-theme='dark'] .sidebar a {
    color: #ffffff;
    border-bottom-color: #333333;
}

[data-theme='dark'] .sidebar a:hover {
    background-color: #1a1a1a;
}

[data-theme='dark'] .sidebar-header {
    background: none;
    color: #ffffff;
    border-bottom-color: #333333;
}

/* Proteksi Kunci Warna Produk & Rating di Dark Mode (Cegah Flicker Putih) */
[data-theme='dark'] .product-card,
[data-theme='dark'] .rating-summary-box,
[data-theme='dark'] .rating-box,
[data-theme='dark'] .review-item {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
}

/* Perbaikan Kontras Tombol (Menjaga Teks Tetap Kelihatan) */
.wa-btn, 
.btn {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

[data-theme='dark'] .wa-btn,
[data-theme='dark'] .btn {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* 7. CUSTOM POP-UP ALERT MODAL */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-alert-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-alert-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    transform: scale(0.85);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-alert-overlay.active .custom-alert-box {
    transform: scale(1);
}

.custom-alert-icon {
    width: 55px;
    height: 55px;
    background: rgba(6, 182, 212, 0.15);
    color: var(--cyan);
    font-size: 26px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px auto;
}

.custom-alert-box h3 {
    color: var(--text-main);
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
}

.custom-alert-box p {
    color: var(--gray);
    font-size: 13px;
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.custom-alert-box button {
    background: var(--cyan);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease, transform 0.1s ease;
}

.custom-alert-box button:active {
    transform: scale(0.98);
}
