/* ==========================================================================
   PB Down Timer – Single Firm Detail Page
   ========================================================================== */

/* ---------- Page wrapper & body/footer overrides ---------- */
.pb-dt-single {
    background-color: #15151f;
    min-height: 100vh;
}

/* Since the single page loads via template_redirect (no body class),
   target the footer via the adjacent sibling of .pb-dt-single */
.pb-dt-single ~ .site-footer,
.pb-dt-single + footer,
body:has(.pb-dt-single) .site-footer {
    background-color: #15151f;
}

body:has(.pb-dt-single) {
    background-color: #15151f;
}

/* ---------- Back link ---------- */
.pb-dt-single__back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b !important;
    text-decoration: none !important;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.pb-dt-single__back-link:hover {
    color: #94a3b8 !important;
}

/* ---------- Hero ---------- */
.pb-dt-single__hero {
    padding-top: 9rem !important;
}

.pb-dt-single__firm-logo {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    overflow: hidden;
    background-color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pb-dt-single__firm-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.pb-dt-single__firm-name {
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0;
    line-height: 1.2;
}

.pb-dt-single__last-incident {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.pb-dt-single__last-incident strong {
    color: #94a3b8;
}

/* ---------- Report Box ---------- */
.pb-dt-single__report-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background-color: #04224e;
    border: 3px solid #3286ff;
    border-radius: 14px;
    padding: 20px 32px;
}

.pb-dt-single__report-box-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
}

.pb-dt-single__report-box-count {
    font-size: 2.8rem;
    font-weight: 700;
    color: #3b82f6;
    line-height: 1;
}

/* ---------- Chart Section ---------- */
.pb-dt-single__chart-card {
    background-color: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 24px;
}

.pb-dt-single__chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.pb-dt-single__chart-subtitle {
    font-size: 0.8rem;
    color: #475569;
    margin-bottom: 4px;
}

.pb-dt-single__chart-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0;
}

.pb-dt-single__chart-wrapper {
    position: relative;
    height: 350px;
}

/* ---------- Chart period filters ---------- */
.pb-dt-chart-filters {
    display: flex;
    align-items: center;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.pb-dt-chart-filter {
    background: none;
    border: none;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    letter-spacing: 0.03em;
}

.pb-dt-chart-filter:hover {
    color: #e2e8f0;
}

.pb-dt-chart-filter--active {
    background-color: #3b82f6;
    color: #ffffff;
}

/* ---------- Section titles ---------- */
.pb-dt-single__section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0;
}

.pb-dt-single__section-title svg {
    flex-shrink: 0;
    color: #64748b;
}

/* ---------- Affected Firms Chips ---------- */
.pb-dt-single__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    background-color: #10223e;
    border: 1px solid #113e73;
    border-radius: 10px;
    color: #93c5fd !important;
    text-decoration: none !important;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pb-dt-single__chip:hover {
    background-color: #1a3058;
    border-color: #1d5cbf;
    color: #ffffff !important;
}

.pb-dt-single__chip-logo {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.pb-dt-single__no-affected {
    color: #475569;
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* ---------- Reports Card ---------- */
.pb-dt-single__reports-card {
    background-color: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 24px;
}

/* ---------- Add Report Button ---------- */
.pb-dt-single__add-report-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 36px;
    border-radius: 50px;
    border: none;
    background-color: #3b82f6;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pb-dt-single__add-report-btn:hover {
    background-color: #2563eb;
}

/* ---------- Report Items ---------- */
.pb-dt-single__report-item {
    padding: 18px;
    border: 1px solid #1e293b;
    border-radius: 12px;
    margin-bottom: 12px;
    background-color: #0f172a;
}

.pb-dt-single__report-item:last-child {
    margin-bottom: 0;
}

.pb-dt-single__report-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
}

.pb-dt-single__report-time {
    font-size: 0.8rem;
    color: #475569;
}

/* Delete report button */
.pb-dt-report-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #475569;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.pb-dt-report-delete-btn svg {
    width: 20px;
    height: 20px;
}

.pb-dt-report-delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Report badges */
.pb-dt-single__report-badges {
    margin-top: 8px;
}

.pb-dt-single__report-badge {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    background-color: #10223e;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 0.8rem;
    color: #137FEC;
    font-weight: 500;
    max-width: 100%;
}

.pb-dt-single__report-badge-label {
    color: #ffffff;
    font-weight: 600;
}

.pb-dt-single__report-badge-name {
    font-weight: 700;
}

.pb-dt-single__report-badge-logo {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    object-fit: cover;
}

/* Report description */
.pb-dt-single__report-desc {
    margin: 10px 0 0;
    font-size: 0.85rem;
    color: #ffffff;
    line-height: 1.5;
}

.pb-dt-single__no-reports {
    text-align: center;
    padding: 32px 0;
    color: #475569;
    font-size: 0.9rem;
}

/* ---------- View All Reports Link ---------- */
.pb-dt-single__view-all-link {
    color: #3b82f6 !important;
    text-decoration: none !important;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.pb-dt-single__view-all-link:hover {
    color: #60a5fa !important;
}

/* ---------- Pagination ---------- */
.pb-dt-single__pagination {
    padding-top: 12px;
}

.pb-dt-single__pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #1f1f30;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 10px 16px;
    gap: 16px;
}

.pb-dt-single__pagination-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pb-dt-single__page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pb-dt-single__page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 4px 10px;
    border-radius: 8px;
    background-color: transparent;
    border: none;
    color: #94a3b8 !important;
    text-decoration: none !important;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    gap: 6px;
}

.pb-dt-single__page-link:hover {
    background-color: #1e293b;
    color: #ffffff !important;
}

.pb-dt-single__page-link--active {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    border-radius: 8px;
}

.pb-dt-single__page-link--prev,
.pb-dt-single__page-link--next {
    color: #3b82f6 !important;
    font-weight: 600;
    font-size: 0.85rem;
    gap: 6px;
    padding: 4px 12px;
}

.pb-dt-single__page-link--prev:hover,
.pb-dt-single__page-link--next:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: #60a5fa !important;
}

.pb-dt-single__page-link--disabled {
    opacity: 0.4;
    pointer-events: none;
}

.pb-dt-single__page-link--prev svg,
.pb-dt-single__page-link--next svg {
    flex-shrink: 0;
}

.pb-dt-single__page-dots {
    color: #3b82f6;
    font-size: 1rem;
    padding: 0 6px;
    letter-spacing: 2px;
    line-height: 1;
}

/* Go To Page */
.pb-dt-single__pagination-goto {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.pb-dt-single__pagination-goto-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}

.pb-dt-single__pagination-goto-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: transparent;
}

.pb-dt-single__pagination-goto-input {
    width: 32px;
    height: 32px;
    background-color: #1e293b;
    border: 1px solid #475569;
    border-radius: 8px;
    outline: none;
    color: #3b82f6;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    -moz-appearance: textfield;
}

.pb-dt-single__pagination-goto-input:focus {
    border-color: #3b82f6;
}

.pb-dt-single__pagination-goto-input::-webkit-outer-spin-button,
.pb-dt-single__pagination-goto-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pb-dt-single__pagination-goto-total {
    color: #3b82f6;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ---------- Historical Incidents Card ---------- */
.pb-dt-single__incidents-card {
    background-color: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 24px;
    min-height: 300px;
}

/* ---------- Historical Incidents Timeline ---------- */
.pb-dt-single__incidents-timeline {
    position: relative;
    padding-left: 28px;
}

.pb-dt-single__incidents-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    background-color: #1e293b;
}

.pb-dt-single__incident {
    position: relative;
    padding-bottom: 24px;
}

.pb-dt-single__incident:last-child {
    padding-bottom: 0;
}

.pb-dt-single__incident--hidden {
    display: none;
}

.pb-dt-single__incident-dot {
    position: absolute;
    left: -28px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #6b7280;
    background-color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.pb-dt-single__incident-dot-inner {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #6b7280;
}

.pb-dt-single__incident-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pb-dt-single__incident-date {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #64748b;
}

.pb-dt-single__incident-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0;
}

.pb-dt-single__incident-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.pb-dt-single__incident-severity {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 4px;
}

.pb-dt-single__incident-severity--severe {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.pb-dt-single__incident-severity--partial {
    background-color: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.pb-dt-single__incident-severity--planned {
    background-color: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

.pb-dt-single__incident-duration {
    font-size: 0.85rem;
    color: #64748b;
}

.pb-dt-single__incident-desc {
    margin: 6px 0 0;
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.5;
}

.pb-dt-single__incidents-expand {
    background: none;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 10px 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.pb-dt-single__incidents-expand:hover {
    background-color: rgba(148, 163, 184, 0.08);
    border-color: #475569;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .pb-dt-single__firm-name {
        font-size: 1.6rem;
    }

    .pb-dt-single__report-box {
        padding: 16px 24px;
    }

    .pb-dt-single__report-box-count {
        font-size: 2rem;
    }

    .pb-dt-single__chart-wrapper {
        height: 280px;
    }
}

@media (max-width: 767.98px) {
    .pb-dt-single__firm-name {
        font-size: 1.5rem;
    }

    .pb-dt-single__firm-logo {
        width: 48px;
        height: 48px;
    }

    .pb-dt-single__chart-header {
        flex-direction: column;
    }

    .pb-dt-single__chart-title {
        font-size: 0.9rem;
    }

    .pb-dt-single__chart-wrapper {
        height: 220px;
    }

    .pb-dt-single__chart-card {
        padding: 18px;
    }

    .pb-dt-single__pagination-bar {
        flex-direction: column;
        gap: 12px;
    }

    .pb-dt-single__pagination-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pb-dt-single__report-box {
        width: 100%;
        text-align: center;
    }

    .pb-dt-single__add-report-btn {
        width: 100%;
    }

    .pb-dt-single__reports-card {
        padding: 18px;
    }

    .pb-dt-single__incidents-card {
        padding: 18px;
    }

    .pb-dt-single__report-item {
        padding: 14px;
    }

    .pb-dt-single__section-title {
        font-size: 1.05rem;
    }

    .pb-dt-single__report-badge {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    .pb-dt-single__report-desc {
        font-size: 0.8rem;
    }

    .pb-dt-single__page-link {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    .pb-dt-single__page-link--prev,
    .pb-dt-single__page-link--next {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}
