@font-face {
    font-family: 'Ngayogyann';
    src: url('ngayogyann.ttf') format('truetype');
}
@font-face {
    font-family: 'Ngayogyan';
    src: url('ngayogyan.ttf') format('truetype');
}

:root {
    --primary: #0056b3;
    --bg: #f4f6f8;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --warning-color: #dc2626;
}

html {
    scroll-behavior: smooth;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(--bg); color: #333; padding: 20px; }
.container { max-width: 1400px; margin: 0 auto; }

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.header-bar h1 {
    font-size: 1.8rem;
    color: var(--primary);
    margin: 0;
    padding: 0;
    border: none;
}

.btn-petunjuk-latin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #dc2626;
    color: #ffffff !important;
    font-weight: bold;
    font-size: 0.95rem;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.4);
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
}
.btn-petunjuk-latin:hover {
    background-color: #b91c1c;
    box-shadow: 0 5px 14px rgba(220, 38, 38, 0.6);
    transform: translateY(-2px);
}

.input-section { background: var(--card-bg); padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); margin-bottom: 25px; }

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 15px;
    flex-wrap: wrap;
}

.input-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #1e293b;
    padding-top: 4px;
}

.toggles-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.card-toggles, .sub-toggles {
    display: flex;
    gap: 12px;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.toggle-label {
    font-weight: bold;
    color: #64748b;
    margin-right: 4px;
}

.card-toggle-item {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    user-select: none;
    color: #334155;
    font-weight: 600;
}

.card-toggle-item input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--primary);
}

.textarea-wrapper {
    position: relative;
    width: 100%;
}

textarea {
    width: 100%;
    height: 100px;
    padding: 12px;
    padding-right: 40px;
    font-size: 1.1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
}

textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.2); }

.btn-clear {
    position: absolute;
    top: 10px;
    right: 12px;
    background: #e2e8f0;
    border: none;
    color: #64748b;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 1;
    transition: all 0.2s;
}
.btn-clear:hover { background: #cbd5e1; color: #0f172a; }

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}
.control-group { display: flex; flex-direction: column; gap: 5px; }
.control-group label { font-size: 0.85rem; font-weight: 600; color: #475569; display: flex; justify-content: space-between; }
.control-group input[type="range"] { width: 100%; cursor: pointer; }

.grid-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 20px; }

.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.card-header { background: #f8fafc; font-size: 1.1rem; font-weight: bold; color: #1e293b; padding: 12px 16px; border-bottom: 1px solid var(--border); }

/* Latar Belakang Warna Samar Sesuai Modul */
#cardPraktis { background-color: #fffde7; }
#cardKBJ, #cardSriwedari, #cardSimplified { background-color: #f0fdf4; }
#cardTradisional, #cardCaraKawi { background-color: #fef2f2; }

.output-group { padding: 12px 16px; border-bottom: 1px dashed var(--border); }
.output-group:last-child { border-bottom: none; }

.output-label { font-size: 0.8rem; color: #64748b; font-weight: bold; text-transform: uppercase; margin-bottom: 4px; }

.box-aksara { min-height: 40px; font-size: 1.8rem; line-height: 1.6; color: #0f172a; word-wrap: break-word; white-space: pre-wrap;}

/* Default Sembunyi untuk JGST, IPA, dan PUJL */
.group-jgst, .group-ipa, .group-pujl { display: none; }

.box-jgst { font-family: 'Gentium Plus', serif; font-size: 1.25rem; color: #b91c1c; font-weight: bold; word-wrap: break-word; white-space: pre-wrap;}
.box-ipa { font-family: 'Gentium Plus', serif; font-size: 1.25rem; color: #047857; font-weight: bold; word-wrap: break-word; white-space: pre-wrap;}
.box-pujl { font-family: 'Gentium Plus', serif; font-size: 1.25rem; color: #1d4ed8; font-weight: bold; word-wrap: break-word; white-space: pre-wrap;}

.font-ngayogyann { font-family: 'Ngayogyann', 'Noto Sans Javanese', sans-serif; }
.font-ngayogyan { font-family: 'Ngayogyan', 'Noto Sans Javanese', sans-serif; }
.ringkasan-sub-row { display: flex; gap: 16px; margin-top: 6px; flex-wrap: wrap; align-items: center; }

.rekan-highlight { color: var(--warning-color); font-weight: bold; }
.rekan-warning-badge {
    color: var(--warning-color);
    font-size: 0.8rem;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4;
}

.table-guide {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    color: #1e293b;
}
.table-guide th, .table-guide td {
    border: 1px solid var(--border);
    padding: 10px 14px;
    text-align: left;
    vertical-align: middle;
}
.table-guide th {
    background-color: #f1f5f9;
    font-weight: bold;
    color: #0f172a;
}
.table-guide tr:nth-child(even) {
    background-color: #f8fafc;
}
.table-guide tr:hover {
    background-color: #f1f5f9;
}
.aksara-cell {
    font-size: 1.6rem;
    line-height: 1.4;
    font-family: 'Ngayogyann', 'Noto Sans Javanese', sans-serif;
    color: #0f172a;
}
.aksara-lama-cell {
    font-size: 1.6rem;
    line-height: 1.4;
    font-family: 'Ngayogyan', 'Noto Sans Javanese', sans-serif;
    color: #0f172a;
}
.combined-notation {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-family: 'Gentium Plus', serif;
    font-size: 1.05rem;
}
.tag-jgst { color: #b91c1c; font-weight: bold; }
.tag-ipa { color: #047857; font-weight: bold; }
.tag-pujl { color: #1d4ed8; font-weight: bold; }
.missing-badge {
    color: #dc2626;
    font-size: 0.8rem;
    display: block;
    margin-top: 2px;
    font-weight: 600;
}

/* GAYA POP-UP MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}
.modal-box {
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 650px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2), 0 10px 10px -5px rgba(0,0,0,0.1);
    overflow: hidden;
    animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    background: #1e293b;
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.15rem;
    font-weight: bold;
}
.modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close:hover { color: #ffffff; }
.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.form-group-custom {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group-custom label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
}
.form-group-custom select, .form-group-custom input[type="text"] {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}
.form-group-custom select:focus, .form-group-custom input[type="text"]:focus {
    border-color: var(--primary);
}
.modal-preview-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.modal-preview-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.modal-latin-out {
    font-size: 1.15rem;
    font-weight: bold;
    color: #0f172a;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    word-break: break-all;
}
.modal-aksara-out {
    font-size: 1.8rem;
    line-height: 1.5;
    color: #0284c7;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    min-height: 50px;
    word-break: break-all;
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 6px;
}
.btn-modal-action {
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-modal-copy {
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}
.btn-modal-copy:hover {
    background-color: #e2e8f0;
}
.btn-modal-use {
    background-color: #16a34a;
    color: #ffffff;
}
.btn-modal-use:hover {
    background-color: #15803d;
}
.font-gentium {
    font-family: 'Gentium Plus', serif;
    font-size: 1.6rem;
    font-weight: bold;
    color: #0d9488;
}
