/* General Variables & Reset */
:root {
    --primary-color-light: #6a82fb;
    --secondary-color-light: #fc5c7d;
    --background-light: #f4f7f6;
    --card-bg-light: #ffffff;
    --text-color-light: #333;
    --header-text-light: #111;
    --nav-bg-light: rgba(255, 255, 255, 0.85);

    --primary-color-dark: #7289da;
    --secondary-color-dark: #f9a8d4;
    --background-dark: #121212;
    --card-bg-dark: #1e1e1e;
    --text-color-dark: #e0e0e0;
    --header-text-dark: #ffffff;
    --nav-bg-dark: rgba(30, 30, 30, 0.85);

    --font-family: 'Poppins', sans-serif;
    --shadow: 0 4px 15px rgba(0,0,0,0.05);
    --shadow-hover: 0 8px 25px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-family); transition: background-color 0.3s, color 0.3s; }
body.light-mode { background-color: var(--background-light); color: var(--text-color-light); }
body.dark-mode { background-color: var(--background-dark); color: var(--text-color-dark); }

/* Navigation */
nav { position: fixed; width: 100%; top: 0; left: 0; padding: 15px 5%; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 1000; border-bottom: 1px solid transparent; }
body.light-mode nav { background-color: var(--nav-bg-light); border-bottom-color: #eee; }
body.dark-mode nav { background-color: var(--nav-bg-dark); border-bottom-color: #333; }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; }
.logo img { height: 40px; margin-right: 10px; }
.logo h1 { font-size: 1.5rem; }
body.dark-mode .logo img { filter: invert(1); }

.nav-menu .nav-link { margin: 0 15px; text-decoration: none; font-weight: 600; position: relative; transition: color 0.3s; }
body.light-mode .nav-link { color: var(--text-color-light); }
body.dark-mode .nav-link { color: var(--text-color-dark); }
.nav-link.active { color: var(--primary-color-light); }
body.dark-mode .nav-link.active { color: var(--primary-color-dark); }
.nav-link::after { content: ''; position: absolute; width: 0; height: 2px; bottom: -5px; left: 50%; transform: translateX(-50%); background: linear-gradient(90deg, var(--primary-color-light), var(--secondary-color-light)); transition: width 0.3s; }
body.dark-mode .nav-link::after { background: linear-gradient(90deg, var(--primary-color-dark), var(--secondary-color-dark)); }
.nav-link.active::after, .nav-link:hover::after { width: 100%; }

.nav-controls { display: flex; align-items: center; }
.theme-switcher { width: 50px; height: 25px; background-color: #ccc; border-radius: 25px; cursor: pointer; position: relative; margin-right: 15px; }
body.dark-mode .theme-switcher { background-color: #444; }
.theme-switcher .slider { position: absolute; width: 21px; height: 21px; background-color: white; border-radius: 50%; top: 2px; left: 2px; transition: transform 0.3s; }
body.dark-mode .theme-switcher .slider { transform: translateX(25px); }
#language-selector { background: transparent; border: 1px solid #ccc; border-radius: 5px; padding: 5px; font-family: var(--font-family); cursor: pointer; }
body.light-mode #language-selector { color: var(--text-color-light); }
body.dark-mode #language-selector { color: var(--text-color-dark); border-color: #555; }

/* Main Content Layout */
main { padding-top: 120px; }
.content-page { padding-bottom: 40px; }
.hero { position: relative; height: 80vh; display: flex; align-items: center; justify-content: center; text-align: center; color: white; overflow: hidden; margin-top: -120px; }
.hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, var(--primary-color-light), var(--secondary-color-light)); z-index: -1; clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%); }
body.dark-mode .hero-bg { background: linear-gradient(135deg, var(--primary-color-dark), var(--secondary-color-dark)); }
.hero-content h2 { font-size: 3.5rem; font-weight: 700; }
.hero-content p { font-size: 1.2rem; margin: 10px 0 30px; }
.cta-button { padding: 15px 30px; background: white; color: var(--primary-color-light); text-decoration: none; font-weight: 600; border-radius: 50px; transition: transform 0.3s, box-shadow 0.3s; }
.cta-button:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }

/* Generic Content Sections */
.content-section { padding: 60px 5%; max-width: 1000px; margin: 0 auto; text-align: center; }
.content-section > h2, .content-section > h3 { font-size: 2.5rem; margin-bottom: 20px; position: relative; }
.content-section > h2::after, .content-section > h3::after { content: ''; position: absolute; width: 80px; height: 4px; bottom: -10px; left: 50%; transform: translateX(-50%); background: linear-gradient(90deg, var(--primary-color-light), var(--secondary-color-light)); }
body.dark-mode .content-section > h2::after, body.dark-mode .content-section > h3::after { background: linear-gradient(90deg, var(--primary-color-dark), var(--secondary-color-dark)); }
.section-subtitle { margin-bottom: 40px; font-size: 1.1rem; max-width: 600px; margin-left: auto; margin-right: auto; line-height: 1.6; }
body.light-mode .section-subtitle { color: #666; }
body.dark-mode .section-subtitle { color: #aaa; }


/* About Section Cards */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; text-align: center; margin-top: 40px; }
.about-card { padding: 30px 20px; border-radius: 10px; transition: transform 0.3s, box-shadow 0.3s; }
body.light-mode .about-card { background-color: var(--card-bg-light); box-shadow: var(--shadow); }
body.dark-mode .about-card { background-color: var(--card-bg-dark); border: 1px solid #333; }
.about-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.about-card .fa, .about-card .fa-solid, .about-card .fa-brands { font-size: 2.5rem; margin-bottom: 15px; color: var(--primary-color-light); }
body.dark-mode .about-card .fa, body.dark-mode .about-card .fa-solid, body.dark-mode .about-card .fa-brands { color: var(--primary-color-dark); }
.about-card h4 { margin-bottom: 10px; font-size: 1.2rem; }

/* Code Card */
.code-card { border-radius: 10px; padding: 20px; margin-bottom: 20px; text-align: left; position: relative; transition: all 0.3s; }
body.light-mode .code-card { background-color: var(--card-bg-light); box-shadow: var(--shadow); }
body.dark-mode .code-card { background-color: var(--card-bg-dark); border: 1px solid #333; }
.code-card h4 { margin-bottom: 15px; }
.code-card pre { background: #eef; padding: 15px; border-radius: 5px; white-space: pre-wrap; word-break: break-all; color: #333; }
body.dark-mode .code-card pre { background-color: #2a2a2a; color: #eee; }
.copy-btn { position: absolute; top: 20px; right: 20px; background: var(--primary-color-light); color: white; border: none; padding: 8px 12px; border-radius: 5px; cursor: pointer; transition: background-color 0.3s; display: flex; align-items: center; gap: 5px; }
body.dark-mode .copy-btn { background: var(--primary-color-dark); }
.copy-btn:hover { opacity: 0.8; }

/* Donate Page & Contact Section Styles */
.qris-section, .crypto-section { margin-top: 60px; }
.qris-card { max-width: 350px; margin: 20px auto; padding: 20px; border-radius: 15px; }
body.light-mode .qris-card { background-color: var(--card-bg-light); box-shadow: var(--shadow); }
body.dark-mode .qris-card { background-color: var(--card-bg-dark); border: 1px solid #333; }
.qris-card img { width: 100%; border-radius: 10px; }
.qris-details { margin-top: 15px; }
.qris-details h4 { font-size: 1.2rem; }
.qris-details p { font-size: 0.9rem; margin-bottom: 10px; }
.qris-scan-me { display: inline-block; padding: 5px 10px; border-radius: 5px; font-size: 0.8rem; font-weight: 600; }
body.light-mode .qris-scan-me { background: #e9e9e9; }
body.dark-mode .qris-scan-me { background: #333; }

.donate-grid, .contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.donate-card, .contact-card { padding: 20px; border-radius: 10px; transition: transform 0.3s, box-shadow 0.3s; text-decoration: none; }
body.light-mode .donate-card, body.light-mode .contact-card { background-color: var(--card-bg-light); box-shadow: var(--shadow); color: inherit; }
body.dark-mode .donate-card, body.dark-mode .contact-card { background-color: var(--card-bg-dark); border: 1px solid #333; color: inherit; }
.donate-card:hover, .contact-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.donate-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.donate-card-header .fab, .donate-card-header .fa-solid { font-size: 2rem; color: var(--primary-color-light); }
body.dark-mode .donate-card-header .fab, body.dark-mode .donate-card-header .fa-solid { color: var(--primary-color-dark); }
.donate-card h4 { font-size: 1.2rem; }
.donate-card .address { font-family: 'Courier New', Courier, monospace; word-break: break-all; margin-bottom: 15px; background: #f0f0f0; padding: 10px; border-radius: 5px; font-size: 0.9rem; }
body.dark-mode .donate-card .address { background: #2a2a2a; }
.contact-card .fa, .contact-card .fab, .contact-card .fa-solid { font-size: 2.5rem; margin-bottom: 15px; }
.contact-card h4 { font-size: 1.3rem; }

/* API Page Styles */
.api-page { padding: 100px 5% 40px; }
.api-main-title { text-align: center; font-size: 2.8rem; margin-bottom: 40px; }
.api-container { display: flex; gap: 30px; }
.api-sidebar { width: 25%; position: sticky; top: 100px; height: calc(100vh - 120px); }
.api-sidebar h3 { text-align: left; margin-bottom: 20px; font-size: 1.8rem; }
.api-sidebar h3::after { display: none; }
#api-endpoint-list { list-style: none; }
#api-endpoint-list li { padding: 12px 15px; margin-bottom: 8px; border-radius: 5px; cursor: pointer; font-weight: 500; transition: background-color 0.3s, color 0.3s; text-align: left; }
body.light-mode #api-endpoint-list li:hover { background-color: #e9e9e9; }
body.dark-mode #api-endpoint-list li:hover { background-color: #2a2a2a; }
#api-endpoint-list li.active { color: white; background: linear-gradient(90deg, var(--primary-color-light), var(--secondary-color-light)); }
body.dark-mode #api-endpoint-list li.active { background: linear-gradient(90deg, var(--primary-color-dark), var(--secondary-color-dark)); }
.api-content { width: 75%; text-align: left; }
#api-details .code-card { margin-top: 20px; }
#api-details h4 { font-size: 1.5rem; margin-top: 30px; margin-bottom: 15px; border-left: 4px solid var(--primary-color-light); padding-left: 10px; }
body.dark-mode #api-details h4 { border-left-color: var(--primary-color-dark); }

/* Footer */
footer { text-align: center; padding: 20px; margin-top: 40px; border-top: 1px solid #eee; }
body.dark-mode footer { border-top-color: #333; }

/* Responsive */
@media (max-width: 992px) {
    .api-container { flex-direction: column; }
    .api-sidebar { position: static; width: 100%; height: auto; margin-bottom: 30px; }
    .api-content { width: 100%; }
}
@media (max-width: 768px) {
    .nav-container { flex-direction: column; }
    .nav-menu { margin: 15px 0; }
    .hero-content h2 { font-size: 2.5rem; }
}

.usage-card p {
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.usage-card pre {
    margin-top: 5px;
    margin-bottom: 15px;
}

#api-details p strong {
    font-weight: 600;
    color: var(--primary-color-light);
}

body.dark-mode #api-details p strong {
    color: var(--primary-color-dark);
}

.language-bash {
    color: #e0e0e0 !important;
}
