/* style.css (FINAL - Layout Otomatis, Desain Modern, Rapat) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800&display=swap');

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
}

:root {
    --font-family: 'Poppins', sans-serif;
    --primary-color: #7b2cbf;
    --secondary-color: #5a189a;
    --accent-color: #9d4edd;
    --text-color: #e0e0e0;
    --heading-color: #ffffff;
    --bg-dark: #10002b;
    --bg-medium: #240046;
    --bg-light: #3c096c;
    --border-color: #5a189a;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    --border-radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-family);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === LANDING PAGE STYLES (AMAN, TIDAK DIUBAH) === */
.landing-page { background-color: var(--bg-dark); color: var(--text-color); overflow-x: hidden; }
.background-shapes { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; background-image: radial-gradient(circle at 15% 20%, var(--bg-light) 0%, transparent 30%), radial-gradient(circle at 85% 70%, var(--secondary-color) 0%, transparent 40%); opacity: 0.5; }
.landing-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 5%; background: rgba(16, 0, 43, 0.8); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; }
.logo { font-weight: 700; font-size: 1.5rem; color: var(--heading-color); }
.landing-header nav a { color: var(--text-color); text-decoration: none; margin: 0 1rem; font-weight: 600; transition: color 0.2s; }
.landing-header nav a:hover { color: var(--accent-color); }
.btn.btn-cta { background: transparent; border: 2px solid var(--accent-color); color: var(--accent-color); padding: 0.5rem 1.5rem; border-radius: 50px; text-decoration: none; font-weight: 600; transition: all 0.2s; }
.btn.btn-cta:hover { background: var(--accent-color); color: white; }
main { max-width: 100%; margin: 0 auto; padding: 0 2rem; }
section {
    padding: 6rem 0;
    text-align: center;
}
.hero-content { margin-bottom: 2rem; }
.hero h1 { font-size: 4rem; font-weight: 800; line-height: 1.2; color: var(--heading-color); margin-bottom: 1.5rem; }
.hero .highlight { color: var(--accent-color); }
.hero .subtitle { font-size: 1.25rem; max-width: 600px; margin: 0 auto 2.5rem; }
.btn.btn-primary-solid { background: var(--primary-color); color: white; padding: 1rem 2.5rem; border-radius: 50px; text-decoration: none; font-weight: 700; font-size: 1.1rem; transition: all 0.2s; box-shadow: 0 4px 20px rgba(123, 44, 191, 0.4); }
.btn.btn-primary-solid:hover { background: var(--secondary-color); transform: translateY(-3px); }
.hero-image { background: var(--bg-medium); padding: 1.5rem; border-radius: var(--border-radius); box-shadow: var(--shadow); border: 1px solid var(--border-color); margin-top: 4rem; }
.features h2 { font-size: 2.5rem; margin-bottom: 4rem; color: var(--heading-color); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.feature-card { background: var(--bg-medium); padding: 2rem; border-radius: var(--border-radius); border: 1px solid var(--border-color); transition: transform 0.2s, box-shadow 0.2s; }
.feature-card:hover { transform: translateY(-5px); }
.feature-icon { font-size: 3rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.5rem; color: var(--heading-color); margin: 0 0 1rem 0; }
.how-it-works h2 { font-size: 2.5rem; margin-bottom: 4rem; color: var(--heading-color); }
.steps-container { display: flex; justify-content: space-between; align-items: center; gap: 2rem; }
.step { flex: 1; }
.step-number { width: 50px; height: 50px; background: var(--primary-color); color: white; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.5rem; font-weight: 700; margin: 0 auto 1rem; }
.step h3 { font-size: 1.5rem; color: var(--heading-color); }
.step-arrow { font-size: 2.5rem; color: var(--accent-color); font-weight: 700; }
.final-cta h2 { font-size: 2.5rem; color: var(--heading-color); }
.final-cta p { font-size: 1.25rem; margin-bottom: 2.5rem; }
.landing-footer { text-align: center; padding: 2rem; border-top: 1px solid var(--border-color); }


/* === MAIN APP & ADMIN STYLES (BAGIAN YANG DIPERBARUI) === */
.app-header {
    background-color: rgba(16,0,43,0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    color: white;
    padding: 1rem;
    position: sticky; /* Ubah ke sticky agar tetap di atas */
    top: 0;
    z-index: 1000;
    text-align: center;
}
.app-header h1 { margin: 0; font-size: 1.5rem; } .app-header p { margin: 0.25rem 0 0; }

.board-container {
    background-color: #3d405b;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23454864' fill-opacity='0.6'%3E%3Ccircle cx='10' cy='10' r='1'/%3E%3C/g%3E%3C/svg%3E");
    min-height: calc(100vh - 81px);
    padding: 2rem;
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    justify-content: center;   /* ✅ UBAH MENJADI INI */
    align-content: flex-start;
    gap: 2rem;
    align-items: flex-start;
}

.post-card {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 16px 20px;
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    touch-action: none;
    will-change: width, height;
    border: 2px solid transparent;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.post-card:hover { border-color: rgba(123, 44, 191, 0.5); }

.post-header { display: flex; justify-content: space-between; align-items: center; }
.user-info { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.user-details { display: flex; flex-direction: column; }
.post-author { font-weight: 600; color: #1a1a1a; font-size: 0.9rem; }
.post-timestamp { font-size: 0.7rem; color: #888; }

.options-menu { position: relative; display: flex; align-items: center; }
.edit-btn { background: #eee; border: 1px solid #ddd; border-radius: 5px; padding: 2px 8px; margin-right: 5px; font-size: 0.75rem; cursor: pointer; display: none; }
.edit-btn.visible { display: inline-block; }
.options-btn { background: none; border: none; font-size: 1.5rem; color: #888; cursor: pointer; padding: 0 8px; }

.post-content p {
    margin: 0;
    line-height: 1.5;
    font-size: clamp(12px, 3vw, 14px);
}

.post-actions { display: flex; gap: 16px; padding: 8px 0; border-top: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0; color: #888; }
.action-item { display: flex; align-items: center; gap: 8px; }
.action-item .icon { font-size: 1.2rem; }

.comments-section { padding-top: 8px; padding-bottom:0!important; border-top: 1px solid #f0f0f0; }
.comment { margin-bottom: 12px; text-align: left;   position: relative; }
.comment .avatar { width: 28px; height: 28px; }
.comment-content p { margin-top:0; margin-left: 39px; font-size: clamp(11px, 2.8vw, 13px); }

.add-comment-section { display: flex; align-items: center; gap: 12px; color: #888888; }
.add-comment-section .icon { font-size: 1.2rem; border: 1px solid #cccccc; border-radius: 50%; width: 24px; height: 24px; display: flex; justify-content: center; align-items: center; flex-shrink: 0; }
.add-comment-section input { border: none; background: none; outline: none; font-family: 'Poppins', sans-serif; font-size: 0.85rem; width: 100%; }

.custom-dialog-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4); backdrop-filter: blur(3px);
    display: none;
    justify-content: center; align-items: center; z-index: 3000;
}
.dialog-box {
    background: white; padding: 24px; border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2); width: 90%; max-width: 320px;
}
.dialog-box h4 { margin: 0 0 8px; }
.dialog-box p { margin: 0 0 16px; font-size: 0.9rem; color: #666; }
.dialog-actions { display: flex; justify-content: space-between; gap: 10px; }
.btn.btn-secondary { background-color: var(--bg-medium);
    color: white;
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600; }


/* Gaya lain (fab, modal, dll) */
.fab { position: fixed; bottom: 2rem; right: 2rem; width: 60px; height: 60px; background: var(--primary-color); color: white; border: none; border-radius: 50%; font-size: 2rem; cursor: pointer; display: flex; justify-content: center; align-items: center; box-shadow: 0 5px 20px rgba(123, 44, 191, 0.4); transition: transform 0.2s; z-index: 1000; }
.fab:hover { transform: scale(1.1); }
.modal-overlay { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(10, 22, 41, 0.5); backdrop-filter: blur(5px); justify-content: center; align-items: center; }
.modal-content { background-color: #fff; color: #333; padding: 2rem; border-radius: var(--border-radius); width: 90%; max-width: 500px; position: relative; box-shadow: var(--shadow); }
.close-btn { position: absolute; top: 1rem; right: 1.5rem; font-size: 2rem; background: none; border: none; cursor: pointer; color: #adb5bd; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: #333; }
.form-group input, .form-group textarea { width: 100%; padding: 0.75rem 1rem; border: 1px solid #ddd; border-radius: 8px; font-size: 1rem; margin-bottom:10px; font-family: var(--font-family);}
.btn.btn-primary { background-color: var(--primary-color); color: white; width: 100%; padding: 0.85rem 1rem; border: none; border-radius: 8px; cursor: pointer; font-size: 1rem; font-weight: 600; }
/* ============================================= */
/* === ATURAN RESPONSIVE UNTUK MOBILE === */
/* ============================================= */

@media (max-width: 768px) {
    /* Aturan umum untuk landing page di mobile */
    .landing-header nav { display: none; }
    .hero h1 { font-size: 2.5rem; }
    .steps-container { flex-direction: column; }
    .step-arrow { transform: rotate(90deg); }

    /* PERBAIKAN UNTUK PAPAN TULIS DI MOBILE */
    .board-container {
        /* Mengubah layout menjadi satu kolom vertikal */
        flex-direction: column-reverse;
        /* Mengurangi padding di sisi kiri dan kanan */
        padding: 1rem;
        gap: 1rem;
    }

    .post-card {
        /*
         * Kartu akan memenuhi lebar layar.
         * Kita gunakan '!important' untuk mengalahkan style 'width'
         * yang diatur oleh JavaScript, khusus untuk tampilan mobile.
        */
        width: 100% !important;
        margin: 0;
        touch-action: pan-y;
    }
}

/* === Gaya Menu Komentar === */

.comment {
    position: relative; /* Penting untuk posisi menu */
}

.comment .options-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.comment .comment-options-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 8px;
    border-radius: 4px;
}
.comment .comment-options-btn:hover {
    background-color: #f0f0f0;
}

.comment-menu {
    position: absolute;
    top: 28px;
    right: 8px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #eee;
    padding: 6px;
    display: flex;
    flex-direction: column;
    z-index: 10;

    /* Sembunyikan secara default */
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.comment-menu.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.comment-menu-item {
    background: none;
    border: none;
    text-align: left;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
}

.comment-menu-item:hover {
    background-color: #f5f5f5;
}

.comment-menu-item.delete {
    color: #e74c3c; /* Merah untuk tombol hapus */
}

/* === Gaya Tambahan untuk Dialog Kustom === */

.custom-dialog-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4); backdrop-filter: blur(3px);
    display: none; /* Awalnya disembunyikan */
    justify-content: center; align-items: center; z-index: 3000;
}
.dialog-box {
    background: white; padding: 24px; border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2); width: 90%; max-width: 350px;
    text-align: center;
}
.dialog-box h4 { margin: 0 0 8px; font-size: 1.2rem; }
.dialog-box p { margin: 0 0 16px; font-size: 0.9rem; color: #666; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn.btn-secondary { background-color: #eee; color: #333; }
.btn.btn-danger {     background-color: red;
    color: white;
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600; }

/* === Gaya Menu Dropdown (Untuk Post & Komentar) === */

.options-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.options-btn, .comment-options-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 8px;
    border-radius: 4px;
}

.options-btn:hover, .comment-options-btn:hover {
    background-color: #f0f0f0;
}

.options-dropdown {
    position: absolute;
    top: 28px;
    right: 8px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #eee;
    padding: 6px;
    display: flex;
    flex-direction: column;
    z-index: 10;

    /* Sembunyikan secara default */
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.options-dropdown.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.options-item {
    background: none;
    border: none;
    text-align: left;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
}

.options-item:hover {
    background-color: #f5f5f5;
}

.options-item.delete {
    color: #e74c3c; /* Merah untuk tombol hapus */
}
