/* ============================================================
   Meeting Planner - page-scoped visual refresh
   Load order: main.css -> calculators.css -> dev-tools.css -> this file.
   Only selectors used by meeting-planner.html live here.
   ============================================================ */

/* ---------- Section copy ---------- */
/* language.js puts the translated string on the heading's leading whitespace
   node, which lands before the inline icon; order keeps the icon in front. */
.converter-section > .section-title > svg {
    order: -1;
    align-self: flex-start;
    margin-top: 3px;
    flex-shrink: 0;
}

.converter-section > .section-subtitle {
    margin: -6px 0 22px;
    font-size: 14.5px;
    line-height: 1.7;
    color: #5f6368;
}

/* ---------- Controls card ---------- */
.mp-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Presets must stay secondary pills: calculators.css styles .calc-btn as the
   primary blue button and would otherwise win on padding and font size. */
.mp-presets {
    gap: 8px;
    margin-bottom: 0;
    padding-bottom: 14px;
    border-bottom: 1px dashed #e5e7eb;
}

.mp-preset-label {
    margin-inline-end: 2px;
    font-size: 13px;
    font-weight: 600;
    color: #5f6368;
}

.mp-presets .mp-preset-btn {
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 500;
    color: #1a73e8;
    background: #eef4ff;
    border: 1px solid #d7e5ff;
    border-radius: 999px;
    box-shadow: none;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.mp-presets .mp-preset-btn:hover {
    background: #e0edfe;
    border-color: #a8c7fa;
    box-shadow: 0 2px 6px rgba(26, 115, 232, 0.15);
}

.mp-presets .mp-preset-btn:active {
    transform: none;
}

.mp-presets .mp-preset-btn:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* ---------- Date row ---------- */
.mp-date-row {
    gap: 10px;
    margin-bottom: 0;
}

.mp-date-row label {
    font-size: 13px;
    color: #5f6368;
}

.mp-date-input {
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
    color: #222;
    background: #fff;
    border: 1.5px solid #d9d9d9;
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mp-date-input:hover {
    border-color: #a8c7fa;
}

.mp-date-input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

/* ---------- City select + primary button ---------- */
.mp-add-row {
    gap: 10px;
}

.mp-add-row .input-wrap {
    min-width: 0;
}

.mp-add-row .input-wrap select {
    width: 100%;
    padding: 11px 40px 11px 14px;
    font: inherit;
    font-size: 14.5px;
    color: #222;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236b7280'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    border: 1.5px solid #d9d9d9;
    border-radius: 10px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mp-add-row .input-wrap select:hover {
    border-color: #a8c7fa;
}

.mp-add-row .input-wrap select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.mp-add-row .calc-btn {
    /* Tuned so the button matches the 46px input/select height. */
    padding: 13px 22px;
    font-size: 14.5px;
    border-radius: 10px;
}

[dir="rtl"] .mp-add-row .input-wrap select {
    padding: 11px 14px 11px 40px;
    background-position: left 12px center;
}

/* ---------- City tags ---------- */
.mp-tags {
    gap: 8px;
}

.mp-tag {
    padding: 6px 6px 6px 14px;
    background: #eef4ff;
    border-color: #d7e5ff;
    color: #1557b0;
    font-weight: 500;
    animation: mp-tag-in 0.18s ease;
}

@keyframes mp-tag-in {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.mp-tag-remove {
    width: 22px;
    height: 22px;
    background: #dbe8ff;
}

.mp-tag-remove:hover {
    background: #1a73e8;
    color: #fff;
}

.mp-hint {
    margin-top: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #6b7280;
}

/* ---------- Timeline ---------- */
.mp-timeline-wrap {
    position: relative;
    margin-top: 20px;
    background: #fff;
    border-color: #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Hints that the 24-hour axis continues to the side. */
.mp-timeline-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-end: 0;
    width: 26px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95));
    pointer-events: none;
}

[dir="rtl"] .mp-timeline-wrap::after {
    background: linear-gradient(to left, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95));
}

/* The scroller keeps its own padding so the sticky label column lines up with
   it; this overlay hides the sliver of scrolled cells that would otherwise show
   through that padding strip. */
.mp-timeline-wrap::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: 14px;
    background: #fff;
    z-index: 3;
    pointer-events: none;
}

.mp-timeline {
    min-width: 0;
    padding: 14px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.mp-timeline::-webkit-scrollbar {
    height: 8px;
}

.mp-timeline::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 999px;
}

.mp-timeline::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.mp-timeline::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.mp-row {
    grid-template-columns: 132px repeat(24, minmax(27px, 1fr));
    gap: 3px;
    min-width: 856px;
    margin-bottom: 3px;
}

.mp-row-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef1f6;
}

.mp-row-header .mp-city-cell {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8b95a5;
}

.mp-row-header .mp-hour-cell {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

/* Row labels stay visible while the 24-hour axis scrolls sideways. */
.mp-row > .mp-city-cell {
    position: sticky;
    inset-inline-start: 0;
    z-index: 2;
    background: #fff;
    padding-inline-end: 10px;
}

.mp-row > .mp-city-cell::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-end: -3px;
    width: 3px;
    background: #fff;
}

.mp-city-name {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    white-space: normal;
    line-height: 1.15;
}

.mp-city-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1f2937;
}

.mp-city-utc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.62rem;
    font-weight: 500;
    color: #8b95a5;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
}

.mp-bar-cell {
    height: 26px;
    border-radius: 6px;
    background: #f3f5f9;
    border: 1px solid #edf1f6;
    transition: background 0.15s ease;
}

.mp-bar-cell:hover {
    background: #e9eef6;
}

.mp-bar-fill {
    background: linear-gradient(180deg, #8fbaf9 0%, #5b93ee 100%);
    border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* Overlap band reads as the "answer" row: tinted track + green glow. */
.mp-row-overlap {
    margin-top: 6px;
    padding-top: 9px;
    border-top: 1px dashed #e5e7eb;
}

.mp-row-overlap .mp-bar-cell {
    background: #f6fdfa;
    border-color: #dcf3e8;
}

.mp-row-overlap .mp-bar-fill {
    background: linear-gradient(180deg, #46dba4 0%, #0fae7d 100%);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.35);
}

.mp-overlap-label {
    color: #047857;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

/* ---------- Result card ---------- */
#mpResult {
    margin-top: 4px;
}

#mpResult .result-card.highlight {
    padding: 22px 24px;
}

#mpResult .result-label {
    font-size: 12px;
    letter-spacing: 0.06em;
}

#mpResult .result-value {
    font-size: 28px;
    letter-spacing: -0.01em;
}

#mpResult .result-sub {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}

.mp-local-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    font-size: 13px;
    color: #fff;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.mp-local-chip-city {
    font-weight: 700;
}

.mp-result-tip {
    margin-top: 14px;
    padding: 12px 16px;
    background: #f0f7ff;
    border-left: 4px solid #1a73e8;
    border-radius: 0 10px 10px 0;
    font-size: 13.5px;
    line-height: 1.65;
    color: #1a3d6e;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .mp-controls {
        padding: 16px;
        border-radius: 12px;
    }

    .mp-date-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .mp-date-input {
        width: 100%;
    }

    .mp-add-row {
        flex-direction: column;
        align-items: stretch;
    }

    .mp-add-row .calc-btn {
        width: 100%;
    }

    /* calculators.css makes every .calc-btn full width on phones; presets are
       quick links, so keep them as content-sized pills. */
    .mp-presets .mp-preset-btn {
        width: auto;
        flex: 0 0 auto;
    }

    .mp-timeline {
        padding: 12px;
    }

    .mp-timeline-wrap::before {
        width: 12px;
    }

    .converter-section > .section-subtitle {
        font-size: 13.5px;
    }
}

@media (max-width: 640px) {
    .mp-row {
        grid-template-columns: 104px repeat(24, minmax(27px, 1fr));
        min-width: 828px;
    }

    .mp-row-header .mp-hour-cell {
        font-size: 9.5px;
    }

    .mp-bar-cell {
        height: 24px;
    }

    .mp-city-label {
        font-size: 0.76rem;
    }

    .mp-city-utc {
        font-size: 0.58rem;
    }

    #mpResult .result-value {
        font-size: 22px;
    }

    .mp-local-chip {
        white-space: normal;
        text-align: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mp-tag {
        animation: none;
    }
}
