body {
    background: linear-gradient(
        180deg,
        #071226 0%,
        #0f1f45 35%,
        #111827 100%
    );
    color: #e2e8f0;
    font-family: sans-serif;
    min-height: 100vh;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

header {
    position: sticky;
    top: 0;
    height: 33px;
    z-index: 40;
    background: rgba(10, 20, 40, 0.92);
    backdrop-filter: blur(14px);
    padding-top: 0;
    margin-top: 0;
    overflow: hidden;

}

.brand-wrapper-horizontal {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1px;
    text-decoration: none;
}

.logo-img-wide {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.brand-info {
display: flex;
flex-direction: column;
justify-content: center;
}

.brand-title {
margin: 0;
font-size: 1.35rem;
font-weight: 700;
color: #93c5fd;
line-height: 1.2;
}

.brand-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: #cbd5e1;
    opacity: 0.82;
    font-style: italic;
}

.brand-subtitle a {
color: #fbbf24;
text-decoration: none;
font-weight: 600;
}

.brand-subtitle a:hover {
color: #93c5fd;
}

.flex.border-b {
    position: sticky;
    top: 35px; /* Jarak dari atas (di bawah header) */
    z-index: 30;
    background: rgba(15, 30, 58, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 0;

}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    scroll-behavior: smooth;

}
#main-content {
    height: calc(100dvh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 30px;

    -webkit-overflow-scrolling: touch;
}
.line-clamp-3 {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;

}

button[onclick^="deletePost"] {
background: rgba(239, 68, 68, 0.1);
border-radius: 8px;
backdrop-filter: blur(4px);

}

button[onclick^="handleReaction"] {
background: rgba(255, 255, 255, 0.05);
padding: 4px 10px;
border-radius: 20px;
border: 1px solid rgba(255, 255, 255, 0.1);

}

button[onclick^="handleReaction"]:active {
transform: scale(0.9);

}

.glass {
    background: rgba(20, 41, 74, 0.78);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);

}

.modal {
position: fixed;
top: 74px;      /* mulai setelah header */
left: 0;
right: 0;
bottom: 0;

    background: rgba(5, 10, 25, 0.78);
    backdrop-filter: blur(16px);

display: none;  
justify-content: center;  
align-items: flex-start;  

z-index: 999;  
padding: 16px;  
overflow-y: auto;

}
/* box popup */
.modal-content {
    width: 100%;
    max-width: 850px;
    margin-top: 0px;

    max-height: calc(100vh - 110px);  
    overflow-y: auto;  

    background: rgba(17, 34, 64, 0.96);
    border: 1px solid rgba(96,165,250,0.12);
    box-shadow: 0 20px 40px rgba(0,0,0,0.45);
    border-radius: 24px;  
    padding: 24px;

}

}
@media (max-width: 768px) {
.modal {
top: 65px;
padding: 12px;
}

.modal-content {  
    max-height: calc(100vh - 85px);  
    padding: 18px;  
}

}
/* Animasi perpindahan tab */
.tab-content {
animation: fadeIn 0.3s ease;

}

@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(5px);

}  
  
to {  
    opacity: 1;  
    transform: translateY(0);  
    
}

}

.post-body {
font-size: 14px;
line-height: 1.8;
color: #cbd5e1;
}

.post-body h1,
.post-body h2,
.post-body h3 {
color: #60a5fa;
font-weight: bold;
margin-top: 20px;
margin-bottom: 12px;
}

.post-body p {
margin-bottom: 12px;
}

.post-body ul,
.post-body ol {
padding-left: 20px;
margin-bottom: 12px;
}

.post-body table {
border-collapse: collapse;
min-width: 100%;
width: max-content;
font-size: 13px;
}

.post-body th,
.post-body td {
border: 1px solid rgba(255,255,255,0.1);
padding: 10px;
text-align: left;
vertical-align: top;
white-space: nowrap;
}

.post-body td:nth-child(3),
.post-body th:nth-child(3) {
white-space: normal;
min-width: 180px;
}

.post-body th {
background: rgba(59,130,246,0.15);
color: #60a5fa;
}

/* TABLE SCROLL SYSTEM */
.table-wrapper {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
margin: 16px 0;
width: 100%;
border-radius: 8px;
}
.table-wrapper table {
min-width: 100%;
width: max-content;
border-collapse: collapse;
}
.table-wrapper::-webkit-scrollbar { height: 6px; }
.table-wrapper::-webkit-scrollbar-thumb {
background: rgba(59,130,246,0.4);
border-radius: 10px;

}

/* FAB SYSTEM */
#floatingAction {
    position: fixed;
    right: 16px;
    bottom: 110px;
    z-index: 9999;

    display: flex;  
    flex-direction: column;  
    align-items: center;  
    gap: 5px; /* lebih rapat */
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 1;
    transform: scale(1);
    visibility: visible;
}

.fab-btn {
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);

width: 40px;  
height: 40px;  
border-radius: 40%;  

display: flex;  
align-items: center;  
justify-content: center;  

cursor: grab;  
box-shadow: 0 4px 12px rgba(0,0,0,0.35);  
padding: 0;

}

.fab-popup {
position: fixed;
right: 62px;
bottom: 110px;
z-index: 10000;
}
/* PENYEMPURNAAN POPUP FAB */
.fab-popup-inner {
    background: linear-gradient(
        165deg,
        rgba(12, 24, 48, 0.98) 0%,
        rgba(18, 36, 68, 0.95) 100%
    );
    border: 1px solid rgba(96,165,250,0.12);
    border-radius: 20px;
    padding: 16px;
    min-width: 240px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* Judul Popup - Dibuat lebih kontras tapi tetap soft */
.popup-title {
    color: #60a5fa; /* Biru terang agar mudah dibaca */
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Item menu di dalam popup (Download & Daftar Isi) */
.popup-item {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    font-size: 13px;
    color: #cbd5e1;
    border-radius: 12px;
    display: block;
    margin-bottom: 6px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

/* Efek Hover - Mengikuti gaya tombol di beranda */
.popup-item:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #ffffff;
    border-color: rgba(96, 165, 250, 0.3);
    transform: scale(1.02);
}

/* Area Input Copy Link */
.popup-url {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.popup-url input {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 10px;
    font-size: 11px;
    border-radius: 8px;
    color: #94a3b8;
    outline: none;
}

.popup-url button {
    background: #2563eb;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 0 12px;
    border-radius: 8px;
    transition: background 0.2s;
}

.popup-url button:active {
    transform: scale(0.95);
}

/* List Daftar Isi (TOC) agar lebih rapi */
#tocContainer ul {
    list-style: none;
    padding: 0;
    max-height: 40vh;
    overflow-y: auto;
}

#tocContainer li {
    padding: 2px 0;
}

#tocContainer a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 12px;
    transition: 0.2s;
}

#tocContainer a:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.floating-actions{
    animation: slideUp .35s ease;
}

.fab-hidden {
    opacity: 0 !important;
    transform: scale(0.3) !important; /* Efek mengecil ke tengah */
    visibility: hidden !important;
    pointer-events: none;
}

@media (max-width: 767px) {
.fab-btn {
width: 38px;
height: 38px;
}

.fab-popup {  
    right: 54px;  
}  
  
/* khusus popup daftar isi di mobile */  
#tocPopup .fab-popup-inner {  
    width: 75vw; /* Lebih lebar di mobile agar nyaman dibaca */  
    max-width: 260px;  
    min-width: unset;  

    max-height: 60vh; /* Sedikit lebih pendek agar tidak menutupi seluruh layar */  
    overflow-y: auto;  

    padding: 13px; /* Padding lebih besar agar area sentuh (tap) lebih nyaman */  
    border-radius: 16px;  
}  

/* daftar isi text mobile */  
#tocPopup ul {  
    padding-left: 10px;  
    margin-top: 10px;  
}  

#tocPopup li {  
    margin-bottom: 12px; /* Jarak antar link lebih lebar agar tidak salah pencet */  
    line-height: 1.5;  
}  

#tocPopup a {  
    font-size: 14px; /* Font sedikit diperbesar (14px) agar mudah dibaca di layar HP */  
    color: #cbd5e1;  
    text-decoration: none;  
    display: block;  
    padding: 5px 0; /* Area klik lebih luas */  
}

}

@keyframes slideUp{
from{
opacity:0;
transform: translateY(20px);
}
to{
opacity:1;
transform: translateY(0);
}
}
#viewContent {
font-size: 14px;
line-height: 1.8;
word-break: break-word;
}
#viewContent p {
white-space: pre-wrap;
}
#search-container {
transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.search-highlight {
background: #facc15;
color: #000;
padding: 2px 3px;
border-radius: 4px;
}
#searchInput {
transition: width 0.3s ease;
}
#screenModeToggle {
    position: fixed;
    right: 16px;
    bottom: 55px; /* di atas floating action utama */
    z-index: 9999;
}

#screenModeToggle .fab-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;

    background: rgba(30, 41, 59, 0.88);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);

    color: #fff;
    font-size: 16px;

    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
#screenModeToggle.active .fab-btn {
    border: 1px solid rgba(96,165,250,0.6);
    box-shadow: 0 0 18px rgba(59,130,246,0.35);
}
/* Efek Loading Berdenyut */
.skeleton {
background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
background-size: 200% 100%;
animation: loading 1.5s infinite;
border-radius: 12px;
}
.skeleton.h-32 {
height: 40px; / Sangat tipis menyesuaikan layout baru */
margin-bottom: 6px;
border-radius: 8px;
}

@keyframes loading {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}

/* semua icon global */
.icon,
.action-btn img,
.action-btn svg,
.fab-btn img,
.fab-btn svg {
width: 16px;
height: 16px;
display: inline-block;
vertical-align: middle;

color: #ffffff !important;  
fill: #ffffff !important;  
stroke: #ffffff !important;

}

/* tombol */
.action-btn,
.fab-btn,
.toc-toggle-btn,
.share-toggle-btn,
.download-toggle-btn {
color: #ffffff !important;
}
#floatingAction button img,
#floatingAction button svg {
filter: brightness(0) invert(1);
}

button .icon,
a .icon {
pointer-events: none;
}

/* 2 mode ui */
#appContainer {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

#appContainer.wide-mode {
    width: 110%;
    max-width: 1100px !important;
}

.wide-active {
    border: 1px solid rgba(96,165,250,0.6);
    box-shadow: 0 0 18px rgba(59,130,246,0.25);
}
