/* ==========================================================================
   Sihatuna shared components — header, buttons, forms, badges, rating,
   footer. Overrides the corresponding site.css rules by loading later at
   equal or higher specificity; no !important anywhere in this file.
   ========================================================================== */

/* ----- Buttons: 16px radius, green primary, navy secondary ----- */

.btn {
    border-radius: var(--sihatuna-radius-md);
    /* Button labels are controls, not user text: the global
       overflow-wrap: anywhere guard inherits into table-cell buttons and
       split "حذف" mid-word. A label keeps its words whole. */
    overflow-wrap: normal;
}

/* Small buttons keep a usable touch target but stop inheriting the full
   2.75rem height, which made them overflow compact card heads. */
.btn-sm {
    min-height: 2.25rem;
}

/* "Create account" and other dark buttons move from pure black to brand navy. */
.btn-dark {
    --bs-btn-bg: var(--sihatuna-ink);
    --bs-btn-border-color: var(--sihatuna-ink);
    --bs-btn-hover-bg: #0f2c46;
    --bs-btn-hover-border-color: #0f2c46;
}

/* ----- Forms: watercolor-blue focus instead of the old brand blue ----- */

.form-control:focus,
.form-select:focus {
    border-color: rgba(20, 95, 158, .6);
    box-shadow: 0 0 0 .22rem rgba(74, 160, 216, .18);
}

/* Bootstrap hard-codes its own blue for ticked checks and radios. */
.form-check-input:checked {
    background-color: var(--care-primary);
    border-color: var(--care-primary);
}

.form-check-input:focus {
    border-color: rgba(20, 95, 158, .6);
    box-shadow: 0 0 0 .22rem rgba(74, 160, 216, .18);
}

/* ----- Header ----- */

.site-header {
    border-bottom: 1px solid var(--care-border);
}

.brand-mark-img {
    filter: drop-shadow(0 .35rem .75rem rgba(8, 118, 93, .26));
}

/* Hamburger bars recoloured from Doccure blue to Sihatuna green. */
.navbar-toggler .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath stroke='%2308765d' stroke-width='2.6' stroke-linecap='round' d='M4 6.5h16M4 12h16M4 17.5h10'/%3E%3C/svg%3E");
}

/* Bootstrap compiles its primary into dropdowns as a literal, so the active
   item (e.g. the selected language) stays #0d6efd without this. */
.dropdown-menu {
    --bs-dropdown-link-active-bg: var(--care-primary);
}

/* ----- Tabs: modern bordered pills in the brand green ----- */

.nav-pills {
    --bs-nav-pills-link-active-bg: var(--care-primary);
    gap: .5rem;
}

.nav-pills .nav-link {
    color: var(--care-primary-dark);
    border: 1px solid var(--care-border);
    border-radius: 999px;
    background: var(--care-card);
    font-weight: 600;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.nav-pills .nav-link:hover,
.nav-pills .nav-link:focus-visible {
    background: var(--sihatuna-green-soft);
    border-color: var(--care-primary);
}

.nav-pills .nav-link.active {
    color: #fff;
    border-color: var(--care-primary);
}

[data-bs-theme="dark"] .nav-pills .nav-link:hover,
[data-bs-theme="dark"] .nav-pills .nav-link:focus-visible {
    background: rgba(8, 118, 93, .25);
}

/* Documented third-party override: the licensed Doccure sheets re-declare
   .text-secondary as the cyan brand colour with !important, which lands at
   2.6:1 on white. site.css already points the utility at the muted token the
   same way; the extra `body` raises specificity above the vendor rule so it
   holds wherever the vendor sheets load in whatever order. */
body .text-secondary {
    color: var(--care-muted) !important;
}

/* ----- Section heading eyebrow: soft green chip ----- */

.section-header .title {
    background: var(--sihatuna-green-soft);
}

/* The header avatar shows the uploaded photo when there is one; the circle
   crops it the same way the sidebar card does. */
.care-user-avatar {
    overflow: hidden;
}

.care-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ----- Verified mark (doctor cards) ----- */

.verified-mark {
    display: inline-flex;
    align-items: center;
    color: var(--care-success-text);
    font-size: .95rem;
    vertical-align: .05em;
    margin-inline-start: .35rem;
}

/* ----- Star rating (shared; page sheets may refine it) ----- */

.care-rating {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .875rem;
}

.care-rating-stars {
    display: inline-flex;
    gap: .12rem;
    color: var(--care-border);
    font-size: .8rem;
}

.care-rating-stars .is-filled {
    color: var(--sihatuna-gold);
}

.care-rating-value {
    font-weight: 600;
}

/* ----- Language toggle: the form is layout-invisible ----- */

.care-language-toggle {
    display: inline-flex;
}

/* ----- Mobile theme toggle: one button naming the mode a tap switches TO.
   Both labels are in the markup; the current theme picks which one shows,
   so the button is right from first paint without any script. ----- */

.theme-toggle-inline {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: .45rem 1.1rem;
    border: 1px solid var(--care-border);
    border-radius: 999px;
    background: var(--care-card);
    color: var(--care-ink);
    font-weight: 600;
    cursor: pointer;
}

.theme-toggle-inline:hover {
    border-color: var(--care-primary);
    background: var(--care-accent);
}

.theme-toggle-inline > span {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.theme-toggle-inline .theme-toggle-when-dark {
    display: none;
}

[data-bs-theme="dark"] .theme-toggle-inline .theme-toggle-when-light {
    display: none;
}

[data-bs-theme="dark"] .theme-toggle-inline .theme-toggle-when-dark {
    display: inline-flex;
}

/* ----- Pagination: one shape for every pager on the site.
   Bootstrap's ul.pagination is also what the DataTables Bootstrap adapter
   renders, so server-paged lists and client tables share this look. ----- */

.pagination {
    gap: .35rem;
}

.pagination .page-link {
    display: inline-flex;
    min-width: 2.4rem;
    min-height: 2.4rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--care-border);
    border-radius: 999px;
    background: var(--care-card);
    color: var(--care-ink);
    font-weight: 600;
}

.pagination .page-link:hover,
.pagination .page-link:focus-visible {
    border-color: var(--care-primary);
    background: var(--sihatuna-green-soft);
    color: var(--care-primary-dark);
}

/* White on the brand green measures 5.6:1. The second selector covers the
   Doccure-derived pager on the doctor search page, which marks the anchor
   itself active rather than the list item. */
.pagination .page-item.active .page-link,
.pagination .page-link.active {
    border-color: var(--care-primary);
    background: var(--care-primary);
    color: #fff;
}

/* That same Doccure pager spaces its items with a plain ul. */
.pagination > ul {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination .page-item.disabled .page-link {
    opacity: .5;
    pointer-events: none;
}

[data-bs-theme="dark"] .pagination .page-link:hover,
[data-bs-theme="dark"] .pagination .page-link:focus-visible {
    background: rgba(8, 118, 93, .25);
}

/* ----- Notifications list ----- */

/* The message must not dictate the row's shape: it wraps inside its own
   column and stops at two lines, so the actions keep the same position on
   every row no matter how long the text is. */
.notification-item-text {
    min-width: 0;
}

.notification-item-message {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* ----- Footer: calm pale-blue wash with a restrained watercolor corner ----- */

.site-footer {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, var(--sihatuna-bg) 0%, var(--sihatuna-blue-soft) 100%);
    border-top: 1px solid var(--care-border);
}

.site-footer::before {
    content: "";
    position: absolute;
    inset-block-end: -4rem;
    inset-inline-end: -3rem;
    width: min(22rem, 45vw);
    aspect-ratio: 1;
    background: url("/images/brand/watercolor-landmarks.webp") center bottom / contain no-repeat;
    opacity: .1;
    pointer-events: none;
}

.site-footer > .container,
.site-footer .footer-bottom {
    position: relative;
}

.footer-tagline {
    margin-block: .25rem 0;
    color: var(--sihatuna-gold-text);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .04em;
}

.footer-bottom {
    background: #e3f1fa;
    border-top: 1px solid #fff;
}

/* --------------------------------------------------------------------------
   The favourite heart, one look everywhere it appears: a quiet chip with a
   grey outline heart, turning pink and filled once saved. In this sheet
   rather than a page's own because the toggle renders on the directories,
   the profiles and wherever a card grows one next — and each page loading
   its own copy is how the directory ended up with an unstyled square.
   -------------------------------------------------------------------------- */
.care-fav-heart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--care-control-border, #dfeaf0);
    border-radius: 13px;
    color: var(--care-muted, #64748b);
    background: var(--care-card, #fff);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, transform .15s ease;
}

.care-fav-heart svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.care-fav-heart:hover,
.care-fav-heart:focus-visible {
    color: #f14f82;
    border-color: rgba(241, 79, 130, .45);
    transform: translateY(-1px);
}

/* Saved: the heart fills and keeps its colour without hover. */
.care-fav-heart.is-active {
    color: #f14f82;
    border-color: rgba(241, 79, 130, .45);
}

.care-fav-heart.is-active svg {
    fill: currentColor;
}

.care-fav-heart-form {
    display: inline-flex;
}

[data-bs-theme="dark"] .care-fav-heart {
    border-color: rgba(150, 216, 188, .2);
    background: rgba(12, 43, 34, .9);
    color: #a8bbb4;
}

[data-bs-theme="dark"] .care-fav-heart:hover,
[data-bs-theme="dark"] .care-fav-heart:focus-visible,
[data-bs-theme="dark"] .care-fav-heart.is-active {
    color: #f781a7;
    border-color: rgba(247, 129, 167, .45);
}

/* ==========================================================================
   Toasts — one region at the top of the viewport, announced politely.

   The first use is the guest favourite heart: without JavaScript the heart is
   a plain link to sign-in; with it, this toast explains first and its action
   carries the same address. Success notices can reuse the same shell.
   ========================================================================== */

.care-toast-region {
    position: fixed;
    inset-inline: 0;
    top: 16px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-inline: 16px;
    pointer-events: none;
}

.care-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: min(400px, 100%);
    padding: 14px 16px;
    border: 1px solid var(--care-border, #ddeaf3);
    border-inline-start: 4px solid var(--care-primary, #08765d);
    border-radius: 14px;
    background: var(--care-card, #fff);
    box-shadow: var(--sihatuna-shadow-md, 0 14px 40px rgba(31, 92, 132, .18));
    pointer-events: auto;
}

.care-toast-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    color: var(--care-primary-dark, #055744);
    background: var(--sihatuna-green-soft, #e6f5f0);
}

.care-toast-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.care-toast-content {
    min-width: 0;
    flex: 1;
}

.care-toast-title {
    margin: 0 0 2px;
    color: var(--care-ink, #163e5f);
    font-size: .9rem;
    font-weight: 800;
}

.care-toast-body {
    margin: 0;
    color: var(--care-muted, #5a7184);
    font-size: .82rem;
}

.care-toast-actions {
    display: flex;
    gap: 8px;
    margin-top: 9px;
}

.care-toast-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 9px;
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.care-toast-action.primary {
    color: #fff;
    background: var(--care-primary, #08765d);
    border: 1px solid var(--care-primary, #08765d);
}

.care-toast-action.quiet {
    color: var(--care-muted, #5a7184);
    background: transparent;
    border: 1px solid var(--care-border, #ddeaf3);
    font-family: inherit;
}

.care-toast-close {
    flex: 0 0 auto;
    padding: 2px;
    border: 0;
    background: none;
    color: var(--care-muted, #5a7184);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
    .care-toast {
        animation: care-toast-in .25s ease;
    }

    @keyframes care-toast-in {
        from {
            opacity: 0;
            transform: translateY(-8px);
        }

        to {
            opacity: 1;
            transform: none;
        }
    }
}

[data-bs-theme="dark"] .care-toast {
    border-color: rgba(255, 255, 255, .12);
    background: var(--care-card, #102a38);
}

[data-bs-theme="dark"] .care-toast-icon {
    color: #7fd4bd;
    background: rgba(13, 127, 102, .22);
}

/* ==========================================================================
   Request verification — the way out of "not verified".

   Worn by the doctor, medical-centre and pharmacy profiles beside their
   unverified chip; it leads into the registration flow pre-filled from the
   public profile. The .block variant fills the booking sidebar's width.
   ========================================================================== */

.request-verification-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1.5px solid var(--care-primary, #08765d);
    border-radius: 999px;
    color: var(--care-primary-dark, #055744);
    background: transparent;
    font-size: .84rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.request-verification-button svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    stroke: currentColor;
}

.request-verification-button:hover,
.request-verification-button:focus-visible {
    color: #fff;
    background: var(--care-primary, #08765d);
}

.request-verification-button.block {
    width: 100%;
    margin-top: 10px;
    border-radius: 14px;
}

[data-bs-theme="dark"] .request-verification-button {
    color: #7fd4bd;
    border-color: rgba(127, 212, 189, .55);
}

[data-bs-theme="dark"] .request-verification-button:hover,
[data-bs-theme="dark"] .request-verification-button:focus-visible {
    color: #06231b;
    background: #7fd4bd;
}

/* The quiet companion: report wrong information on any public profile. */
.report-issue-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin-top: 8px;
    color: var(--care-muted, #5a7184);
    font-size: .8rem;
    font-weight: 650;
    text-decoration: none;
}

.report-issue-link svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    stroke: currentColor;
}

.report-issue-link:hover,
.report-issue-link:focus-visible {
    color: var(--care-primary-dark, #055744);
    text-decoration: underline;
}

[data-bs-theme="dark"] .report-issue-link:hover,
[data-bs-theme="dark"] .report-issue-link:focus-visible {
    color: #7fd4bd;
}
