/* Xem ngày cưới hỏi — dùng chung biến CSS toàn cục (--bg/--card/--text/--muted/--border/--shadow/--radius/--primary) */

:root {
    --wd-verygood-bg: #d1fae5; --wd-verygood-text: #065f46; --wd-verygood-solid: #16a34a;
    --wd-good-bg:     #dcfce7; --wd-good-text:     #15803d; --wd-good-solid:     #22c55e;
    --wd-normal-bg:   #eff6ff; --wd-normal-text:   #2563eb; --wd-normal-solid:   #9ca3af;
    --wd-bad-bg:      #fef3c7; --wd-bad-text:      #b45309; --wd-bad-solid:      #f97316;
    --wd-verybad-bg:  #fee2e2; --wd-verybad-text:  #dc2626; --wd-verybad-solid:  #dc2626;
}

/* Breadcrumb (trang chi tiết ngày) — tự chứa, không phụ thuộc sao-han.css */
.breadcrumb-nav { margin-bottom: 8px; }
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}
.breadcrumb li + li::before { content: '/'; color: var(--border); margin-right: 6px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 600; }

.wd-form-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}
.wd-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    margin-top: 12px;
}
.wd-form-row .ma-field { flex: 1 1 180px; min-width: 150px; }

.wd-hint {
    color: var(--muted);
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0;
}
.wd-hint a { color: var(--primary); font-weight: 600; }

/* Tier color helpers */
.wd-tier--verygood { --tier-bg: var(--wd-verygood-bg); --tier-text: var(--wd-verygood-text); --tier-solid: var(--wd-verygood-solid); }
.wd-tier--good      { --tier-bg: var(--wd-good-bg);     --tier-text: var(--wd-good-text);     --tier-solid: var(--wd-good-solid); }
.wd-tier--normal     { --tier-bg: var(--wd-normal-bg);   --tier-text: var(--wd-normal-text);   --tier-solid: var(--wd-normal-solid); }
.wd-tier--bad         { --tier-bg: var(--wd-bad-bg);      --tier-text: var(--wd-bad-text);      --tier-solid: var(--wd-bad-solid); }
.wd-tier--verybad     { --tier-bg: var(--wd-verybad-bg);  --tier-text: var(--wd-verybad-text);  --tier-solid: var(--wd-verybad-solid); }

/* Summary bar */
.wd-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 14px;
}
.wd-summary__item { display: flex; flex-direction: column; gap: 2px; }
.wd-summary__label { font-size: 12px; color: var(--muted); }
.wd-summary__value { font-weight: 700; color: var(--text); }
.wd-summary__value a { color: var(--primary); }
.wd-summary__item--nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.wd-nav-btn {
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 10px;
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.wd-nav-btn:hover { background: var(--primary-light); color: var(--primary); }
.wd-nav-title { font-weight: 700; min-width: 110px; text-align: center; }

/* Section headers */
.wd-section-title {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-weight: 700; font-size: 16px; color: var(--text);
    margin-bottom: 12px;
}
.wd-section-title i { color: var(--primary); }
.wd-section-hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.wd-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    margin-bottom: 18px;
}

/* Top days */
.wd-top-section { margin-bottom: 18px; }
.wd-top-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.wd-top-card {
    display: flex; flex-direction: column; gap: 4px;
    background: var(--tier-bg, var(--bg));
    color: var(--tier-text, var(--text));
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    text-decoration: none;
    transition: transform .15s ease;
}
.wd-top-card:hover { transform: translateY(-2px); }
.wd-top-card__day { font-weight: 800; font-size: 17px; }
.wd-top-card__score { font-weight: 700; font-size: 14px; }
.wd-top-card__tier { font-size: 12.5px; }
.wd-top-card__truc { font-size: 11.5px; opacity: .8; }

/* Compare */
.wd-compare-section { margin-bottom: 18px; }
.wd-compare-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: var(--primary-light);
    border: 1px dashed var(--primary);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
}
.wd-compare-list { font-size: 13.5px; color: var(--text); font-weight: 600; }
.wd-compare-btn, .wd-compare-clear {
    border: none; border-radius: 10px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.wd-compare-btn { background: var(--primary); color: #fff; }
.wd-compare-clear { background: transparent; color: var(--muted); text-decoration: underline; }
.wd-compare-table-wrap { overflow-x: auto; }
.wd-compare-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.wd-compare-table th, .wd-compare-table td {
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}
.wd-compare-table th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.wd-compare-row--best { background: var(--wd-verygood-bg); }
.wd-compare-date { font-weight: 700; position: relative; }
.wd-compare-badge {
    display: inline-block; margin-left: 6px; background: var(--wd-verygood-solid); color: #fff;
    font-size: 10.5px; padding: 2px 6px; border-radius: 6px; vertical-align: middle;
}
.wd-compare-score { font-weight: 700; }
.wd-compare-reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.wd-reason--good { color: var(--wd-good-text); }
.wd-reason--bad { color: var(--wd-verybad-text); }

.wd-tag {
    display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
    background: var(--tier-bg, var(--bg)); color: var(--tier-text, var(--text));
}

/* Calendar grid */
.wd-calendar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 18px;
}
.wd-calendar__dow, .wd-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.wd-calendar__dow { margin-bottom: 8px; }
.wd-calendar__dow span { text-align: center; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.wd-day {
    position: relative;
    border-radius: 12px;
    background: var(--tier-bg, var(--bg));
    border: 1px solid var(--border);
    min-height: 76px;
}
.wd-day--blank { background: transparent; border: none; }
.wd-day__pick { position: absolute; top: 4px; right: 4px; z-index: 2; }
.wd-day__checkbox { width: 15px; height: 15px; cursor: pointer; }
.wd-day__link {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; padding: 8px 4px 6px;
    text-decoration: none;
    color: var(--tier-text, var(--text));
    gap: 2px;
}
.wd-day__num { font-weight: 800; font-size: 16px; }
.wd-day__lunar { font-size: 10.5px; opacity: .75; }
.wd-day__score { font-size: 12px; font-weight: 700; }
.wd-day:hover { outline: 2px solid var(--tier-solid, var(--primary)); }

.wd-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.wd-legend__item {
    font-size: 12px; padding: 4px 10px; border-radius: 999px;
    background: var(--tier-bg, var(--bg)); color: var(--tier-text, var(--text));
}

/* Day detail hero */
.wd-hero {
    background: linear-gradient(135deg, var(--tier-bg, var(--bg)), var(--card));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
}
.wd-hero__nav { display: flex; justify-content: space-between; margin-bottom: 10px; }
.wd-hero__nav-btn {
    font-size: 13px; color: var(--text); text-decoration: none;
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px;
}
.wd-hero__nav-btn:hover { color: var(--primary); }
.wd-hero__score { font-size: 48px; font-weight: 900; color: var(--tier-text, var(--text)); line-height: 1; }
.wd-hero__score span { font-size: 20px; font-weight: 600; opacity: .7; }
.wd-hero__tier {
    display: inline-block; margin-top: 6px;
    background: var(--tier-solid, var(--primary)); color: #fff;
    padding: 4px 16px; border-radius: 999px; font-weight: 700; font-size: 14px;
}
.wd-hero__meta { margin-top: 12px; color: var(--muted); font-size: 13.5px; }
.wd-hero__verdict { margin-top: 14px; color: var(--text); font-size: 15px; line-height: 1.6; max-width: 720px; margin-left: auto; margin-right: auto; }

/* Reasons list */
.wd-reasons-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wd-reason { display: flex; align-items: flex-start; gap: 8px; font-size: 14.5px; line-height: 1.5; }
.wd-reason i { margin-top: 2px; }
.wd-reason--good i { color: var(--wd-good-solid); }
.wd-reason--bad i { color: var(--wd-verybad-solid); }
.wd-reason--normal i { color: var(--muted); }

/* Ceremony hours */
.wd-ceremony-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.wd-ceremony-card { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.wd-ceremony-card__head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 10px; }
.wd-ceremony-card__head i { color: var(--primary); }
.wd-ceremony-card__hours { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.wd-ceremony-card__empty { font-size: 12.5px; color: var(--muted); }

/* Hours grid */
.wd-hours-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.wd-hour-chip {
    border-radius: 12px; padding: 10px 12px; border: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 2px;
}
.wd-hour-chip--good { background: var(--wd-good-bg); color: var(--wd-good-text); }
.wd-hour-chip--bad { background: var(--bg); color: var(--muted); }
.wd-hour-chip__chi { font-weight: 700; font-size: 13.5px; }
.wd-hour-chip__time { font-size: 12px; }
.wd-hour-chip__than { font-size: 11.5px; opacity: .85; }

/* Stars */
.wd-stars-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.wd-stars-col__title { font-weight: 700; margin-bottom: 8px; }
.wd-stars-col--good .wd-stars-col__title { color: var(--wd-good-text); }
.wd-stars-col--bad .wd-stars-col__title { color: var(--wd-verybad-text); }
.wd-star-item { font-size: 13.5px; line-height: 1.5; margin-bottom: 6px; color: var(--text); }
.wd-kyngay-note {
    margin-top: 14px; background: var(--wd-bad-bg); color: var(--wd-bad-text);
    border-radius: 12px; padding: 12px 14px; font-size: 13.5px; display: flex; gap: 8px; flex-direction: column;
}

.wd-share-image { text-align: center; margin-bottom: 18px; }

@media (max-width: 640px) {
    .wd-calendar__dow, .wd-calendar__grid { gap: 4px; }
    .wd-day { min-height: 60px; }
    .wd-day__num { font-size: 13px; }
    .wd-day__lunar { display: none; }
    .wd-stars-cols { grid-template-columns: 1fr; }
    .wd-hero__score { font-size: 38px; }
    .wd-summary__item--nav { margin-left: 0; width: 100%; justify-content: center; }
}
