/* =====================================================================
   GeoPORTAL BPTD Jabar — Modul Angkutan Perintis Styles (perintis.css)
   ===================================================================== */

/* Map Card & Container */
.perintis-map-card {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.perintis-map-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.perintis-legend-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.legend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    background: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.legend-green {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.legend-amber {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.legend-red {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.legend-dot-solid {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}

.perintis-map-container {
    width: 100%;
    height: 420px;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
    background: #0f172a;
}

/* Filter Bar */
.perintis-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.search-input-wrap {
    position: relative;
    flex: 1 1 260px;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.1rem;
    height: 1.1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.55rem 0.75rem 0.55rem 2.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: #ffffff;
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
    border-color: var(--primary, #0284c7);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.filter-select-wrap {
    flex: 0 1 210px;
}

.filter-select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: #ffffff;
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.filter-select:focus {
    border-color: var(--primary, #0284c7);
}

/* Corridors Grid */
.perintis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.perintis-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.perintis-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-light, #7dd3fc);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.perintis-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.perintis-card-title-group {
    min-width: 0;
}

.perintis-card-badges {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.perintis-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
}

.perintis-card-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Badges */
.badge-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e2e8f0;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.badge-endpoint-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.badge-lf-pill {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 9999px;
    flex: none;
    letter-spacing: 0.02em;
}

.badge-lf-green {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.badge-lf-amber {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.badge-lf-red {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Card Stats Grid */
.perintis-card-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.perintis-stat-box {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.perintis-stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
}

.perintis-stat-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.perintis-stat-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Card Actions */
.perintis-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-top: 1px solid var(--border-light, #e2e8f0);
    padding-top: 0.85rem;
}

.btn-card-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-primary);
}

.btn-card-action:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-card-action-primary {
    background: var(--primary, #0284c7);
    color: #ffffff;
    border-color: var(--primary, #0284c7);
}

.btn-card-action-primary:hover {
    background: var(--primary-hover, #0369a1);
    border-color: var(--primary-hover, #0369a1);
}

/* Modal Dialog */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
}

.modal-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 92%;
    max-width: 900px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.modal-title-group {
    min-width: 0;
}

.modal-badge-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 0.375rem;
    transition: color 0.15s ease, background-color 0.15s ease;
    flex: none;
}

.modal-close-btn:hover {
    color: var(--text-primary);
    background: #e2e8f0;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}

.modal-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.modal-stat-card {
    padding: 0.85rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.modal-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.modal-stat-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-stat-mono {
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
}

.modal-stat-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.text-green {
    color: #059669 !important;
}

/* Monthly Table */
.monthly-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}

.monthly-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    text-align: left;
}

.monthly-table th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 600;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.monthly-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-primary);
    white-space: nowrap;
}

.monthly-table tr:last-child td {
    border-bottom: none;
}

.monthly-table tr:hover td {
    background: #f8fafc;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

.btn-primary-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 0.375rem;
    background: var(--primary, #0284c7);
    color: #ffffff;
    border: 1px solid var(--primary, #0284c7);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-primary-sm:hover {
    background: var(--primary-hover, #0369a1);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 0.375rem;
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-secondary:hover {
    background: #f1f5f9;
}

/* Empty state */
.perintis-empty {
    grid-column: 1 / -1;
    padding: 3rem 1.5rem;
    text-align: center;
    background: #f8fafc;
    border: 1px dashed var(--border);
    border-radius: 0.75rem;
}

.perintis-empty-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.perintis-empty-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .perintis-map-container {
        height: 320px;
    }

    .perintis-grid {
        grid-template-columns: 1fr;
    }

    .perintis-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-select-wrap {
        flex: 1 1 auto;
    }

    .modal-dialog {
        width: 96%;
        max-height: 94vh;
    }
}
