/* 1. Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700&family=Inter:wght@400;500&display=swap');

/* 2. CSS Variables */
:root {
    --bg-color: #f0f2f5;
    --text-color: #1e293b;
    --primary-color: #5a55d7;
    --secondary-color: #ffda22;
    --card-bg-color: rgba(255, 255, 255, 0.6);
    --border-color: rgba(30, 41, 59, 0.1);
}

body.dark-mode {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --primary-color: #5a55d7;
    --secondary-color: #ffda22;
    --card-bg-color: rgba(30, 41, 59, 0.6);
    --border-color: rgba(226, 232, 240, 0.1);
}

/* 3. Reset & Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

h1,
h2,
h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
}

/* ===================================== */
/* == KOMPONEN UTAMA & HEADER PUBLIK == */
/* ===================================== */

/* --- Tombol & Link Global --- */
.cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: #ffffff;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    transition: transform 0.3s ease, background-color 0.3s;
}

.cta-button:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
}

.nav-button {
    background-color: var(--primary-color);
    color: #fff !important;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: background-color 0.3s ease;
}

.nav-button:hover {
    background-color: var(--secondary-color);
    color: #fff !important;
}

/* --- Header Desktop --- */
.desktop-header {
    position: sticky;
    top: 20px;
    z-index: 1000;
    padding: 0 5%;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    width: 100%;
    background: var(--card-bg-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: auto;
    display: block;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-item a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-item a:hover {
    color: var(--primary-color);
}

.nav-item span {
    display: flex;
    align-items: center;
    color: var(--text-color);
    opacity: 0.9;
    font-weight: 500;
}

/* --- Theme Switcher Desktop --- */
.theme-switcher {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-left: 1.5rem;
}

.theme-switcher input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4c4c4c;
    transition: .4s ease;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s ease;
    border-radius: 50%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black"><path d="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5L13.5,6L12,7.5L10.5,6L12,4.5M6,10.5L7.5,12L6,13.5L4.5,12L6,10.5M12,19.5L10.5,18L12,16.5L13.5,18L12,19.5M18,13.5L16.5,12L18,10.5L19.5,12L18,13.5M19.3,8.9L17.88,7.5L18.94,6.4L20.36,7.78L19.3,8.9M3.64,17.78L4.7,16.7L6.12,18.12L5.06,19.2L3.64,17.78M4.7,7.5L3.64,6.4L5.06,5.06L6.12,6.12L4.7,7.5M17.88,16.7L19.3,15.32L20.36,16.6L18.94,17.8L17.88,16.7Z" /></svg>');
    background-repeat: no-repeat;
    background-position: center;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(26px);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black"><path d="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22C17.5,22 22,17.5 22,12A10,10 0 0,0 12,2M12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20V4Z" /></svg>');
}

/* --- Navigasi Bawah Mobile --- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--card-bg-color);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--border-color);
    justify-content: space-around;
    padding: 8px 0;
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    text-decoration: none;
    flex-grow: 1;
    padding: 4px 0;
}

.mobile-nav-link .icon {
    font-size: 1.5rem;
    height: 28px;
    line-height: 28px;
}

.mobile-nav-link .text {
    font-size: 0.7rem;
}

.mobile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

#mobile-theme-toggle {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    cursor: pointer;
}

#mobile-theme-toggle .icon-moon {
    display: none;
}

#mobile-theme-toggle .icon-sun {
    display: block;
}

body.dark-mode #mobile-theme-toggle .icon-moon {
    display: block;
}

body.dark-mode #mobile-theme-toggle .icon-sun {
    display: none;
}

/* --- Logika Logo Adaptif --- */
.logo .logo-dark-theme,
body.dark-mode .logo .logo-light-theme {
    display: block;
}

.logo .logo-light-theme,
body.dark-mode .logo .logo-dark-theme {
    display: none;
}

.mobile-bottom-nav a:first-child .text {
    display: none;
}

.mobile-bottom-nav a:first-child .icon img {
    height: 24px;
    width: auto;
}

/* --- PERBAIKAN LOGIKA LOGO NAVBAR MOBILE --- */

/* Default (Light Mode): Tampilkan logo gelap, sembunyikan logo terang */
.mobile-bottom-nav .logo-dark-theme {
    display: block;
}

.mobile-bottom-nav .logo-light-theme {
    display: none;
}

/* Dark Mode: Balikkan logika di atas */
body.dark-mode .mobile-bottom-nav .logo-dark-theme {
    display: none;
}

body.dark-mode .mobile-bottom-nav .logo-light-theme {
    display: block;
}

/* --- Profil Dropdown & Notifikasi --- */
.profile-trigger,
.profile-trigger-mobile {
    position: relative;
}

.profile-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--secondary-color);
    object-fit: cover;
    cursor: pointer;
}

.profile-dropdown-container {
    position: fixed;
    z-index: 2000;
    top: 80px;
    right: 5%;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.profile-dropdown-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu {
    width: 240px;
    background: var(--card-bg-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.dropdown-header {
    padding: 1rem;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item {
    display: block;
    padding: 0.8rem 1rem;
    color: var(--text-color);
    text-decoration: none;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--secondary-color);
    color: #0f172a;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-color);
    padding: 0 4px;
}

/* ===================================== */
/* == KONTEN HALAMAN PUBLIK == */
/* ===================================== */

/* --- Section Umum (Hero, Jelajah Semesta, dll) --- */
#hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 90vh;
    padding: 0 5%;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem auto;
}

#jelajah-semesta {
    padding: 4rem 0;
}

.section-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.section-container h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.section-container>p {
    margin-bottom: 2.5rem;
    color: #aaa;
}

.page-header {
    text-align: center;
    padding: 4rem 1rem;
}

.page-header h1 {
    font-size: 3rem;
}

/* --- Modal Login & Form Umum --- */
.modal-container {
    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: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    padding: 2rem;
    border-radius: 16px;
    position: relative;
    width: 90%;
    max-width: 400px;
    background: var(--card-bg-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-color);
    cursor: pointer;
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.2rem;
    position: relative;
}

.form-group label {
    display: none;
}

.form-group.input-with-icon input {
    padding-left: 45px;
}

.input-with-icon .icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    opacity: 0.6;
    z-index: 3;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    opacity: 0.7;
    z-index: 3;
}

.forgot-password-link {
    display: block;
    text-align: right;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-decoration: none;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

#register-tab .form-group:has(input[type="file"]) label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 10px rgba(255, 218, 34, 0.3);
}

.form-group input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #1e293b inset !important;
    -webkit-text-fill-color: var(--text-color) !important;
}

body:not(.dark-mode) .form-group input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #e2e8f0 inset !important;
    -webkit-text-fill-color: #1e293b !important;
}

.form-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

body:not(.dark-mode) .form-group select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
}

.form-group select option {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.auth-view {
    display: none;
}

.auth-view.active {
    display: block;
}

#auth-choice {
    text-align: center;
}

.choice-button {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.choice-button:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.back-button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 1rem;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-link {
    flex: 1;
    padding: 0.8rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    font-size: 1rem;
    opacity: 0.6;
    border-bottom: 3px solid transparent;
}

.tab-link.active {
    opacity: 1;
    font-weight: bold;
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- Toast Notifications --- */
.toast {
    position: fixed;
    top: 90px;
    right: 20px;
    padding: 1rem 1.5rem;
    background-color: var(--primary-color);
    color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.5s ease-in-out;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background-color: #28a745;
}

.toast.error {
    background-color: #dc3545;
}

/* --- Kartu Transmisi --- */
.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 3rem;
}

.filter-btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.filter-btn.active {
    background-color: var(--secondary-color);
    color: #111;
    font-weight: bold;
    border-color: var(--secondary-color);
}

.transmisi-grid {
    display: grid;
    /* Gunakan 4 kolom di layar besar, dan biarkan otomatis di bawahnya */
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.transmisi-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 350px;
    background-color: #1a1a2e;
    /* Warna cadangan jika gambar gagal dimuat */
}

.transmisi-card:hover {
    transform: translateY(-10px);
}

.transmisi-container {
    max-width: 1200px;
    margin: 0 auto 4rem auto;
    padding: 0 2rem;
    /* TAMBAHKAN INI */
}

.card-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.transmisi-card:hover .card-thumbnail {
    transform: scale(1.1);
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content-glass {
    position: relative;
    z-index: 2;
    margin-top: auto;
    width: 100%;
    padding: 0.8rem 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(30px);
}

.card-category {
    display: inline-block;
    color: #ffffff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    margin-bottom: 0.5rem;
}

.category-log-naratif {
    background-color: #5a55d7;
}

.category-gema-puitis {
    background-color: #c7386f;
}

.category-anomali-sastra {
    background-color: #00a896;
}

.category-spektrum-gagasan {
    background-color: #8E2DE2;
}

.card-content-glass h3 {
    font-size: 1.2rem;
    line-height: 1.4;
    color: #ffffff;
    margin: 0.5rem 0 0 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #ccc;
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.card-author {
    font-weight: bold;
}

.card-rating {
    font-weight: bold;
    color: var(--secondary-color);
}

/* --- Footer --- */
.site-footer {
    background-color: #0c0c1e;
    color: #a0aec0;
    padding-top: 3rem;
    font-size: 0.9rem;
}

.footer-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
}

.footer-column h3 {
    font-family: 'Orbitron', sans-serif;
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-column .logo img {
    height: 35px;
    margin-bottom: 1rem;
}

.footer-column .tagline {
    max-width: 300px;
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column ul li {
    margin-bottom: 0.5rem;
}

.footer-column ul a {
    text-decoration: none;
    color: #a0aec0;
    transition: color 0.3s ease;
}

.footer-column ul a:hover {
    color: var(--secondary-color);
}

.footer-bottom-bar {
    text-align: center;
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-credit {
    color: var(--secondary-color) !important;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    text-shadow: 0 0 8px var(--secondary-color);
}

.footer-credit:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* --- Media Queries Responsif --- */
@media(max-width: 820px) {
    .desktop-header {
        display: none;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    body {
        padding-bottom: 70px;
    }

    .profile-dropdown-container {
        top: auto;
        bottom: 75px;
        right: 10px;
    }
}

@media (max-width: 768px) {
    .toast {
        width: 90%;
        max-width: 350px;
        top: 20px;
        left: 50%;
        right: auto;
        transform: translate(-50%, -150%);
    }

    .toast.show {
        transform: translate(-50%, 0);
    }

    #hero {
        min-height: 70vh;
    }

    .hero-content h1 {
        font-size: 2.2rem;
        line-height: 1.3;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .page-header h1 {
        font-size: 2.2rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-column .tagline {
        margin: 0 auto;
    }

    .footer-column .logo {
        display: inline-block;
    }

    .footer-bottom-bar {
        flex-direction: column;
        justify-content: center;
    }
}

/* Menghilangkan garis bawah dari elemen di dalam card link */
.card-link {    
    text-decoration: none;
}

    /* Menghilangkan garis bawah dari seluruh kartu */

        /* --- LOGIKA RESPONSIVE BARU UNTUK GRID --- */
        @media (max-width: 1200px) {
            .transmisi-grid {
                grid-template-columns: repeat(3, 1fr);
                /* 3 kolom di tablet */
            }
        }
    
        @media (max-width: 768px) {
            .transmisi-grid {
                grid-template-columns: repeat(2, 1fr);
                /* 2 kolom di tablet kecil */
            }
        }
    
        @media (max-width: 500px) {
            .transmisi-grid {
                grid-template-columns: 1fr;
                /* 1 kolom di mobile */
            }
        }