/* ============================================================
   FileMaker API Explorer — Compact & Responsive Global Styles
   ============================================================ */

/* ── Base & Typography ─────────────────────────────────────── */
body {
    font-size: 0.875rem;
}

/* ── Layout Wrapper ────────────────────────────────────────── */
.content-page {
    min-height: calc(100vh - 56px);
    padding-bottom: 1rem;
}

.content {
    padding: 0.75rem 1rem 0;
}

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.15);
}

.navbar-brand {
    font-size: 0.95rem;
    font-weight: 600;
}

.navbar-nav .nav-link {
    font-size: 0.82rem;
    padding: 0.3rem 0.65rem !important;
}

.navbar-nav .dropdown-menu {
    font-size: 0.82rem;
}

.navbar-nav .dropdown-item {
    padding: 0.3rem 0.9rem;
}

.dropdown-header {
    font-size: 0.75rem;
    padding: 0.25rem 0.9rem;
}

/* ── Page Title ────────────────────────────────────────────── */
.page-title-box {
    padding: 0.6rem 0 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #f1f3fa;
}

.page-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    box-shadow: 0 1px 6px rgba(154,161,171,0.12);
    border: 1px solid rgba(0,0,0,0.06);
    margin-bottom: 0.75rem;
}

.card-body {
    padding: 0.85rem 1rem;
}

.card-title, .header-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

/* ── Tables ─────────────────────────────────────────────────── */
.table {
    font-size: 0.8rem;
    margin-bottom: 0;
}

.table th,
.table td {
    padding: 0.35rem 0.6rem;
    vertical-align: middle;
}

.table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.table-hover tbody tr:hover {
    background-color: rgba(98,110,212,0.04);
}

.table-responsive {
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 0.25rem;
}

.btn-lg {
    font-size: 0.9rem;
    padding: 0.5rem 1.25rem;
}

.btn-sm {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
}

.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-top-left-radius:  0.25rem; border-bottom-left-radius:  0.25rem; }
.btn-group .btn:last-child  { border-top-right-radius: 0.25rem; border-bottom-right-radius: 0.25rem; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-control,
.form-select {
    font-size: 0.82rem;
    padding: 0.35rem 0.65rem;
    border-radius: 0.25rem;
    border: 1px solid #ced4da;
}

.form-control:focus,
.form-select:focus {
    border-color: #626ed4;
    box-shadow: 0 0 0 0.15rem rgba(98,110,212,0.2);
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.form-text {
    font-size: 0.73rem;
}

.input-group-text {
    font-size: 0.82rem;
    padding: 0.35rem 0.65rem;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.28em 0.55em;
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
    font-size: 0.82rem;
    padding: 0.5rem 0.85rem;
    border-radius: 0.25rem;
    border-left: 3px solid;
    margin-bottom: 0.75rem;
}

.alert-success { border-left-color: #0acf97; }
.alert-danger  { border-left-color: #fa5c7c; }
.alert-info    { border-left-color: #39afd1; }
.alert-warning { border-left-color: #ffbc00; }

/* ── Breadcrumbs ────────────────────────────────────────────── */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
    font-size: 0.75rem;
}

.breadcrumb-item + .breadcrumb-item::before { content: ">"; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
    margin-bottom: 0;
    font-size: 0.8rem;
}

.pagination-rounded .page-link {
    border-radius: 30px !important;
    margin: 0 2px;
    padding: 0.25rem 0.55rem;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
    padding: 10px 0;
    font-size: 0.78rem;
    border-top: 1px solid #f1f3fa;
    background-color: #fafbfe;
}

.footer a { color: #626ed4; }
.footer-links a { margin-left: 1rem; color: #6c757d; }
.footer-links a:hover { color: #626ed4; }

/* ── Icons ──────────────────────────────────────────────────── */
.bi { vertical-align: middle; }

/* ── Folder rows (layouts/scripts) ─────────────────────────── */
.folder-row td { background-color: #f8f9fa; }

/* ── Scroll-to-top ──────────────────────────────────────────── */
#scrollToTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
    z-index: 1000;
    display: none;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* ── Dashboard quick-access cards ──────────────────────────── */
.quick-card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.quick-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .content { padding: 0.5rem 0.5rem 0; }

    .page-title-box { padding: 0.4rem 0 0.35rem; }
    .page-title { font-size: 0.95rem; }

    .card-body { padding: 0.65rem 0.75rem; }

    /* Action bar stacking */
    .action-bar {
        flex-direction: column;
        align-items: stretch !important;
    }
    .action-bar .btn-group,
    .action-bar .btn {
        width: 100%;
        border-radius: 0.25rem !important;
    }
    .action-bar .btn-group { display: flex; flex-direction: column; gap: 0.25rem; }
    .action-bar .btn-group .btn { border-radius: 0.25rem !important; }

    /* Script param input full-width on mobile */
    .script-form { flex-direction: column; gap: 0.35rem; }
    .script-form input { width: 100% !important; }

    .table { font-size: 0.75rem; }
    .table th, .table td { padding: 0.28rem 0.4rem; }

    .navbar-brand { font-size: 0.85rem; }

    .footer-links { display: none; }
}

@media (max-width: 575.98px) {
    body { font-size: 0.82rem; }
    .btn { font-size: 0.77rem; padding: 0.28rem 0.6rem; }
}

/* ── Dark mode ──────────────────────────────────────────────── */
[data-layout-color="dark"] .card            { background-color: #37404a; box-shadow: 0 1px 6px rgba(0,0,0,0.25); }
[data-layout-color="dark"] .table           { color: #aab8c5; }
[data-layout-color="dark"] .table thead th  { border-bottom-color: #464f5b; }
[data-layout-color="dark"] .footer          { background-color: #313a46; border-top-color: #464f5b; }
[data-layout-color="dark"] .folder-row td   { background-color: #2e3741; }
[data-layout-color="dark"] .page-title-box  { border-bottom-color: #464f5b; }
