/* ===========================================================================
   afors_alerts.css — styling for the /alerts/list dashboard
   Expected markup (see the alerts.tpl snippet):
     .alerts-header  > h1 + .alerts-intro + .alerts-toolbar > .btn-create-alert
     .alert-list     > .alert-card[.is-paused] (one per alert)
        .alert-card__head  > .alert-card__title + .alert-status
        .alert-card__body  > .alert-criteria (label/value rows) + .alert-tags (pills)
        .alert-card__foot  > .alert-btn--pause + .alert-btn--delete
   Palette mirrors the site: navy #1C222E, blue #2980b9.
   =========================================================================== */

:root {
    --alert-navy:   #1C222E;
    --alert-blue:   #2980b9;
    --alert-blue-d: #216a9c;
    --alert-red:    #dc3545;
    --alert-amber:  #b7791f;
    --alert-border: #e4e7ec;
    --alert-muted:  #6b7280;
    --alert-bg:     #ffffff;
    --alert-radius: 10px;
    --alert-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
}

/* ---- Header / intro / toolbar --------------------------------------------- */
.alerts-header h1 {
    color: var(--alert-navy);
    margin: 0 0 .5rem;
}

.alerts-intro {
    color: var(--alert-muted);
    max-width: 60ch;
    line-height: 1.5;
    margin: 0 0 1.25rem;
}

.alerts-toolbar {
    margin: 0 0 1.5rem;
}

.btn-create-alert {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--alert-blue);
    color: #fff;
    font-weight: 600;
    font-size: .95rem;
    padding: .7rem 1.25rem;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease;
}
.btn-create-alert:hover { background: var(--alert-blue-d); }
.btn-create-alert::before { content: "＋"; font-weight: 700; font-size: 1.1em; line-height: 1; }

/* ---- The list (responsive card grid) -------------------------------------- */
.alert-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

/* ---- A single alert card -------------------------------------------------- */
.alert-card {
    background: var(--alert-bg);
    border: 1px solid var(--alert-border);
    border-radius: var(--alert-radius);
    box-shadow: var(--alert-shadow);
    padding: 1.1rem 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .85rem;
    transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.alert-card:hover {
    box-shadow: 0 4px 12px rgba(16, 24, 40, .1);
    transform: translateY(-2px);
}

/* Dim a paused alert so it's visually distinct */
.alert-card.is-paused {
    background: #fbfbfc;
    border-color: #eceef2;
    opacity: .78;
}

/* ---- Card head: title + status ------------------------------------------- */
.alert-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}
.alert-card__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--alert-navy);
    line-height: 1.3;
    word-break: break-word;
}

.alert-status {
    flex-shrink: 0;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .22rem .55rem;
    border-radius: 999px;
    white-space: nowrap;
}
.alert-status--active { background: #e6f4ea; color: #1e7e45; }
.alert-status--paused { background: #fdf0d5; color: var(--alert-amber); }

/* ---- Card body: criteria + tags ------------------------------------------ */
.alert-criteria {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .3rem .75rem;
    font-size: .9rem;
}
.alert-criteria dt {
    color: var(--alert-muted);
    font-weight: 600;
    white-space: nowrap;
}
.alert-criteria dd {
    margin: 0;
    color: #374151;
    word-break: break-word;
}

/* Small pills for channels / frequency */
.alert-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.alert-tag {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .75rem;
    font-weight: 600;
    color: #334155;
    background: #f1f4f8;
    border: 1px solid #e4e9f0;
    padding: .2rem .55rem;
    border-radius: 6px;
}
.alert-tag--freq { background: #eef4fb; border-color: #d9e6f5; color: var(--alert-blue-d); }

/* ---- Card footer: actions ------------------------------------------------- */
.alert-card__foot {
    display: flex;
    gap: .5rem;
    margin-top: auto;
    padding-top: .5rem;
    border-top: 1px solid #f0f2f5;
}

.alert-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    font-size: .85rem;
    font-weight: 600;
    padding: .55rem .75rem;
    border-radius: 7px;
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.alert-btn--pause {
    color: var(--alert-navy);
    border-color: var(--alert-border);
    background: #fff;
}
.alert-btn--pause:hover { background: #f6f8fa; border-color: #d6dbe2; }

.alert-btn--delete {
    color: var(--alert-red);
    border-color: #f3c2c7;
    background: #fff;
}
.alert-btn--delete:hover { background: var(--alert-red); color: #fff; border-color: var(--alert-red); }

/* ---- Empty state ---------------------------------------------------------- */
.alerts-empty {
    text-align: center;
    color: var(--alert-muted);
    background: #fafbfc;
    border: 1px dashed var(--alert-border);
    border-radius: var(--alert-radius);
    padding: 2.5rem 1.5rem;
}
.alerts-empty p { margin: 0 0 1rem; }

/* ---- Upgrade prompt (non-supporters) ------------------------------------- */
.upgradePrompt {
    background: #fafbfc;
    border: 1px solid var(--alert-border);
    border-radius: var(--alert-radius);
    padding: 1.5rem;
    max-width: 42rem;
}

/* ---- Mobile --------------------------------------------------------------- */
@media (max-width: 600px) {
    .alert-list { grid-template-columns: 1fr; }
    .btn-create-alert { width: 100%; justify-content: center; }
}
