/* ===================================================
   jurnal.css - STYLING MODAL JURNAL & LAMPIRAN MEDIA
   =================================================== */

/* Modal Content Khusus Jurnal */
.jurnal-modal-content {
    max-width: 800px !important;
    width: 90vw !important;
    max-height: 90vh !important;
    display: flex;
    flex-direction: column;
    padding: 24px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
}

.jurnal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.jurnal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Header Meta Badge (Judul Aktivitas & Kategori) */
.jurnal-meta-info {
    background: #f8fafc;
    border-left: 4px solid #3498db;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 12px;
}

.jurnal-meta-title {
    font-size: 14px;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 4px;
}

/* Editor Deskripsi WA Style Helper */
.wa-format-hint {
    font-size: 10px;
    color: #64748b;
    margin-top: 4px;
    display: flex;
    gap: 12px;
}

.wa-format-hint span {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* Textarea & Preview Tab Container */
.jurnal-editor-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.jurnal-textarea {
    width: 100%;
    min-height: 140px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.jurnal-textarea:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

/* Box Hasil Render Teks ala WA (Formatted Output) */
.jurnal-preview-box {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: #334155;
    min-height: 50px;
}

.jurnal-preview-box ul {
    margin: 4px 0;
    padding-left: 20px;
}

/* Area Drag & Drop Upload File */
.upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 15px;
}

.upload-dropzone:hover {
    border-color: #3498db;
    background: #f0f9ff;
}

/* Grid Gallery Lampiran File */
.lampiran-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    max-height: 180px;
    overflow-y: auto;
    padding: 4px;
}

.lampiran-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

/* Thumbnail Gambar / Video */
.lampiran-thumb {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    background: #000;
}

.lampiran-doc-icon {
    width: 100%;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 24px;
    color: #475569;
}

.lampiran-name {
    font-size: 10px;
    color: #334155;
    margin-top: 6px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.btn-del-lampiran {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ===================================================
   jurnal.css - STYLING MODAL JURNAL, MODE EDIT & INDIKATOR
   =================================================== */

.jurnal-modal-content {
    max-width: 800px !important;
    width: 90vw !important;
    max-height: 90vh !important;
    display: flex;
    flex-direction: column;
    padding: 24px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
}

.jurnal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.jurnal-header h2 { margin: 0; font-size: 1.3rem; color: #2c3e50; display: flex; align-items: center; gap: 8px; }

/* Tombol Edit & Hapus di Header Jurnal */
.jurnal-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #64748b;
    transition: 0.2s;
    padding: 4px;
    border-radius: 4px;
}

.jurnal-action-btn:hover { background: #f1f5f9; color: #3b82f6; }
.jurnal-action-btn.del:hover { color: #ef4444; background: #fee2e2; }

/* Indikator "Ada Jurnal" di Card Jadwal & Timeline */
.task-jurnal-indicator {
    font-size: 10px;
    margin-left: 6px;
    background: #fef08a;
    padding: 2px 5px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    cursor: default;
}

.jurnal-meta-info {
    background: #f8fafc;
    border-left: 4px solid #3498db;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 12px;
}

.jurnal-meta-title { font-size: 14px; font-weight: bold; color: #1e293b; margin-bottom: 4px; }

.wa-format-hint { font-size: 10px; color: #64748b; margin-top: 4px; display: flex; gap: 12px; }
.wa-format-hint span { background: #e2e8f0; padding: 2px 6px; border-radius: 4px; font-family: monospace; }

.jurnal-editor-container { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; }

.jurnal-textarea {
    width: 100%; min-height: 140px; padding: 10px 12px;
    border: 1px solid #cbd5e1; border-radius: 8px;
    font-family: inherit; font-size: 13px; line-height: 1.5;
    resize: vertical; outline: none; box-sizing: border-box;
}
.jurnal-textarea:focus { border-color: #3498db; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15); }

/* Box Hasil Render Teks (Mode View / Baca) */
.jurnal-preview-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    min-height: 50px;
}
.jurnal-preview-box ul { margin: 4px 0; padding-left: 20px; }

/* Area Grid Lampiran File */
.lampiran-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px; max-height: 180px; overflow-y: auto; padding: 4px;
}

.lampiran-card {
    position: relative; background: #ffffff;
    border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 6px; display: flex; flex-direction: column;
    align-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.lampiran-thumb { width: 100%; height: 80px; object-fit: cover; border-radius: 6px; cursor: pointer; background: #000; }
.lampiran-doc-icon {
    width: 100%; height: 80px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; background: #f1f5f9;
    border-radius: 6px; font-size: 24px; color: #475569;
}
.lampiran-name {
    font-size: 10px; color: #334155; margin-top: 6px;
    width: 100%; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; text-align: center;
}

.btn-del-lampiran {
    position: absolute; top: -4px; right: -4px;
    background: #ef4444; color: white; border: none;
    border-radius: 50%; width: 20px; height: 20px;
    font-size: 10px; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.media-lightbox {
    display: none; position: fixed; z-index: 20000; top: 0; left: 0;
    width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.85);
    align-items: center; justify-content: center; flex-direction: column;
}
.media-lightbox img, .media-lightbox video { max-width: 85vw; max-height: 80vh; border-radius: 8px; box-shadow: 0 5px 25px rgba(0,0,0,0.5); }
.close-lightbox-btn { position: absolute; top: 20px; right: 25px; color: white; font-size: 30px; cursor: pointer; background: none; border: none; }

/* LIGHTBOX / MEDIA VIEWER FULLSCREEN */
.media-lightbox {
    display: none;
    position: fixed;
    z-index: 20000;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.media-lightbox img, .media-lightbox video {
    max-width: 85vw;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
}

.close-lightbox-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
}

/* =====================================================
   OPTIMASI MODAL JURNAL KHUSUS MOBILE LANDSCAPE & RESPONSIVE
   ===================================================== */

/* 1. Atur batas maksimal tinggi modal jurnal secara umum */
.jurnal-modal-content {
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Mengaktifkan scroll vertikal jika konten melebihi layar */
    box-sizing: border-box;
}

/* 2. Khusus Layar HP dengan Tinggi Terbatas (Landscape Mode) */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .jurnal-modal-content {
        max-height: 92vh;
        padding: 12px 16px !important;
    }

    /* Kecilkan padding header agar hemat ruang vertikal */
    .jurnal-header {
        padding-bottom: 4px !important;
        margin-bottom: 8px !important;
    }

    /* Batasi tinggi area teks deskripsi di landscape agar lampiran terlihat */
    #jurnalPreviewBox {
        min-height: 60px !important;
        max-height: 120px !important;
    }

    #jurnalDeskripsi {
        min-height: 60px !important;
        height: 80px !important;
    }

    /* Buat grid lampiran lebih fleksibel dan bisa di-scroll */
    .lampiran-grid {
        max-height: 140px;
        overflow-y: auto;
        padding-right: 4px;
    }
}