/* Styles for the deadline tracker pages (conferences.html, workshops.html, summerschools.html, talks-fellowships.html).
   Colours: only the site's brand red (--primary-*) and greys (--gray-*), as on the other pages. */
/* Red header, same as the other pages of the site */
.tracker-header {
    text-align: center;
    padding: 4rem 2rem 3rem;
    background: linear-gradient(135deg, var(--primary-color, #c41230), var(--primary-hover, #a00e26));
    color: white;
    position: relative;
    overflow: hidden;
}

.tracker-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.tracker-header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.tracker-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: white;
}

.tracker-header p {
    font-size: 1.1rem;
    opacity: 0.95;
    line-height: 1.6;
}

/* Small line under the stats: last update + who keeps the list */
.tracker-header .header-note {
    margin: 0.75rem auto 0;
    max-width: 640px;
    font-size: 0.85rem;
    opacity: 0.85;
}

.header-note i {
    margin-right: 0.3rem;
}

/* Counts as plain text (not pills, so they don't look like buttons) */
.tracker-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.tracker-stat {
    font-weight: 700;
    font-size: 1rem;
    padding: 0 1rem;
}

.tracker-stat:empty {
    display: none;
}

.tracker-stat + .tracker-stat:not(:empty) {
    border-left: 1px solid rgba(255, 255, 255, 0.45);
}

/* Filter box, overlapping the header */
.filters-section {
    margin-top: -1.5rem;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
    position: relative;
    z-index: 10;
}

.filters-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
    align-items: center;
    background: white;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.filters-container label {
    font-weight: 600;
    color: var(--gray-700, #374151);
    white-space: nowrap;
}

/* A label and its list stay together when the row wraps */
.filter-group {
    flex: 1 1 240px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.filter-group[hidden] {
    display: none;
}

.filter-group .category-select {
    flex: 1 1 auto;
    min-width: 0;
}

/* With two lists (Type and Field), the search box gets its own row */
.filters-container:has(.filter-group:not([hidden]) + .filter-group) .search-box {
    flex-basis: 100%;
}

/* Search box (same as the old conferences and summer schools pages) */
.search-box {
    flex: 999 1 300px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500, #6b7280);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color, #c41230);
    box-shadow: 0 0 0 3px rgba(196, 18, 48, 0.1);
}

.category-select {
    flex: 1 1 220px;
    padding: 0.75rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
}

.category-select:focus {
    outline: none;
    border-color: #c41230;
    box-shadow: 0 0 0 3px rgba(196, 18, 48, 0.1);
}

/* Time zone note: one line, opens for the details */
.tz-note {
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 0.85rem 1.25rem;
    background: var(--gray-50, #f8fafc);
    border-left: 4px solid var(--primary-color, #c41230);
    border-radius: 6px;
    color: var(--gray-700, #374151);
    font-size: 0.95rem;
    line-height: 1.6;
}

.tz-note summary {
    cursor: pointer;
    list-style: none;
}

.tz-note summary::-webkit-details-marker {
    display: none;
}

.tz-note summary i {
    color: var(--primary-color, #c41230);
    margin-right: 0.4rem;
}

.tz-note .tz-more {
    color: var(--primary-color, #c41230);
    font-weight: 600;
    text-decoration: underline;
    margin-left: 0.25rem;
}

.tz-note[open] .tz-more {
    display: none;
}

.tz-note p {
    margin: 0.6rem 0 0;
}

.group-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.group-title i {
    color: var(--primary-color, #c41230);
}

.group-title.is-muted i {
    color: var(--gray-400, #9ca3af);
}

.group-note {
    color: #6b7280;
    font-size: 0.9rem;
    margin: -0.5rem 0 1rem;
}

.group-title .count {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    background: #f1f5f9;
    border-radius: 50px;
    padding: 0.1rem 0.7rem;
}

/* Cards (same look as the old hand-made conference cards) */
.conferences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.conference-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: white;
    display: flex;
    flex-direction: column;
}

.conference-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.conference-card.is-closed {
    opacity: 0.75;
}

.conference-header {
    padding: 1.25rem 1.5rem;
    background-color: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.conference-icon {
    font-size: 1.25rem;
    color: #c41230;
    background: white;
    border: 1px solid #e2e8f0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.conference-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
}

.conference-type {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conference-deadline {
    font-weight: bold;
    color: #333;
    margin-top: 0.25rem;
}

.deadline-aoe {
    font-size: 0.75rem;
    color: #6b7280;
}

.countdown-badge {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.2rem;
}

/* Countdown: grey when there is time, brand red when it is close */
.days-many {
    color: var(--gray-600, #4b5563);
}

.days-few {
    color: var(--primary-color, #c41230);
}

.days-urgent {
    color: var(--primary-color, #c41230);
    font-weight: 800;
}

.days-passed {
    color: var(--gray-400, #9ca3af);
}

.conference-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.status-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.pill {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px;
    padding: 0.15rem 0.6rem;
}

/* Badges: brand red for status, greys for the rest (no green/amber/blue) */
.pill-open {
    background: #fde7ea;
    color: var(--primary-hover, #a00e26);
}

.pill-closed {
    background: var(--gray-100, #f1f5f9);
    color: var(--gray-500, #6b7280);
}

.pill-tba {
    background: var(--white, #fff);
    color: var(--gray-600, #4b5563);
    border: 1px solid var(--gray-300, #d1d5db);
}

.pill-type {
    background: var(--gray-100, #f1f5f9);
    color: var(--gray-700, #374151);
}

.pill-africa {
    background: var(--white, #fff);
    color: var(--primary-color, #c41230);
    border: 1px solid var(--primary-color, #c41230);
}

.conference-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
}

.conference-fullname {
    color: #4b5563;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.conference-theme {
    color: #6c757d;
    margin-bottom: 1rem;
    font-weight: 500;
}

.conference-details {
    margin-bottom: 1.5rem;
    flex: 1;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

.detail-item i {
    width: 20px;
    text-align: center;
    color: #c41230;
    padding-top: 3px;
    flex-shrink: 0;
}

.conference-link {
    display: inline-block;
    text-align: center;
    background-color: #c41230;
    color: white;
    padding: 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.conference-link:hover {
    background-color: #a00e26;
    color: white;
}

.conference-link i {
    margin-right: 0.5rem;
}

.show-closed {
    display: block;
    margin: 2rem auto 0;
}

.empty-state,
.load-error {
    text-align: center;
    color: #6b7280;
    padding: 2rem 1rem;
}

.data-source {
    text-align: center;
    color: #6b7280;
    font-size: 0.85rem;
    margin-top: 3rem;
}

.data-source a {
    color: #c41230;
}

.hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .tracker-header {
        padding: 3rem 1rem 2.5rem;
    }

    .tracker-header h1 {
        font-size: 1.9rem;
    }

    .conferences-grid {
        gap: 1.25rem;
    }
}

/* Pill-shaped links in the red header  */
.header-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.header-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.18);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
    transition: background 0.2s;
}

.header-link:hover,
.header-link:focus {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.tracker-header h1 i {
    opacity: 0.85;
    margin-right: 0.4rem;
}

.header-link.is-disabled {
    opacity: 0.7;
    cursor: default;
}

.header-link.is-disabled:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* "Suggest an opportunity": a plain text link under the page links, not another pill */
.header-links .header-link-quiet {
    flex-basis: 100%;
    justify-content: center;
    background: none;
    border: none;
    padding: 0.25rem;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.header-links .header-link-quiet:hover,
.header-links .header-link-quiet:focus,
.header-links .header-link-quiet.is-disabled:hover {
    background: none;
}
