/**
 * C-Jadwal Sidang Stylesheet
 * Responsive iOS Soft Glassmorphism Design
 * Package: PN-RED SUITE
 * Author: Catur Adi Sukrisno
 */

:root {
    --c-js-bg: #ffffff;
    --c-js-primary: #9a2109;
    --c-js-primary-dark: #701402;
    --c-js-secondary: #1e293b;
    --c-js-text: #0f172a;
    --c-js-muted: #64748b;
    --c-js-border: #e2e8f0;
    --c-js-soft-red: rgba(154, 33, 9, 0.08);
    --c-js-soft-border: rgba(154, 33, 9, 0.15);
}

.c-jadwal-sidang-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--c-js-text);
    margin-bottom: 24px;
}

.c-jadwal-sidang-wrapper *,
.c-jadwal-sidang-wrapper *::before,
.c-jadwal-sidang-wrapper *::after {
    box-sizing: border-box;
}

/* Header Widget */
.c-js-widget-header {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--c-js-primary);
}

.c-js-widget-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--c-js-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.3px;
}

.c-js-alert-warning {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    color: #b45309;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Filter & Stat Bar */
.c-js-filter-section {
    background: #ffffff;
    border: 1px solid var(--c-js-border);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.c-js-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.c-js-filter-left {
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.c-js-filter-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--c-js-muted);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.c-js-filter-label i {
    color: var(--c-js-primary);
    margin-right: 4px;
}

.c-js-form-control {
    width: 100% !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
    font-size: 13.5px !important;
    color: var(--c-js-secondary) !important;
    font-weight: 600 !important;
    outline: none !important;
    transition: all 0.2s ease !important;
}

.c-js-form-control:focus {
    background: #ffffff !important;
    border-color: var(--c-js-primary) !important;
    box-shadow: 0 0 0 3px rgba(154, 33, 9, 0.12) !important;
}

.c-js-filter-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.c-js-stat-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.c-js-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--c-js-border);
    border-radius: 12px;
    padding: 6px 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.c-js-stat-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.c-js-stat-total {
    background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
    border-color: var(--c-js-soft-border);
}

.c-js-stat-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--c-js-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.c-js-stat-content {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-align: left;
}

.c-js-stat-total strong {
    color: var(--c-js-primary);
    font-size: 16px;
    font-weight: 800;
}

.c-js-stat-total small {
    color: var(--c-js-primary-dark);
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
}

.c-js-stat-pidana {
    background: #fffafa;
    border-color: rgba(220, 53, 69, 0.2);
}

.c-js-stat-pidana strong {
    color: #dc3545;
    font-size: 15px;
    font-weight: 800;
}

.c-js-stat-pidana small {
    color: #64748b;
    font-size: 10px;
    text-transform: uppercase;
}

.c-js-stat-perdata {
    background: #f8fbff;
    border-color: rgba(13, 110, 253, 0.2);
}

.c-js-stat-perdata strong {
    color: #0d6efd;
    font-size: 15px;
    font-weight: 800;
}

.c-js-stat-perdata small {
    color: #64748b;
    font-size: 10px;
    text-transform: uppercase;
}

.c-js-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.c-js-dot-pidana {
    background: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.c-js-dot-perdata {
    background: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2);
}

/* Card Container (Lebar 100%, Tinggi Fleksibel) */
.c-js-card-container {
    width: 100% !important;
    background: #ffffff;
    border: 1px solid var(--c-js-border);
    border-radius: 14px;
    overflow-x: auto;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    position: relative;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.c-js-card-container.is-dragging {
    cursor: grabbing !important;
}

.c-js-card-container.is-dragging * {
    cursor: grabbing !important;
    user-select: none;
}

.c-js-card-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.c-js-card-container::-webkit-scrollbar-track {
    background: rgba(154, 33, 9, 0.04);
    border-radius: 4px;
}

.c-js-card-container::-webkit-scrollbar-thumb {
    background: rgba(154, 33, 9, 0.3);
    border-radius: 4px;
}

.c-js-card-container::-webkit-scrollbar-thumb:hover {
    background: var(--c-js-primary);
}

/* Table Styling */
.c-js-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    font-size: 13.5px;
    text-align: left;
}

.c-js-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.c-js-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8fafc;
    border-bottom: 2px solid var(--c-js-border);
    color: var(--c-js-secondary);
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.c-js-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
}

.c-js-table tr:nth-child(even) {
    background: #fafafa;
}

.c-js-table tr:hover {
    background: #fff8f5;
}

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

.c-js-no-perkara {
    font-weight: 700;
    color: var(--c-js-primary);
}

.c-js-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-pidana {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-perdata {
    background: #dbeafe;
    color: #1d4ed8;
}

.c-js-btn-detail {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    background: #f1f5f9;
    color: var(--c-js-primary);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none !important;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.c-js-btn-detail:hover {
    background: var(--c-js-primary);
    color: #ffffff !important;
    border-color: var(--c-js-primary);
}

.c-js-table tr.c-js-empty-row,
.c-js-table tr.c-js-empty-row:hover {
    background: transparent !important;
}

.c-js-empty-state {
    padding: 40px 20px !important;
    text-align: center !important;
    vertical-align: middle !important;
    color: #64748b;
    font-size: 13.5px;
    background: transparent !important;
}

.c-js-empty-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 auto;
    width: 100%;
}

.c-js-empty-state i {
    color: var(--c-js-primary);
    opacity: 0.45;
    font-size: 38px;
    margin: 0 auto 12px auto;
    display: block;
    text-align: center;
}

.c-js-empty-state p {
    margin: 0 auto;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    text-align: center;
    max-width: 480px;
    line-height: 1.5;
}

.text-danger { color: #dc3545; font-weight: 600; }
.text-success { color: #16a34a; font-weight: 600; }

/* Slide Row Animation */
.c-js-table-body tr {
    transition: transform 0.45s ease, opacity 0.45s ease;
}

.c-js-slide-out {
    transform: translateY(-100%);
    opacity: 0;
}

.c-js-highlight-row {
    background: #fee2e2 !important;
    font-weight: 600;
}

/* Modal Detail Pihak */
.c-js-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    z-index: 999999;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    padding: 16px;
    box-sizing: border-box;
}

.c-js-modal-overlay.active {
    display: flex;
}

.c-js-modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 480px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: cJsModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cJsModalIn {
    from { opacity: 0; transform: scale(0.92) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.c-js-modal-header {
    background: linear-gradient(135deg, #701402 0%, #9a2109 100%);
    padding: 16px 20px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    color: #ffffff;
}

.c-js-modal-body {
    padding: 20px 24px;
    max-height: 65vh;
    overflow-y: auto;
    font-size: 13.5px;
    color: #334155;
    line-height: 1.55;
}

.c-js-pihak-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--c-js-primary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.c-js-pihak-title::before {
    content: "";
    width: 4px;
    height: 12px;
    background: var(--c-js-primary);
    border-radius: 2px;
}

.c-js-pihak-content {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

.c-js-list-unstyled {
    margin: 0;
    padding: 0;
    list-style: none;
}

.c-js-list-unstyled li {
    padding: 3px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.c-js-list-unstyled li:last-child {
    border-bottom: none;
}

.c-js-vs-divider {
    text-align: center;
    margin: 12px 0;
    color: var(--c-js-primary);
    font-size: 11px;
    font-weight: 800;
    position: relative;
}

.c-js-vs-divider::before,
.c-js-vs-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: var(--c-js-border);
}

.c-js-vs-divider::before { left: 0; }
.c-js-vs-divider::after { right: 0; }

.c-js-modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 10px 16px;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
}

.c-js-btn-modal-close {
    background: var(--c-js-primary);
    color: #ffffff;
    border: none;
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.c-js-btn-modal-close:hover {
    background: var(--c-js-primary-dark);
}

/* Responsive Mobile Layout (Stacked Table) */
@media (max-width: 768px) {
    .c-js-filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    .c-js-filter-left {
        max-width: 100%;
    }
    .c-js-filter-right {
        align-items: flex-start;
    }
    .c-js-table thead {
        display: none;
    }
    .c-js-table,
    .c-js-table-body,
    .c-js-table tr,
    .c-js-table td {
        display: block;
        width: 100%;
    }
    .c-js-table tr {
        border-bottom: 8px solid #f1f5f9;
        padding: 8px 0;
    }
    .c-js-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 14px;
        border-bottom: 1px dashed #f1f5f9;
        text-align: right;
    }
    .c-js-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #64748b;
        font-size: 11px;
        text-transform: uppercase;
        text-align: left;
        flex: 0 0 110px;
    }
    .c-js-table td[data-label="Para Pihak"],
    .c-js-table td[data-label="Nomor Perkara"] {
        text-align: right;
    }
    .c-js-table tr.c-js-empty-row {
        border-bottom: none !important;
        padding: 0 !important;
    }
    .c-js-table td.c-js-empty-state {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 36px 16px !important;
        border: none !important;
    }
    .c-js-table td.c-js-empty-state::before {
        display: none !important;
    }
    .c-js-table td.c-js-empty-state .c-js-empty-inner {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }
    .c-js-table td.c-js-empty-state p {
        text-align: center !important;
    }
}
