/*
 * CSS for Announcements Redesign (DOAE-HRCS)
 * Compliance with Design System tokens
 */

/* 1. Animations */
@keyframes ds-blink {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.3;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.blink-badge {
    animation: ds-blink 2s infinite ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 2. Series Accordion Dropdown on Cards */
.series-accordion {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 8px 12px;
    background: #fdfdfd;
}

.series-accordion-toggle {
    font-size: 13px;
    font-weight: 600;
    color: #005490;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.series-accordion-toggle:hover {
    color: #f76707;
}

.series-accordion-content {
    display: none;
    margin-top: 8px;
    padding-left: 8px;
    border-left: 2px solid #005490;
}

.series-accordion-content.show {
    display: block;
}

.series-link-item {
    display: block;
    font-size: 12px;
    color: #495057;
    padding: 4px 0;
    transition: color 0.2s;
    text-decoration: none;
}

.series-link-item:hover {
    color: #f76707;
    text-decoration: underline;
}

/* 3. News Timeline (Detail View) */
.news-timeline {
    margin: 20px 0;
    padding-left: 20px;
    border-left: 3px solid #e9ecef;
    position: relative;
}

.news-timeline-item {
    margin-bottom: 20px;
    position: relative;
}

.news-timeline-item::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 4px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background-color: #adb5bd;
    border: 2px solid #fff;
    transition: all 0.2s;
}

.news-timeline-item.active::before {
    background-color: #005490;
    box-shadow: 0 0 0 3px rgba(0, 84, 144, 0.25);
    transform: scale(1.2);
}

.news-timeline-item.active .news-timeline-title {
    color: #005490;
    font-weight: bold;
}

.news-timeline-title {
    font-size: 14px;
    color: #495057;
    margin-bottom: 4px;
}

.news-timeline-date {
    font-size: 12px;
    color: #868e96;
}

.news-timeline-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-timeline-link:hover .news-timeline-title {
    color: #f76707;
}

/* Aspect ratio protection for detail page cover */
.detail-cover-container {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.detail-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ═══════════════════════════════════════════════════
   4. Pin Overlay (Thumbnail top-right)
   ═══════════════════════════════════════════════════ */
.ann-pin-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(240, 173, 78, 0.92);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════
   5. Card Hover Effects (User listing + Login)
   ═══════════════════════════════════════════════════ */

/* User listing cards (.box-news) */
.box-news {
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

.box-news:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    border-color: var(--head_bg, #0094FF) !important;
}

/* Login page cards (.news-frame) */
.news-frame {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.news-frame:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    border-color: var(--head_bg, #0094FF) !important;
}

/* ═══════════════════════════════════════════════════
   6. Admin Filter Toolbar
   ═══════════════════════════════════════════════════ */
.ann-filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.ann-filter-toolbar .form-control,
.ann-filter-toolbar select {
    min-width: 140px;
    max-width: 200px;
}

/* ═══════════════════════════════════════════════════
   7. Category Modal Search
   ═══════════════════════════════════════════════════ */
.cat-search-wrapper {
    margin-bottom: 10px;
}

.cat-search-wrapper input {
    border-radius: var(--ds-radius-sm, 6px);
}

/* ═══════════════════════════════════════════════════
   8. Responsive Adjustments
   ═══════════════════════════════════════════════════ */
@media (max-width: 991px) {
    .ann-filter-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ann-filter-toolbar .form-control,
    .ann-filter-toolbar select {
        max-width: 100%;
        min-width: unset;
    }

    .ann-pin-overlay {
        width: 24px;
        height: 24px;
        font-size: 10px;
        top: 6px;
        right: 6px;
    }
}

.ann-upload-row {
    align-items: flex-start;
}

@media (max-width: 767px) {

    /* Image + File upload row → stack on mobile */
    .ann-upload-row {
        flex-direction: column !important;
    }

    .ann-upload-row>div {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }
}

/* ═══════════════════════════════════════════════════
   9. Modal Table Selected Row (same as FAQ v2)
   ═══════════════════════════════════════════════════ */
#category-manager-modal tr.table-primary td,
#category-manager-modal tr.table-primary:hover td,
#series-manager-modal tr.table-primary td,
#series-manager-modal tr.table-primary:hover td {
    background-color: var(--ds-color-brand-light, #e0f2f1) !important;
    color: var(--ds-color-brand, var(--ds-color-primary)) !important;
}

#category-manager-modal tr.table-primary td.text-muted,
#category-manager-modal tr.table-primary:hover td.text-muted,
#series-manager-modal tr.table-primary td.text-muted,
#series-manager-modal tr.table-primary:hover td.text-muted {
    color: color-mix(in srgb, var(--ds-color-brand, var(--ds-color-primary)) 70%, var(--ds-color-text-muted)) !important;
}

/* ═══════════════════════════════════════════════════
   10. Collapsible & Scrollable Series Bar
   ═══════════════════════════════════════════════════ */
.series-timeline-scroll {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 8px;
    margin-right: -8px;
}

/* Custom scrollbar for series timeline */
.series-timeline-scroll::-webkit-scrollbar {
    width: 6px;
}

.series-timeline-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
}

.series-timeline-scroll::-webkit-scrollbar-thumb {
    background: #c5cbd6;
    border-radius: 4px;
    transition: background 0.2s;
}

.series-timeline-scroll::-webkit-scrollbar-thumb:hover {
    background: #a0aab5;
}

/* Hover effect on toggle header */
.series-toggle-header {
    transition: color 0.2s ease;
}

.series-toggle-header:hover {
    color: var(--head_bg, var(--ds-color-brand-primary, #007bff)) !important;
}

.series-toggle-header:hover .toggle-icon {
    color: var(--head_bg, var(--ds-color-brand-primary, #007bff)) !important;
}


/* ═══════════════════════════════════════════════════
   12. Table Design and Overrides (Roadmap Manage style)
   ═══════════════════════════════════════════════════ */
.ann-text-header {
    font-size: var(--ds-font-size-lg);
}

.ann-img-thumbnail {
    border-radius: var(--ds-radius-lg, 8px);
}

.ann-badge-unread {
    font-size: 12px;
    padding: 3px 8px;
    margin-left: 5px;
    background: var(--ds-color-brand-light, #E5EEFF);
    color: var(--ds-color-brand, #0773DF) !important;
}

/* Toolbar select and search overrides for horizontal layout and matching heights */
.ds-toolbar select.ds-toolbar__select {
    display: inline-block !important;
    width: auto !important;
    height: 38px !important;
    min-height: 38px !important;
    line-height: 1.5 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-width: 120px !important;
    max-width: 220px !important;
    flex: 1 1 140px !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

.ds-toolbar select.ds-toolbar__select--compact {
    min-width: 100px !important;
    max-width: 150px !important;
    flex: 0 1 110px !important;
}

.ds-toolbar__search-input-wrapper .ds-toolbar__input {
    height: 100% !important;
    min-height: 0 !important;
    min-width: 80px !important;
}

.btn-pin-toggle {
    font-size: 20px !important;
    transition: transform 0.2s ease-in-out;
}

.btn-pin-toggle:hover {
    transform: scale(1.25);
}

/* Custom Table Container styled like Roadmap Manage */
.div-table-10col {
    overflow-x: auto;
    padding: 0 !important;
    border: 1px solid var(--ds-color-border, #dee2e6) !important;
    border-radius: var(--ds-radius-lg, 8px) !important;
    background: var(--ds-color-bg, #ffffff) !important;
    box-shadow: var(--ds-shadow-sm) !important;
}


#mytable1 th:nth-child(1), #mytable1 td:nth-child(1) { width: 10%; text-align: left; }
#mytable1 th:nth-child(2), #mytable1 td:nth-child(2) { width: 28%; text-align: left; }
#mytable1 th:nth-child(3), #mytable1 td:nth-child(3) { width: 12%; text-align: left; }
#mytable1 th:nth-child(4), #mytable1 td:nth-child(4) { width: 12%; text-align: left; }
#mytable1 th:nth-child(5), #mytable1 td:nth-child(5) { width: 10%; text-align: left; }
#mytable1 th:nth-child(6), #mytable1 td:nth-child(6) { width: 8%; text-align: center; }
#mytable1 th:nth-child(7), #mytable1 td:nth-child(7) { width: 20%; text-align: center; }

/* Empty state row inside table */
#mytable1 tr.search-null,
#mytable1 tr.search-null td {
    background-color: var(--ds-color-bg, #ffffff) !important;
    padding: 30px 0 !important;
}

@media (max-width: 991px) {
    .ds-toolbar select.ds-toolbar__select,
    .ds-toolbar select.ds-toolbar__select--compact {
        flex: 1 1 140px !important;
        width: auto !important;
        max-width: none !important;
        min-width: 120px !important;
    }
}

/* ═══════════════════════════════════════════════════
   13. Large Radio Buttons and Warning Box Styles
   ═══════════════════════════════════════════════════ */

/* Large radio button sizing (24px) for announcement type & urgency */
.ds-radio-group-lg .ds-radio-soft input[type="radio"] {
    width: 24px !important;
    height: 24px !important;
}

.ds-radio-group-lg .ds-radio-soft label {
    font-size: var(--ds-font-size-lg) !important;
    font-weight: var(--ds-font-weight-medium, 500) !important;
    margin-left: var(--ds-space-xs, 4px) !important;
    cursor: pointer;
}

/* Specific inner shadow adjustments for larger checked radios to keep look correct */
.ds-radio-group-lg .ds-radio-soft input[type="radio"]:checked {
    box-shadow: inset 0 0 0 5px var(--ds-color-brand, #0773DF) !important;
}

/* Yellow/Gold warning card style for pin limit warning */
.ann-pin-warning-box {
    background: var(--ds-color-warning-bg, #FFF3E0) !important;
    border: 1px solid var(--ds-color-warning-border, #FDE68A) !important;
    border-radius: var(--ds-radius-md, 4px) !important;
    padding: var(--ds-spacing-lg, 15px) !important;
    font-size: var(--ds-font-size-sm, 14px) !important;
    color: var(--ds-color-warning-text, #B45309) !important;
}

.ann-pin-warning-box .warning-title {
    font-weight: bold;
    color: var(--ds-color-warning-text, #B45309);
    margin-bottom: var(--ds-space-sm, 8px);
}

/* Custom form group and form label styles matching roadmap create view */
.form-group-custom {
    margin-bottom: 15px;
}

.form-label-custom {
    font-weight: 500;
    color: #4A5568;
    margin-bottom: 8px;
    display: block;
    font-size: 15px;
}

