/* ════════════════════════════════════════════════════════════════
   MEDIRESOURCE COMMUNITY SUPPORT — THEME CONTROLS
   Edit the variables below to customise colours and font sizes.
   All other rules reference these variables; do not edit them.
   ════════════════════════════════════════════════════════════════ */
.mrsync-cs {

    /* ── Colours ─────────────────────────────────────────────── */
    --cs-primary:        #005CB8;   /* Input focus, divider, detail borders   */
    --cs-primary-dark:   #00548f;   /* Detail table label text                */
    --cs-accent:         #bf0f35;   /* Search button background               */
    --cs-accent-hover:   #a30d2c;   /* Search button hover                    */
    --cs-link:           #dd3333;   /* Website & email link colour            */
    --cs-border:         #cce0f5;   /* Form card & detail card borders        */
    --cs-bg-card:        #ffffff;   /* Form / detail card background          */
    --cs-title:          #005689;   /* Location card heading colour           */
    --cs-text:           #2c2c2c;   /* Primary body text                      */
    --cs-text-muted:     #666666;   /* Secondary / placeholder text           */

    /* ── City card colours ───────────────────────────────────── */
    --cs-city-bg:        #f0f7ff;              /* City card background        */
    --cs-city-border:    #0051954F;            /* City card border colour     */
    --cs-city-text:      #000000;              /* City card link text         */
    --cs-city-bg-hover:  rgba(0,81,149,0.08);  /* City card hover fill        */

    /* ── Font sizes ──────────────────────────────────────────── */
    --cs-font-select:    16px;      /* Province / category dropdown text      */
    --cs-font-btn:       16px;      /* Search button label                    */
    --cs-font-city:      14px;      /* City card link text                    */
    --cs-font-title:     18px;      /* Location card heading                  */
    --cs-font-label:     16px;      /* Detail table label column              */
    --cs-font-value:     16px;      /* Detail table value column              */

    /* ── Shape ───────────────────────────────────────────────── */
    --cs-radius:         8px;       /* Card corners (max 8px)                 */
    --cs-radius-sm:      6px;       /* Inputs & button corners                */

    /* ── Shadows ─────────────────────────────────────────────── */
    --cs-shadow:         0 2px 8px rgba(0,0,0,0.08);
    --cs-shadow-hover:   0 6px 18px rgba(0,92,184,0.14);
}
/* ════════════════════════════════════════════════════════════════ */


/* ── Reset ──────────────────────────────────────────────────────── */
.mrsync-cs *,
.mrsync-cs *::before,
.mrsync-cs *::after {
    box-sizing: border-box;
}

.mrsync-cs {
    font-family: inherit;
    color: var(--cs-text);
}

/* ── Search form ─────────────────────────────────────────────────── */
.cs-form-wrap {
    position: relative;
    background: var(--cs-bg-card);
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-radius);
    box-shadow: var(--cs-shadow);
    padding: 20px 24px;
    margin-bottom: 28px;
}

.cs-form-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
}

.cs-select {
    flex: 1 1 1;
    min-width: 0;
    height: 48px;
    padding: 0 14px;
    font-size: var(--cs-font-select);
    color: var(--cs-text);
    background: #fff;
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-radius-sm);
    outline: none;
    appearance: auto;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cs-select:focus {
    border-color: var(--cs-primary);
    box-shadow: 0 0 0 3px rgba(0,92,184,0.12);
}

.cs-search-btn {
    flex-shrink: 0;
    flex-grow: 0;
    height: 48px;
	width: 200px!important;
    padding: 0 32px!important;
    font-size: var(--cs-font-btn);
    font-weight: 600;
    color: #fff;
    background: var(--cs-accent);
    border: none;
    border-radius: var(--cs-radius-sm);
    cursor: pointer;
    white-space: nowrap;
	color: #ffffff!important;
	text-transform: normal!important;
    transition: background 0.2s, transform 0.1s;
}

.cs-search-btn:hover  { background: var(--cs-accent-hover); }
.cs-search-btn:active { transform: scale(0.98); }

/* ── Select2 overrides ───────────────────────────────────────────── */
.mrsync-cs .select2-container {
    flex: 1 1 0;
    min-width: 0;
}

.mrsync-cs .select2-container .select2-selection--single {
    height: 48px;
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-radius-sm);
    background: #fff;
    display: flex;
    align-items: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mrsync-cs .select2-container--default.select2-container--open .select2-selection--single,
.mrsync-cs .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--cs-primary);
    box-shadow: 0 0 0 3px rgba(0,92,184,0.12);
    outline: none;
}

.mrsync-cs .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 48px;
    padding-left: 14px;
    padding-right: 36px;
    font-size: var(--cs-font-select);
    color: var(--cs-text);
}

.mrsync-cs .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--cs-text-muted);
}

.mrsync-cs .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px;
    right: 8px;
}

.mrsync-cs .select2-dropdown {
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-radius-sm);
    box-shadow: var(--cs-shadow-hover);
    font-size: var(--cs-font-select);
}

.mrsync-cs .select2-search--dropdown {
    padding: 8px;
}

.mrsync-cs .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-radius-sm);
    padding: 6px 10px;
    font-size: 14px;
    outline: none;
    width: 100%;
}

.mrsync-cs .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--cs-primary);
}

.mrsync-cs .select2-results__option {
    padding: 8px 12px;
    font-size: var(--cs-font-select);
}

.mrsync-cs .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--cs-primary);
    color: #fff;
}

/* ── Spinner ─────────────────────────────────────────────────────── */
.cs-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 36px 0;
    color: var(--cs-text-muted);
    font-size: 15px;
}

.cs-spinner::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--cs-border);
    border-top-color: var(--cs-primary);
    border-radius: 50%;
    flex-shrink: 0;
    animation: cs-spin 0.7s linear infinite;
}

@keyframes cs-spin {
    to { transform: rotate(360deg); }
}

/* ── City grid ───────────────────────────────────────────────────── */
.cs-city-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    padding-bottom: 24px;
}

.cs-city-card {
    border: 1px solid var(--cs-city-border);
    border-radius: var(--cs-radius);
    background: var(--cs-city-bg);
    box-shadow: var(--cs-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.15s;
}

.cs-city-card:hover {
    box-shadow: var(--cs-shadow-hover);
    transform: translateY(-2px);
}

.cs-city-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 62px;
    padding: 14px 16px;
    font-size: var(--cs-font-city);
    font-weight: 600;
    color: var(--cs-city-text) !important;
    text-decoration: none !important;
    text-align: center;
    background: transparent;
    transition: background 0.15s;
    line-height: 1.3;
}

.cs-city-link:hover {
    background: var(--cs-city-bg-hover);
}

/* ── Detail grid ─────────────────────────────────────────────────── */
.cs-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-bottom: 24px;
}

.cs-detail-card {
    background: var(--cs-bg-card);
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-radius);
    box-shadow: var(--cs-shadow);
    padding: 24px 28px;
    transition: box-shadow 0.2s;
}

.cs-detail-card:hover {
    box-shadow: var(--cs-shadow-hover);
}

.cs-detail-title {
    font-size: var(--cs-font-title) !important;
    font-weight: 600 !important;
    color: var(--cs-title) !important;
    margin: 0 0 10px !important;
    line-height: 1.3;
}

.cs-detail-divider {
    height: 2px;
    background: linear-gradient(90deg, var(--cs-primary), transparent);
    border-radius: 2px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.cs-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.cs-detail-table td {
    padding: 5px 0;
    vertical-align: top;
    border: none !important;
    background: none !important;
}

.cs-detail-table tr + tr td {
    padding-top: 8px;
}

.cs-label {
    font-size: var(--cs-font-label);
    font-weight: 600;
    color: var(--cs-primary-dark);
    white-space: nowrap;
    padding-right: 16px !important;
    width: 90px;
    min-width: 90px;
}

.cs-value {
    font-size: var(--cs-font-value);
    color: var(--cs-text);
    line-height: 1.5;
    word-break: break-word;
}

.cs-value a {
    color: var(--cs-link) !important;
    text-decoration: none;
}

.cs-value a:hover {
    text-decoration: underline;
}

/* ── Notice states ───────────────────────────────────────────────── */
.cs-notice {
    padding: 14px 18px;
    border-radius: var(--cs-radius-sm);
    font-size: 14px;
    margin: 0;
}

.cs-notice--error {
    background: #fff2f2;
    color: #c0392b;
    border: 1px solid #f5c6c6;
}

.cs-notice--empty {
    background: #f5f8ff;
    color: var(--cs-text-muted);
    border: 1px solid var(--cs-border);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .cs-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cs-form-wrap {
        padding: 16px;
    }

    .cs-form-row {
        flex-wrap: wrap;
    }

    .cs-select,
    .cs-search-btn {
        width: 100%;
        flex: none;
    }

    .mrsync-cs .select2-container {
        width: 100% !important;
        flex: none;
    }

    .cs-city-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .cs-details-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .cs-detail-card {
        padding: 18px 20px;
    }
}

@media (max-width: 480px) {
    .cs-city-grid {
        grid-template-columns: 1fr 1fr;
    }

    .cs-detail-table tr {
        display: block;
        margin-bottom: 10px;
    }

    .cs-label,
    .cs-value {
        display: block;
        width: 100%;
        padding-right: 0 !important;
    }

    .cs-label {
        margin-bottom: 2px;
    }
}