/* Custom CSS replacing Bootstrap for Community Pages */

/* CSS Reset & Body */
* {
    box-sizing: border-box;
}

body {
    margin: 0;

    background-color: #F1F5F9;
    color: #334155;
    line-height: 1.5;
}

/* Reset & Full Width Constraint */
html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: 100%;
    box-sizing: border-box;
}

/* Flex utilities */
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-fill { flex: 1 1 auto !important; }
.gap-0 { gap: 0 !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

/* Grid system */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.5rem;
    margin-left: -0.5rem;
}
.row > * {
    box-sizing: border-box;
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
}
.g-1 { margin-right: -0.25rem; margin-left: -0.25rem; }
.g-1 > * { padding-right: 0.25rem; padding-left: 0.25rem; }
.g-2 { margin-right: -0.5rem; margin-left: -0.5rem; }
.g-2 > * { padding-right: 0.5rem; padding-left: 0.5rem; }
.g-3 { margin-right: -0.75rem; margin-left: -0.75rem; }
.g-3 > * { padding-right: 0.75rem; padding-left: 0.75rem; }

.col-12 { flex: 0 0 auto; width: 100%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-4 { flex: 0 0 auto; width: 33.333333%; }
.col-3 { flex: 0 0 auto; width: 25%; }
.col-auto { flex: 0 0 auto; width: auto; }

/* Headings */
.h1, h1 { font-size: calc(1.375rem + 1.5vw); }
.h2, h2 { font-size: calc(1.325rem + .9vw); }
.h3, h3 { font-size: calc(1.3rem + .6vw); }
.h4, h4 { font-size: calc(1.275rem + .3vw); }
.h5, h5 { font-size: 1.15rem; }
.h6, h6 { font-size: 1rem; }

/* Buttons & Groups */
.btn-group {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    width: 100%;
}
.btn-group > .btn {
    position: relative;
    flex: 1 1 auto;
    border-radius: 0;
}
.btn-group > .btn:first-child,
.btn-group > .btn-check:first-child + .btn {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}
.btn-group > .btn:last-child,
.btn-group > .btn-check:last-child + .btn,
.btn-group > :not(.btn-check:first-child) + .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}
.btn-check {
    position: absolute;
    clip: rect(0,0,0,0);
    pointer-events: none;
}
.btn-outline-primary {
    color: #004AAD;
    border: 1px solid #004AAD;
    background-color: transparent;
    cursor: pointer;
}
.btn-outline-primary:hover,
.btn-check:checked + .btn-outline-primary {
    color: #fff !important;
    background-color: #004AAD !important;
    border-color: #004AAD !important;
}

/* Card */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
}

/* List group */
.list-group {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    border-radius: 12px;
}
.list-group-flush > .list-group-item {
    border-width: 0 0 1px;
}
.list-group-flush > .list-group-item:last-child {
    border-bottom-width: 0;
}
.list-group-item {
    position: relative;
    display: block;
    padding: 0.75rem 1rem;
    color: #334155;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #E2E8F0;
}
.list-group-item-action {
    width: 100%;
    color: #334155;
    text-align: inherit;
    cursor: pointer;
}
.list-group-item-action:hover {
    background-color: #F8FAFC;
    color: #004AAD;
}

/* Layout & Containers */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

.d-flex {
    display: flex !important;
}

.flex-column {
    flex-direction: column !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.justify-content-center {
    justify-content: center !important;
}

.align-items-center {
    align-items: center !important;
}

.align-items-end {
    align-items: flex-end !important;
}

.flex-grow-1 {
    flex-grow: 1 !important;
}

.flex-shrink-0 {
    flex-shrink: 0 !important;
}

.position-relative {
    position: relative !important;
}

.position-absolute {
    position: absolute !important;
}

.top-0 {
    top: 0 !important;
}

.end-0 {
    right: 0 !important;
}

.w-100 {
    width: 100% !important;
}

/* Spacing */
.m-0 {
    margin: 0 !important;
}

.m-2 {
    margin: 0.5rem !important;
}

.mt-1 {
    margin-top: 0.25rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 0.25rem !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mb-5 {
    margin-bottom: 3rem !important;
}

.my-4 {
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.ms-1 {
    margin-left: 0.25rem !important;
}

.ms-2 {
    margin-left: 0.5rem !important;
}

.ms-3 {
    margin-left: 1rem !important;
}

.ms-auto {
    margin-left: auto !important;
}

.me-1 {
    margin-right: 0.25rem !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.me-3 {
    margin-right: 1rem !important;
}

.p-2 {
    padding: 0.5rem !important;
}

.p-4 {
    padding: 1.5rem !important;
}

.px-0 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.px-1 {
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
}

.px-4 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

.py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.py-3 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

.pt-2 {
    padding-top: 0.5rem !important;
}

.pt-3 {
    padding-top: 1rem !important;
}

.pt-4 {
    padding-top: 1.5rem !important;
}

.pb-0 {
    padding-bottom: 0 !important;
}

.pb-2 {
    padding-bottom: 0.5rem !important;
}

.pb-4 {
    padding-bottom: 1.5rem !important;
}

/* Typography */
.text-center {
    text-align: center !important;
}

.text-end {
    text-align: right !important;
}

.text-start {
    text-align: left !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.fw-normal {
    font-weight: 400 !important;
}

.fs-1 {
    font-size: 2.5rem !important;
}

.fs-4 {
    font-size: 1.5rem !important;
}

.fs-5 {
    font-size: 1.25rem !important;
}

.fs-6 {
    font-size: 1rem !important;
}

.small {
    font-size: 0.875em !important;
}

.text-primary {
    color: #004AAD !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-muted {
    color: #6c757d !important;
}

.text-dark {
    color: #212529 !important;
}

.text-white {
    color: #fff !important;
}

.text-secondary {
    color: #6c757d !important;
}

.text-decoration-none {
    text-decoration: none !important;
}

/* Backgrounds & Borders */
.bg-primary {
    background-color: #004AAD !important;
}

.bg-light {
    background-color: #f8f9fa !important;
}

.bg-white {
    background-color: #fff !important;
}

.border {
    border: 1px solid #dee2e6 !important;
}

.border-0 {
    border: 0 !important;
}

.border-top {
    border-top: 1px solid #dee2e6 !important;
}

.border-start-0 {
    border-left: 0 !important;
}

.border-end-0 {
    border-right: 0 !important;
}

.rounded-circle {
    border-radius: 50% !important;
}

.rounded-pill {
    border-radius: 50rem !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.25rem;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

.btn-primary {
    background-color: #004AAD;
    color: #fff;
}

.btn-primary:hover {
    background-color: #003380;
    color: #fff;
}

.btn-light {
    background-color: #f8f9fa;
    color: #212529;
    border-color: #f8f9fa;
}

.btn-light:hover {
    background-color: #e2e6ea;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}

.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em 0.25em;
    color: #000;
    background: transparent;
    border: 0;
    border-radius: 0.25rem;
    opacity: 0.5;
    cursor: pointer;
}

.btn-close:before {
    content: "\d7";
    font-size: 1.5em;
    line-height: 0.5em;
    font-family: sans-serif;
}

.btn-close-sm {
    width: 0.5em;
    height: 0.5em;
    padding: 0.1em;
}

/* Forms */
.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color .15s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: #86b7fe;
}

.form-control-lg {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    border-radius: 0.3rem;
}

.form-select {
    display: block;
    width: 100%;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.form-select-sm {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    padding-left: 0.5rem;
    font-size: 0.875rem;
}

.form-select-lg {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
    font-size: 1.25rem;
}

.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group>.form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    white-space: nowrap;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1055;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 0.5rem;
    pointer-events: none;
    width: 100%;
    max-width: 500px;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
}

.modal-sm {
    max-width: 300px;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: 0.3rem;
    outline: 0;
}

.modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: calc(0.3rem - 1px);
    border-top-right-radius: calc(0.3rem - 1px);
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem;
    border-top: 1px solid #dee2e6;
    border-bottom-right-radius: calc(0.3rem - 1px);
    border-bottom-left-radius: calc(0.3rem - 1px);
}

/* Breadcrumbs (Flexbox) */
.breadcrumb {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 10px 0 !important;
    font-size: 13.5px !important;
    gap: 6px !important;
}

.breadcrumb-item {
    display: inline-flex !important;
    align-items: center !important;
}

.breadcrumb-item a {
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.breadcrumb-item a:hover {
    text-decoration: underline !important;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›" !important;
    display: inline-block !important;
    font-size: 16px !important;
    line-height: 1 !important;
    margin-right: 6px !important;
    padding: 0 !important;
    opacity: 0.6;
}

.breadcrumb-item.active {
    font-weight: 600;
}

/* Badges & Alerts */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.alert {
    position: relative;
    padding: 1rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

/* Spinners */
@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    z-index: 1000;
    display: none;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0;
    font-size: 1rem;
    color: #212529;
    text-align: left;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 0.25rem;
    right: 0;
    top: 100%;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.25rem 1rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    text-decoration: none;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

/* ==========================================================================
   Google Places Autocomplete Suggestions UI Polish
   ========================================================================== */
.pac-container {
    z-index: 999999999 !important;
    border-radius: 14px !important;
    margin-top: 6px !important;
    box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.16), 0 8px 16px -4px rgba(15, 23, 42, 0.08) !important;
    border: 1px solid #E2E8F0 !important;
    font-family: inherit !important;
    background-color: #ffffff !important;
    min-width: 280px !important;
    padding: 6px 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.pac-item {
    padding: 10px 14px !important;
    font-size: 13.5px !important;
    color: #475569 !important;
    cursor: pointer !important;
    border-top: 1px solid #F1F5F9 !important;
    display: flex !important;
    align-items: center !important;
    line-height: 1.4 !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
}

.pac-item:first-child {
    border-top: none !important;
}

.pac-item:hover, .pac-item.pac-item-selected {
    background-color: #F8FAFC !important;
    color: #004AAD !important;
}

.pac-icon {
    margin-top: 0 !important;
    margin-right: 12px !important;
    background-image: none !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    border-radius: 50% !important;
    background-color: #EEF2FF !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

.pac-icon::before {
    content: "\f3c5";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 11px;
    color: #4F46E5;
}

.pac-item-query {
    font-size: 14px !important;
    color: #0F172A !important;
    font-weight: 600 !important;
    padding-right: 4px !important;
}

.pac-matched {
    color: #004AAD !important;
    font-weight: 700 !important;
}

.pac-logo:after {
    padding: 6px 14px !important;
    height: 18px !important;
    opacity: 0.65 !important;
}