a {
    text-decoration: none !important;
}

.card-menu a {
    margin-bottom: 8px;
    margin-right: 8px;
}

.swal2-popup {
    font-size: .8rem !important;
}

.choices {
    z-index: 99;
}

.te {
    position: absolute;
    width: 100%;
    background: white;
    /* height: 200px; */
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 8;
    opacity: .8;
}

.loader {
    border: 6px solid #f3f3f3;
    border-radius: 50%;
    border-top: 4px solid #1c60cc;
    width: 60px;
    height: 60px;
    -webkit-animation: spin .5s linear infinite;
    animation: spin .5s linear infinite;
    margin: auto;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    position: absolute;
    z-index: 9;
}

@-webkit-keyframes spin {
    0% {
        -webkit-transform: rotate(0deg);
    }

    100% {
        -webkit-transform: rotate(360deg);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.select2-selection__rendered {
    line-height: 31px !important;
}

.select2-container .select2-selection--single {
    height: 35px !important;
}

.select2-selection__arrow {
    height: 34px !important;
}

.log-area {
    font-size: 11px;
    outline: none !important;
    border: none !important;
    color: #f6f8fb;
    background: #182433 !important;
    border-radius: 5px;
}

.chapter-item {}

.chapter-item .form-selectgroup-label {
    min-width: 200px !important;
    min-height: 74px !important;
}

/* settings panel */
.setting-wrapper {
    margin-bottom: 3rem;
}
.setting-list {
    margin-top: 5px;
    padding: 12px 0;
    border-bottom: .1px solid rgb(216, 214, 214);
}
.setting-list .card-subtitle {
    margin-top: 2px;
    font-size: 0.8rem;
}

.supported-site-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.supported-site-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    flex-shrink: 0;
}

.header-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.supported-site-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.supported-site-list .setting-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0;
    padding: 0.875rem 1rem;
    border: 1px solid #e6e8eb;
    border-radius: 0.75rem;
    background: #fff;
}

.source-row-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.source-row-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eef0f2;
}

.source-main {
    min-width: 0;
    cursor: pointer;
}

.source-main .card-title {
    font-size: 1rem;
    line-height: 1.2;
}

.source-switches {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.source-switch {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding-left: 2.5rem;
    white-space: nowrap;
}

.source-fields {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.source-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.source-action-test {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.source-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.source-field-interval {
    width: 96px;
}

.source-field-limit {
    width: 96px;
}

.source-field .form-hint {
    margin-top: 0.125rem;
    font-size: 0.75rem;
    line-height: 1.1;
}

.source-field input[type="number"] {
    min-width: 0;
}

.storage-page-header,
.storage-config-heading,
.storage-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.storage-page-header {
    margin-bottom: 1.5rem;
}

.storage-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid #dbe2ea;
    border-radius: 999px;
    color: #206bc4;
    background: #f6f8fb;
    font-size: 0.875rem;
    white-space: nowrap;
}

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: #2fb344;
}

.storage-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.storage-mode-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid #e6e8eb;
    border-radius: 0.75rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.storage-mode-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.storage-mode-card.active {
    border-color: #206bc4;
    box-shadow: 0 0 0 1px rgba(32, 107, 196, 0.12);
}

.storage-mode-title {
    font-weight: 700;
    color: #1f2937;
}

.storage-mode-desc {
    color: #667085;
    font-size: 0.875rem;
    line-height: 1.45;
}

.storage-config-card {
    padding: 1.25rem;
    border: 1px solid #e6e8eb;
    border-radius: 0.75rem;
    background: #fff;
}

.storage-config-heading {
    margin-bottom: 1rem;
}

.storage-setup {
    border-top: 1px solid #e6e8eb;
    padding-top: 1rem;
}

.storage-setup summary {
    cursor: pointer;
    color: #206bc4;
    font-weight: 600;
}

.storage-setup pre {
    margin: 0.75rem 0 0;
    padding: 1rem;
    border-radius: 0.5rem;
    background: #0d1117;
    color: #c9d1d9;
    white-space: pre-wrap;
    font-size: 0.8125rem;
}

.storage-setup code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.storage-actions {
    justify-content: flex-start;
    align-items: center;
    margin-top: 1rem;
}

@media (max-width: 991.98px) {
    .supported-site-header {
        flex-direction: column;
        align-items: stretch;
    }

    .source-row-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .source-actions {
        justify-content: flex-start;
    }

    .storage-page-header,
    .storage-config-heading,
    .storage-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .storage-mode-grid {
        grid-template-columns: 1fr;
    }
}

.setting-wrapper .card-title {
    font-weight: 400;
}

.detail-chapter .card{
    min-height: 130px !important;
}

/* ============================================
   DARK MODE
   ============================================ */
[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .page {
    background-color: #1a1d23;
    color: #d2d4d7;
}

[data-bs-theme="dark"] .navbar,
[data-bs-theme="dark"] .navbar-light {
    background-color: #1e2128 !important;
    border-color: #2c3038 !important;
}

[data-bs-theme="dark"] .navbar-brand,
[data-bs-theme="dark"] .nav-link,
[data-bs-theme="dark"] .nav-link-title,
[data-bs-theme="dark"] .dropdown-item {
    color: #d2d4d7 !important;
}

[data-bs-theme="dark"] .nav-link:hover,
[data-bs-theme="dark"] .dropdown-item:hover {
    color: #fff !important;
    background-color: #2c3038 !important;
}

[data-bs-theme="dark"] .nav-item.active .nav-link {
    color: #fff !important;
}

[data-bs-theme="dark"] .card {
    background-color: #1e2128;
    border-color: #2c3038;
    color: #d2d4d7;
}

[data-bs-theme="dark"] .card-body,
[data-bs-theme="dark"] .card-footer {
    background-color: #1e2128;
    color: #d2d4d7;
}

[data-bs-theme="dark"] .card-title,
[data-bs-theme="dark"] .page-title,
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3, [data-bs-theme="dark"] h4 {
    color: #e8eaed !important;
}

[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .card-subtitle {
    color: #8b8f96 !important;
}

[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark"] .font-weight-medium {
    color: #d2d4d7 !important;
}

[data-bs-theme="dark"] .text-secondary {
    color: #8b8f96 !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] textarea.form-control {
    background-color: #262a31;
    border-color: #3a3f47;
    color: #d2d4d7;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #6c7078;
}

[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-control[readonly],
[data-bs-theme="dark"] .bg-light {
    background-color: #20242b !important;
    border-color: #303641 !important;
    color: #8b8f96 !important;
    opacity: 1;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #2c3038;
    border-color: #4a6fa5;
    color: #e8eaed;
}

[data-bs-theme="dark"] .form-label {
    color: #d2d4d7;
}

[data-bs-theme="dark"] .input-group-text {
    color: #d2d4d7;
    background-color: #262a31;
    border-color: #3a3f47;
}

[data-bs-theme="dark"] .form-hint {
    color: #6c7078 !important;
}

[data-bs-theme="dark"] .form-selectgroup-label {
    background-color: #262a31;
    border-color: #3a3f47;
    color: #d2d4d7;
}

[data-bs-theme="dark"] .form-selectgroup-input:checked + .form-selectgroup-label {
    background-color: #2c5282;
    border-color: #4a6fa5;
    color: #fff;
}

[data-bs-theme="dark"] .list-group-item {
    background-color: #1e2128;
    border-color: #2c3038;
    color: #d2d4d7;
}

[data-bs-theme="dark"] .list-group-item-action:hover,
[data-bs-theme="dark"] .list-group-item-action:focus {
    background-color: #262a31;
    color: #e8eaed;
}

[data-bs-theme="dark"] .list-group-item.active {
    background-color: #2c5282;
    border-color: #4a6fa5;
    color: #fff;
}

[data-bs-theme="dark"] .table,
[data-bs-theme="dark"] .table th,
[data-bs-theme="dark"] .table td {
    color: #d2d4d7;
    border-color: #2c3038;
}

[data-bs-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background-color: #22262d;
}

[data-bs-theme="dark"] .table thead th {
    background-color: #1a1d23;
    border-color: #2c3038;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #262a31;
    border-color: #3a3f47;
}

[data-bs-theme="dark"] .dropdown-menu .dropdown-item {
    color: #d2d4d7 !important;
}

[data-bs-theme="dark"] .dropdown-menu .dropdown-item:hover {
    background-color: #2c3038 !important;
}

[data-bs-theme="dark"] .border-end {
    border-color: #2c3038 !important;
}

[data-bs-theme="dark"] hr {
    border-color: #2c3038;
}

[data-bs-theme="dark"] .alert-info {
    background-color: #1a2e40;
    border-color: #2c5282;
    color: #90cdf4;
}

[data-bs-theme="dark"] .alert-info a {
    color: #63b3ed;
}

[data-bs-theme="dark"] .footer {
    background-color: #1a1d23;
    border-color: #2c3038;
}

[data-bs-theme="dark"] .te {
    background: #1a1d23;
}

[data-bs-theme="dark"] .setting-list {
    border-bottom-color: #2c3038;
}

[data-bs-theme="dark"] .supported-site-list .setting-list {
    background: #20242b;
    border-color: #303641;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
}

[data-bs-theme="dark"] .supported-site-list .setting-list:hover {
    background: #232933;
    border-color: #3b4552;
}

[data-bs-theme="dark"] .source-row-bottom {
    border-top-color: #2c3038;
}

[data-bs-theme="dark"] .storage-status-pill {
    background: #172033;
    border-color: #2f4f7f;
    color: #8ab4f8;
}

[data-bs-theme="dark"] .storage-mode-card,
[data-bs-theme="dark"] .storage-config-card {
    background: #20242b;
    border-color: #303641;
}

[data-bs-theme="dark"] .storage-mode-card:hover,
[data-bs-theme="dark"] .storage-mode-card.active {
    background: #232933;
    border-color: #4a6fa5;
    box-shadow: 0 0 0 1px rgba(99, 179, 237, 0.08);
}

[data-bs-theme="dark"] .storage-mode-title {
    color: #e8eaed;
}

[data-bs-theme="dark"] .storage-mode-desc {
    color: #9aa4b2;
}

[data-bs-theme="dark"] .storage-setup {
    border-top-color: #303641;
}

[data-bs-theme="dark"] .storage-setup summary {
    color: #8ab4f8;
}

[data-bs-theme="dark"] .btn-outline-primary {
    color: #63b3ed;
    border-color: #63b3ed;
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
    background-color: #2c5282;
    color: #fff;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: #cbd5e1;
    border-color: #475569;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background-color: #334155;
    border-color: #64748b;
    color: #fff;
}

[data-bs-theme="dark"] .form-check-input {
    background-color: #1e2329;
    border: 2px solid #6c757d;
}

[data-bs-theme="dark"] .form-check-input:checked {
    background-color: #206bc4;
    border-color: #206bc4;
}

[data-bs-theme="dark"] .form-switch .form-check-input:not(:checked) {
    background-color: #4a5058;
    border: 2px solid #6c757d;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--single {
    background-color: #262a31;
    border-color: #3a3f47;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #d2d4d7;
}

[data-bs-theme="dark"] .select2-container--default .select2-dropdown {
    background-color: #1e2329;
    border-color: #3a3f47;
}

[data-bs-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: #262a31;
    border-color: #3a3f47;
    color: #d2d4d7;
}

[data-bs-theme="dark"] .select2-container--default .select2-results__option {
    color: #d2d4d7;
}

[data-bs-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #206bc4;
    color: #fff;
}

[data-bs-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: #2c3640;
    color: #d2d4d7;
}

.chapter-picker {
    max-height: 320px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.05);
}

.chapter-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
}

.chapter-picker-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.5rem 0.625rem;
    border: 1px solid rgba(101, 109, 119, 0.24);
    border-radius: 0.375rem;
    cursor: pointer;
    user-select: none;
}

.chapter-picker-item:hover {
    border-color: #206bc4;
    background: rgba(32, 107, 196, 0.08);
}

[data-bs-theme="dark"] .chapter-picker {
    background: #171b21;
    border-color: #3a3f47 !important;
}

[data-bs-theme="dark"] .chapter-picker-item {
    background: #20252d;
    border-color: #343a44;
    color: #d2d4d7;
}

[data-bs-theme="dark"] .chapter-picker-item:hover {
    background: #263447;
    border-color: #206bc4;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background-color: #262a31;
    border-color: #3a3f47;
    color: #d2d4d7;
}

[data-bs-theme="dark"] .page-item .page-link {
    background-color: #262a31;
    border-color: #3a3f47;
    color: #d2d4d7;
}

[data-bs-theme="dark"] .page-item.active .page-link {
    background-color: #2c5282;
    border-color: #4a6fa5;
}

[data-bs-theme="dark"] code {
    color: #f0abfc;
    background-color: #2c2035;
    padding: 2px 5px;
    border-radius: 3px;
}

[data-bs-theme="dark"] pre {
    background-color: #0d1117 !important;
    color: #c9d1d9 !important;
    border: 1px solid #2c3038;
    border-radius: 6px;
    padding: 12px;
}

[data-bs-theme="dark"] pre code {
    background: none;
    color: #c9d1d9;
    padding: 0;
}

[data-bs-theme="dark"] .bg-red-lt {
    background-color: rgba(210, 47, 47, 0.12) !important;
    color: #f87171 !important;
}

[data-bs-theme="dark"] .bg-red-lt b,
[data-bs-theme="dark"] .bg-red-lt p {
    color: #fca5a5 !important;
}

[data-bs-theme="dark"] .bg-red-lt .btn {
    background-color: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

[data-bs-theme="dark"] .bg-red-lt .btn:hover {
    background-color: #b91c1c;
}

/* ============================================
   DARK MODE — SweetAlert2
   ============================================ */
[data-bs-theme="dark"] .swal2-popup {
    background-color: #1e2128 !important;
    color: #d2d4d7 !important;
    border: 1px solid #2c3038;
}

[data-bs-theme="dark"] .swal2-title,
[data-bs-theme="dark"] .swal2-header .swal2-title {
    color: #e8eaed !important;
}

[data-bs-theme="dark"] .swal2-html-container,
[data-bs-theme="dark"] .swal2-content {
    color: #d2d4d7 !important;
}

[data-bs-theme="dark"] .swal2-close {
    color: #8b8f96 !important;
}

[data-bs-theme="dark"] .swal2-close:hover {
    color: #e8eaed !important;
}

[data-bs-theme="dark"] .swal2-input,
[data-bs-theme="dark"] .swal2-textarea,
[data-bs-theme="dark"] .swal2-select,
[data-bs-theme="dark"] .swal2-file {
    background-color: #262a31 !important;
    border-color: #3a3f47 !important;
    color: #d2d4d7 !important;
}

[data-bs-theme="dark"] .swal2-input:focus,
[data-bs-theme="dark"] .swal2-textarea:focus,
[data-bs-theme="dark"] .swal2-select:focus {
    border-color: #4a6fa5 !important;
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.25) !important;
}

[data-bs-theme="dark"] .swal2-validation-message {
    background-color: #262a31 !important;
    color: #fca5a5 !important;
}

[data-bs-theme="dark"] .swal2-footer {
    border-top-color: #2c3038 !important;
    color: #d2d4d7 !important;
}

[data-bs-theme="dark"] .swal2-timer-progress-bar {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

[data-bs-theme="dark"] .swal2-loader {
    border-color: #4a6fa5 transparent #4a6fa5 transparent !important;
}

/* Backdrop sedikit lebih gelap di dark mode */
[data-bs-theme="dark"] .swal2-container {
    background-color: rgba(0, 0, 0, 0.55) !important;
}

/* Icon success — sesuaikan ring & background biar nggak kontras putih */
[data-bs-theme="dark"] .swal2-icon.swal2-success {
    border-color: #2f6f4a !important;
    color: #4ade80 !important;
}

[data-bs-theme="dark"] .swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: #4ade80 !important;
}

[data-bs-theme="dark"] .swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(74, 222, 128, 0.3) !important;
}

[data-bs-theme="dark"] .swal2-icon.swal2-success [class^='swal2-success-circular-line'],
[data-bs-theme="dark"] .swal2-icon.swal2-success .swal2-success-fix {
    background-color: #1e2128 !important;
}

/* Icon error */
[data-bs-theme="dark"] .swal2-icon.swal2-error {
    border-color: #dc2626 !important;
    color: #f87171 !important;
}

[data-bs-theme="dark"] .swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
    background-color: #f87171 !important;
}

/* Icon warning */
[data-bs-theme="dark"] .swal2-icon.swal2-warning {
    border-color: #d97706 !important;
    color: #fbbf24 !important;
}

/* Icon info */
[data-bs-theme="dark"] .swal2-icon.swal2-info {
    border-color: #4a6fa5 !important;
    color: #63b3ed !important;
}

/* Icon question */
[data-bs-theme="dark"] .swal2-icon.swal2-question {
    border-color: #8b8f96 !important;
    color: #d2d4d7 !important;
}

/* ============================================
   DARK MODE — Bootstrap Modal
   ============================================ */
[data-bs-theme="dark"] .modal-content {
    background-color: #1e2128;
    border-color: #2c3038;
    color: #d2d4d7;
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    background-color: #1e2128;
    border-color: #2c3038;
    color: #e8eaed;
}

[data-bs-theme="dark"] .modal-title {
    color: #e8eaed;
}

[data-bs-theme="dark"] .modal-body {
    background-color: #1e2128;
    color: #d2d4d7;
}

[data-bs-theme="dark"] .modal-header .btn-close,
[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.7;
}

[data-bs-theme="dark"] .btn-close:hover {
    opacity: 1;
}

[data-bs-theme="dark"] .modal-backdrop {
    background-color: #000;
}

[data-bs-theme="dark"] .modal-backdrop.show {
    opacity: 0.65;
}

/* Highlighted/selected URL block (mark / pre dengan latar terang) di modal */
[data-bs-theme="dark"] .modal-content mark,
[data-bs-theme="dark"] .modal-body mark {
    background-color: #2c5282;
    color: #e8eaed;
    padding: 2px 4px;
    border-radius: 3px;
}

/* DataTable di dalam modal — pastikan header gelap */
[data-bs-theme="dark"] .modal-body table.dataTable thead th,
[data-bs-theme="dark"] .modal-body .table thead th {
    background-color: #15171c !important;
    color: #e8eaed !important;
    border-color: #2c3038 !important;
}

[data-bs-theme="dark"] .modal-body table.dataTable tbody tr,
[data-bs-theme="dark"] .modal-body .table tbody tr {
    background-color: #1e2128;
    color: #d2d4d7;
}

[data-bs-theme="dark"] .modal-body table.dataTable tbody tr:hover,
[data-bs-theme="dark"] .modal-body .table tbody tr:hover {
    background-color: #262a31;
}
