:root {
    --bg-color: #080f17; /*17182A*/
    --primary-color: #1B1E2D; /*1A1A22*/
    --text-color: #EBEBEE; /*D4D4D4*/
    --accent-color: #B8B8B8;
    --secondary-color: #9C6CFF;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --accent: #3d5afe;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    flex-direction: column;
    min-height: 100vh;
    font-family: 'ComicReliefBold', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin-top: 40px;
    padding: 60px 15px;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    padding-bottom: 90px;
}

@font-face {
    font-family: 'ComicReliefBold';
    src: url('fonts/ComicRelief-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--primary-color);
    padding: 0 20px;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(20, 20, 30, 0.6);
    z-index: 100;
}

.logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -1px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text); /* warna utama */
}

.logo span {
  color: var(--secondary-color);
}

button {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

button i {
    display: inline-block;
    transition: transform 0.5s ease, color 0.3s ease;
    color: var(--accent-color);
}

#search-button:hover i {
    animation: glowPulse 0.6s ease;
    color: var(--secondary-color);
}

@keyframes glowPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.85; }
    100% { transform: scale(1.05); opacity: 1; }
}

#notification:hover i {
    animation: shake 0.4s ease;
    color: var(--secondary-color);
}

@keyframes shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    50% { transform: rotate(-10deg); }
    75% { transform: rotate(6deg); }
    100% { transform: rotate(0deg); }
}

.notification-btn {
  position: relative; /* supaya ::after / badge absolute ngikut button */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#notification.has-notif .badge {
  display: block;
}

#notification .badge {
  display: none;
  position: absolute;
  top: 5px;
  right: 5px;
  width: 10px;
  height: 10px;
  background: red;
  border-radius: 50%;
  border: 1px solid var(--bg-color); /* biar kelihatan clean */
}
.arrangement-menu {
    position: absolute;
    top: 60px;
    right: 10px;
    background: #111;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 3px;
    display: none;
    flex-direction: column;
    min-width: 120px;
    z-index: 999;
    animation: fadeIn 0.2s ease;
}

.arrangement-menu a {
    font-family: 'ComicReliefBold', sans-serif;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    text-align: center;
    justify-content: flex-start;
    text-align: left;
    padding: 10px;
    text-decoration: none;
}

.arrangement-menu a:hover {
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#arrangement:hover i {
    animation: gearPulse 0.5s ease;
    color: var(--secondary-color);
}

@keyframes gearPulse {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.15) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.right-icon, #search-button, #back-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

#search-button, #back-button { left: 20px; }
.right-icon { right: 20px; }

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--primary-color);
    padding: 0 20px;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 2px 5px rgba(20, 20, 30, 0.6);
    z-index: 100;
}

.bottom-nav span {
    color: var(--text-color);
    font-size: 0.8rem;
    margin-top: 5px;
    transition: color 0.3s ease;
}

.bottom-nav a {
    text-decoration: none;
    color: var(--accent-color);
    font-size: 1.4rem;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    padding: 5px 0;
}

.bottom-nav .active span{
    color: var(--secondary-color);
    transform: scale(1.05);
}

.bottom-nav a.active {
    color: var(--secondary-color);
    transform: scale(1.05);
}

.page {
    display: none;
}

.page.active {
    display: block;
}

section h1 {
    text-align: center;
    margin-top: 60%;
}

section {
    max-width: 500px;
}

/* Page-Beranda */
.stats-section {
    text-decoration: none;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;    
    margin: 15px auto;
    width: 100%;
    max-width: 600px;
    padding: 0;
    justify-items: center;
}

.stat-card {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin: 0;
    width: 100%;
    text-decoration: none;
    cursor: pointer;
    background: var(--primary-color);
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    transition: var(--transition);
    aspect-ratio: 1/1;
    max-height: 60px;
}

.stat-card:hover {
    transform: scale(1.05);
}

.stat-card span {
    font-size: 0.65rem;
    margin-top: 5px;
    color: var(--text-color);
}

.stats-section i {
    margin-top: 8px;
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1.2rem;
    display: block;
}

.slide-card {
    display: flex;
    width: 100%;
    height: 150px;
    gap: 10px;    
    margin: auto;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;        
    padding-bottom: 10px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    max-width: 600px;
    scrollbar-width: none;
}

.slide-card::-webkit-scrollbar {
    display: none;
} 

.card {
    position: relative;
    text-decoration: none;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    padding: 15px;
    height: 150px;
    border-radius: 8px;
    border: 1.5px solid var(--primary-color);        
    transition: transform .25s ease;
    flex: 0 0 100%; 
    scroll-snap-align: start;
    scroll-snap-stop: always;    
}

.card span {
    font-family: 'Roboto', sans-serif;
    top: 22px;
    left: -22px;
    font-size: 0.70rem;
    position: absolute;
    color: var(--text-color);
    z-index: 3;
    font-weight: bold;
    background: red;
    padding: 10px 20px 1px 20px;
    transform: rotate(-43deg);
    transform-origin: top left;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: inherit;
    background-position: center;
    background-size: cover;
    z-index: 1;
    transition: transform .4s ease;
}

.card:hover::before {
    transform: scale(1.1);
}

.card::after {
    content: "";
    position: absolute;
    inset: 0; 
    background: linear-gradient(to right, rgba(0,0,0,.85), rgba(0,0,0,.1));
    z-index: 1;
}

.card .text {
    padding: 10px;
    z-index: 3;
    color: whitesmoke;
    position: absolute;
    bottom: 10px;
    width: 45%;
    padding: 0;
}

.card h3 {
    font-family: 'Roboto', sans-serif;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 5px;
    line-height: 1.1;
    word-wrap: break-word; 
    overflow-wrap: break-word; 
    white-space: normal;
}

.card p {
    font-size: 0.75rem;
    opacity: 9;
}

.grid-header {
    display: flex;
    align-items: center;
    margin: 15px 5px 0 5px;
    justify-content: space-between;
    transition: transform .4s ease;
}

.grid-header h3 {
    font-family: 'Roboto', sans-serif;
    font-size: 1.3rem;
    align-items: center;
}

.details {
    color: inherit;
    text-decoration: none;
}

.grid-header i {
    font-size: 1.3rem;
    cursor: pointer;
    font-weight: bold;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 10px;
    padding: 10px 0;
}

.grid {
    background: none;
    display: block;
    height: 190px;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    border: 1.5px solid var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    font-size: 0.50rem;
    position: relative;
    color: inherit;
    text-decoration: none;
}

.grid::before {
   content: "";
    position: absolute;
    inset: 0;
    background-image: inherit;
    background-position: center;
    background-size: cover;
    z-index: 1;
    transition: transform .4s ease;
}

.grid-container .grid::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.05), rgba(0,0,0,0.95));
    z-index: 2;
}

.grid:hover::before {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.grid h3 {
    font-family: 'Roboto', sans-serif;
    position: absolute;
    bottom: 13px;
    left: 0;
    padding: 10px;
    font-weight: bold;
    font-size: 0.85rem;
    z-index: 3;
}

.grid p {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 5px 10px; 
    font-size: 0.65rem;
    font-weight: bold;
    z-index: 3;
    color: var(--accent-color);
}

.meta i {
    margin-right: 6px;
}

.bar-category {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.bar-category::-webkit-scrollbar {
    display: none;
} 

.bar-category ul {
    display: flex;
    margin: 0;
    padding: 15px;
    gap:10px;
    list-style: none;
    align-items: center;
}

.bar-category button {
    padding: 8px 16px;
    border-radius: 50px;
    border: 1.5px solid var(--secondary-color);
    font-size: 0.85rem;
    flex-shrink: 0;
    cursor: pointer;
    transition: .25s;
    font-weight: bold;
    background: transparent;
}

.bar-category button.active {
    background: var(--secondary-color);
    color: white;
}

.filter-btn.shake {
    animation: shakeBtn .3s;
}

@keyframes shakeBtn {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 30px 0;
}

.settings-item {
    background: var(--primary-color);
    border-radius: 5px 8px 8px 5px;
    border: none;
    outline: none;
    border-left: 5px solid var(--secondary-color);
    padding: 18px;
    color: var(--text-color);
    display: flex;
    flex-direction: row;
    align-items: center;    
    justify-content: flex-start;
    gap: 18px;
    cursor: pointer;    
    transition: 0.2s;
    height: 100px;
    width: 100%;
    position: relative;    
}

.settings-item span {
    font-family: 'ComicReliefBold', sans-serif;
    font-size: 1.3rem;
    z-index: 2;
    line-height: 1;
}

.settings-item i {
    font-size: 1.5rem;
    color: var(--text-color);
    min-width: 26px;
    opacity: 0.5;
    text-align: center;
}

body.subpage .bottom-nav {
  display: none;
}

body.subpage #search-button,
body.subpage #notification,
body.subpage #arrangement {
  display: none;
}

#back-button {
    display: none;
}

body.subpage #back-button {
  display: inline-flex;
}

.filter-container {
  display: flex; 
  gap: 10px; 
  overflow-x: auto; 
  padding-bottom: 5px;
  scrollbar-width: none;
}
        
.filter-container::-webkit-scrollbar { 
  display: none; 
}
        
.chip {
  margin-top: 20px;
  padding: 8px 18px; 
  background: var(--primary-color); 
  border: 1px solid #2d3748;
  border-radius: 50px; 
  font-size: 0.85rem; 
  cursor: pointer;
  white-space: nowrap; 
  transition: 0.3s; 
  color: var(--secondary-color);
}
        
.chip.active { 
  background: var(--secondary-color); 
  color: white; 
  border-color: var(--secondary-color); 
  box-shadow: 0 4px 15px rgba(61, 90, 254, 0.3); 
}

.ln-grid {
  margin-top: 10px;
  display: grid; 
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
        
.grid::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: inherit;
    background-position: center;
    background-size: cover;
    z-index: 1;
    transition: transform .4s ease;
}

.grid:hover::before {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.grid::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.05), rgba(0,0,0,0.95));
    z-index: 2;
}

/* --- NOTIFIKASI LIST (SPA) --- */
#notifList { 
  display: flex; 
  flex-direction: column; 
  padding: 20px 8px; 
}

.notif-item {
  background: transparent;
  padding: 22px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
  border-left: 4px solid var(--accent);
  cursor: pointer; 
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.notif-item:last-child {
  border-bottom: none;
}

/* State pesan yang sudah dibaca */
.notif-item.read { 
  border-left: 5px solid transparent; 
  /* Opacity dikurangi agar fokus ke yang belum dibaca */
  opacity: 0.45; 
}

/* Efek saat ditekan/hover */
.notif-item:active {
  background: rgba(255, 255, 255, 0.05);
  transform: scale(0.98);
}

.notif-item h3 {
  font-family: 'roboto', sans-serif;
  color: #FFFFFF; 
  font-size: 1.5rem; 
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.2px;
  line-height: 1.2;
  display: -webkit-box; 
  -webkit-line-clamp: 1; 
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-left: 20px;
}

.notif-item p {
  /* Warna teks isi sedikit lebih redup agar hierarki jelas */
  color: #D1D1D1; 
  font-size: 0.88rem; 
  line-height: 1.6;
  font-weight: 400;
  display: -webkit-box; 
  -webkit-line-clamp: 2; 
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-left: 20px;
  padding-top: 5px;
}

/* --- MODAL POPUP (GAYA PREMIUM BLUR) --- */
.modal {
  position: fixed; 
  inset: 0; 
  /* Overlay gelap dengan blur kuat */
  background: rgba(4, 7, 12, 0.75); 
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: none; 
  align-items: center; 
  justify-content: center;
  z-index: 9999; 
  padding: 25px; 
}

/* --- MODAL POPUP FIX --- */
.modal-content {
  background: #1B1E2D;
  width: 100%; 
  max-width: 430px; 
  max-height: 85vh; 
  min-height: 420px;
  padding: 20px; 
  border-radius: 32px;
  border: 1px solid rgba(156, 108, 255, 0.3);
  display: flex; 
  flex-direction: column;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-body { 
  flex: 1; 
  overflow-y: auto; 
  margin-bottom: 20px;
  padding-right: 15px;
  display: flex;
  flex-direction: column;
}

/* Mempercantik tampilan scrollbar di dalam modal */
.modal-body::-webkit-scrollbar {
  width: 4px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

.modal-body p { 
  font-size: 1.05rem; 
  line-height: 1.7; 
  color: #EBEBEE; 
  text-align: center;
  word-break: break-word; 
  margin-bottom: 20px;
  padding-bottom: 20px;
}

.btn-close {
  /* Memastikan tombol tetap di posisi bawah meski teks di atas di-scroll */
  flex-shrink: 0; 
  background: var(--accent); 
  color: #fff; 
  border: none;
  padding: 16px; 
  border-radius: 20px; 
  font-weight: 800;
  cursor: pointer;
}

@keyframes modalPop { 
  from { transform: scale(0.9) translateY(20px); opacity: 0; } 
  to { transform: scale(1) translateY(0); opacity: 1; } 
}

.modal-header {
  display: flex; 
  flex-direction: column; /* Ikon di atas judul agar lebih portrait */
  align-items: center; 
  gap: 15px;
  padding-bottom: 20px; 
  margin-bottom: 20px;
  border-bottom: 1.5px solid rgba(156, 108, 255, 0.15);
  text-align: center;
}

.modal-icon-small {
  background: rgba(156, 108, 255, 0.1);
  color: var(--accent);
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(156, 108, 255, 0.2);
}

.modal-content h2 {
  font-family: 'roboto', sans-serif;
  font-size: 1.4rem; 
  color: #FFFFFF; 
  font-weight: 800;
  line-height: 1.3;
}

.btn-close:active { transform: scale(0.96); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#mText a {
    position: relative;
    z-index: 999;
    cursor: pointer;
    display: inline-block; /* Memperluas area klik */
    padding: 2px 0;
}
