/* ==========================================================
   BATU Teknologi - Docs Tools (shared stylesheet)
   Dipakai oleh: / (hub), /pdf-to-image/, /images-to-pdf/
   ========================================================== */

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

:root {
    --brand: #059669;
    --brand-dark: #047857;
    --brand-soft: rgba(5, 150, 105, 0.06);
    --ink: #0f172a;
}

body {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    background: #ffffff;
    color: var(--ink);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 800px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }

/* ---------- Nav ---------- */
nav {
    padding: 16px 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--ink);
    font-weight: 800;
    font-size: 18px;
}
.logo i { color: var(--brand); font-size: 20px; }
.logo span { color: rgba(15, 23, 42, 0.5); font-weight: 400; }
.back-link {
    color: rgba(15, 23, 42, 0.5);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s;
    white-space: nowrap;
}
.back-link:hover { color: var(--brand); }
.nav-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-pill {
    font-size: 12px;
    text-decoration: none;
    color: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 999px;
    padding: 6px 12px;
    transition: all 0.2s;
}
.nav-pill:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.nav-pill.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 600;
}

/* ---------- Header ---------- */
header.page-head { text-align: center; padding: 56px 0 36px; }
header.page-head h1 {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}
header.page-head h1 span { color: var(--brand); }
header.page-head p { color: rgba(15, 23, 42, 0.5); font-size: 15px; }

.breadcrumb {
    font-size: 12px;
    color: rgba(15, 23, 42, 0.35);
    margin-bottom: 14px;
}
.breadcrumb a { color: rgba(15, 23, 42, 0.5); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }

/* ---------- Card ---------- */
.card {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
}
.card + .card { margin-top: 24px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    text-decoration: none;
    color: var(--ink);
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover {
    background: var(--brand-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.3);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-outline {
    background: transparent;
    border: 2px solid rgba(15, 23, 42, 0.15);
    color: var(--ink);
}
.btn-outline:hover { border-color: var(--brand); background: rgba(5, 150, 105, 0.06); color: var(--brand-dark); }
.btn-green { background: #10b981; color: #fff; }
.btn-green:hover { background: var(--brand); transform: translateY(-2px); }
.btn-sm { padding: 10px 20px; font-size: 13px; }

/* ---------- Upload area ---------- */
.upload-area {
    border: 2px dashed rgba(15, 23, 42, 0.15);
    border-radius: 16px;
    padding: 56px 20px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    background: #fff;
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--brand);
    background: var(--brand-soft);
}
.upload-area i { font-size: 48px; color: var(--brand); margin-bottom: 16px; display: block; }
.upload-area h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; word-break: break-word; }
.upload-area p { color: rgba(15, 23, 42, 0.4); font-size: 13px; }
.upload-area input[type=file] {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}
.upload-hint { margin-top: 8px; font-size: 12px; color: rgba(15, 23, 42, 0.25); }

/* ---------- Options ---------- */
.options {
    margin-top: 24px;
    text-align: left;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(15, 23, 42, 0.6);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.field select, .field input[type=range] {
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
}
.field input[type=range] { padding: 0; accent-color: var(--brand); }
.range-value { float: right; font-weight: 600; color: var(--brand-dark); }
.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(15, 23, 42, 0.7);
}
.checkbox input { width: 16px; height: 16px; accent-color: var(--brand); }

.submit-wrap { margin-top: 24px; }

/* ---------- Message ---------- */
.message {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: left;
}
.message.success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.25); color: #047857; }
.message.error { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.2); color: #b91c1c; }

/* ---------- Results (PDF to Image) ---------- */
.results { margin-top: 24px; }
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.result-item {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    overflow: hidden;
}
.result-item img { width: 100%; height: 160px; object-fit: cover; display: block; }
.result-info {
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.result-info span { font-size: 12px; color: rgba(15, 23, 42, 0.5); }
.result-info a {
    color: var(--brand-dark);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.result-info a:hover { color: var(--brand); }
.download-all { text-align: center; margin-top: 24px; }

/* ---------- Image preview grid (Images to PDF) ---------- */
.preview-list { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; text-align: left; }
.preview-item {
    position: relative;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    overflow: hidden;
    cursor: grab;
}
.preview-item.dragging { opacity: 0.4; }
.preview-item.drop-target { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.25); }
.preview-item img { width: 100%; height: 110px; object-fit: cover; display: block; }
.preview-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 11px;
    color: rgba(15, 23, 42, 0.5);
}
.preview-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-remove {
    position: absolute;
    top: 6px; right: 6px;
    width: 24px; height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.preview-remove:hover { background: #ef4444; }
.preview-order {
    position: absolute;
    top: 6px; left: 6px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    padding: 2px 7px;
}

/* ---------- Success box (Images to PDF) ---------- */
.success-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 14px;
    padding: 28px;
    margin-bottom: 24px;
}
.success-box .success-icon { font-size: 40px; color: var(--brand); margin-bottom: 10px; display: block; }
.success-box h3 { font-size: 18px; margin-bottom: 6px; }
.success-box p { font-size: 13px; color: rgba(15, 23, 42, 0.55); margin-bottom: 18px; }
.success-box .meta { font-size: 12px; color: rgba(15, 23, 42, 0.45); margin-top: 14px; }
.pdf-frame {
    width: 100%;
    height: 420px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    background: #fff;
    margin-bottom: 20px;
}
.pdf-frame-wrap { margin-top: 24px; text-align: left; }
.pdf-frame-wrap summary {
    cursor: pointer;
    font-size: 13px;
    color: var(--brand-dark);
    font-weight: 600;
    margin-bottom: 12px;
}

/* ---------- Feature / hub cards ---------- */
.features {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    text-align: center;
}
.feature {
    padding: 24px;
    background: rgba(15, 23, 42, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.06);
}
.feature i { font-size: 28px; color: var(--brand); margin-bottom: 8px; display: block; }
.feature h4 { font-size: 14px; margin-bottom: 4px; }
.feature p { font-size: 12px; color: rgba(15, 23, 42, 0.4); }

.tool-grid {
    margin-top: 32px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    text-align: left;
}
.tool-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.25s;
}
.tool-card:hover {
    border-color: var(--brand);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(5, 150, 105, 0.12);
}
.tool-card .tool-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}
.tool-card h3 { font-size: 17px; margin-bottom: 8px; }
.tool-card p { font-size: 13px; color: rgba(15, 23, 42, 0.5); margin-bottom: 16px; }
.tool-card .tool-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-tag {
    font-size: 11px;
    color: rgba(15, 23, 42, 0.5);
    background: rgba(15, 23, 42, 0.04);
    border-radius: 6px;
    padding: 3px 8px;
}

/* ---------- Loading ---------- */
.loading { display: none; margin-top: 16px; }
.loading.show { display: block; }
.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(15, 23, 42, 0.1);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { color: rgba(15, 23, 42, 0.5); font-size: 14px; }

/* ---------- SEO text blocks ---------- */
.seo-block { margin-top: 56px; text-align: left; }
.seo-block h2 { font-size: 20px; margin-bottom: 12px; }
.seo-block h3 { font-size: 15px; margin: 18px 0 6px; }
.seo-block p { font-size: 14px; color: rgba(15, 23, 42, 0.6); line-height: 1.7; margin-bottom: 8px; }
.seo-block ul { margin: 8px 0 8px 20px; }
.seo-block li { font-size: 14px; color: rgba(15, 23, 42, 0.6); line-height: 1.7; }
.faq-item { border-bottom: 1px solid rgba(15, 23, 42, 0.08); padding: 14px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.faq-item p { margin-top: 8px; font-size: 13px; }

/* ---------- Footer ---------- */
footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    margin-top: 60px;
}
footer p { font-size: 13px; color: rgba(15, 23, 42, 0.25); }
footer a { color: rgba(15, 23, 42, 0.4); text-decoration: none; }
footer a:hover { color: var(--brand); }
.footer-links { margin-bottom: 10px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.footer-links a { font-size: 13px; }

@media (max-width: 600px) {
    .card { padding: 20px; }
    .upload-area { padding: 40px 16px; }
    .results-grid { grid-template-columns: 1fr; }
    .nav-tools { display: none; }
    .preview-list { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
