:root {
    --bs-primary: #003333;
    --bs-primary-rgb: 0, 51, 51;
    --primary-dark: #002626;
}

.btn-primary {
    --bs-btn-bg: #003333;
    --bs-btn-border-color: #003333;
    --bs-btn-hover-bg: #002626;
    --bs-btn-hover-border-color: #002626;
    --bs-btn-active-bg: #001a1a;
    --bs-btn-active-border-color: #001a1a;
}

.bg-primary {
    background-color: #003333 !important;
}

.text-primary {
    color: #003333 !important;
}

.progress-bar {
    background-color: #003333;
}

.badge.bg-primary {
    background-color: #003333 !important;
}

body {
    background: #fafafa;
    min-height: 100vh;
}

.navbar-brand-logo {
    display: block;
    height: 36px;
    width: auto;
}

.main-content {
    padding-top: 4rem;
    padding-bottom: 1rem;
}

body.has-bottom-nav .main-content {
    padding-bottom: 5rem;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 1030;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: #666;
    padding: 0.25rem 0.5rem;
    min-width: 44px;
    min-height: 44px;
    text-decoration: none;
}

.bottom-nav-item:hover {
    color: #003333;
}

.bottom-nav-item .icon {
    font-size: 1.25rem;
    line-height: 1;
}

.bottom-nav-item .icon .bi {
    font-size: 1.35rem;
}

.choice-btn {
    white-space: normal;
    text-align: left;
    padding: 1rem;
    min-height: 44px;
}

.match-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0 auto;
    color: #666;
}

.match-circle.is-match {
    background: #003333;
    color: #fff;
}

.profile-photo img {
    object-fit: cover;
    width: 128px;
    height: 128px;
    border-radius: 50%;
}

.map-fullscreen {
    position: fixed;
    top: var(--map-nav-height, 3.5rem);
    left: 0;
    right: 0;
    bottom: var(--map-bottom-nav-height, 4.75rem);
    margin: 0;
    width: 100%;
    z-index: 1;
}

.full-map {
    height: 100%;
    width: 100%;
    z-index: 1;
}

.map-overlay {
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    width: max-content;
    max-width: calc(100% - 5rem);
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    text-align: center;
}

.map-overlay p {
    white-space: nowrap;
}

body.map-page {
    --map-nav-height: 3.5rem;
    --map-bottom-nav-height: 4.75rem;
}

body.map-page .main-content {
    padding-top: 0;
    padding-bottom: 0;
}

body.map-page.has-bottom-nav .main-content {
    padding-bottom: 0;
}

body.map-page:not(.has-bottom-nav) {
    --map-bottom-nav-height: 0rem;
}

@media (min-width: 992px) {
    body.map-page.has-bottom-nav {
        --map-bottom-nav-height: 0rem;
    }
}

.place-map {
    height: 300px;
    border-radius: 8px;
    z-index: 1;
}

.my-card-map {
    height: 260px;
    width: 100%;
    z-index: 1;
    border: 1px solid #dee2e6;
}

.my-card-map.map-empty {
    opacity: 0.85;
}

.card-placement-photo {
    display: block;
    width: 100%;
    max-height: 320px;
    min-height: 160px;
    object-fit: cover;
    background: #f1f3f5;
}

.card-tip-edit {
    color: #666;
    vertical-align: baseline;
    line-height: 1;
}

.card-tip-edit:hover,
.card-tip-edit:focus {
    color: #003333;
}

.hero-section {
    padding-top: 2rem;
}

.feature-card {
    height: 100%;
}

.match-card img {
    object-fit: cover;
    width: 64px;
    height: 64px;
}

.onboarding-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    justify-content: center;
}

.onboarding-step {
    font-size: 0.75rem;
    color: #888;
    background: #f1f1f1;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
}

.onboarding-step.is-active {
    background: #003333;
    color: #fff;
}

.onboarding-step.is-done {
    background: #e0f0f0;
    color: #003333;
}

.match-result-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 3px solid #003333;
}

.scan-result-profile-photo {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border: 3px solid #003333;
}

.scan-result-placement-photo {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border: 1px solid #dee2e6;
}

.chat-page {
    background: #e9ecef;
    --chat-nav-height: 3.5rem;
    --chat-bottom-nav-height: 4.75rem;
    --chat-compose-height: 5rem;
}

body.chat-page .main-content {
    padding-top: 0;
    padding-bottom: 0;
}

body.chat-page.has-bottom-nav .main-content {
    padding-bottom: 0;
}

.chat-shell {
    position: fixed;
    top: var(--chat-nav-height);
    left: 0;
    right: 0;
    bottom: var(--chat-bottom-nav-height);
    display: flex;
    flex-direction: column;
    max-width: 640px;
    margin: 0 auto;
    background: #e9ecef;
    z-index: 1;
}

body.chat-page:not(.has-bottom-nav) {
    --chat-bottom-nav-height: 0rem;
}

body.chat-page:not(.has-bottom-nav) .chat-compose {
    bottom: 0;
}

@media (min-width: 992px) {
    body.chat-page.has-bottom-nav {
        --chat-bottom-nav-height: 0rem;
    }

    body.chat-page.has-bottom-nav .chat-compose {
        bottom: 0;
    }
}

.chat-header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
}

.chat-header-info {
    flex: 1;
    min-width: 0;
}

.chat-header-actions {
    flex-shrink: 0;
    margin: 0;
}

.chat-block-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-flash {
    flex-shrink: 0;
    font-size: 0.875rem;
}

.chat-header-photo {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 1rem 0.5rem;
    scroll-padding-bottom: var(--chat-compose-height);
    -webkit-overflow-scrolling: touch;
}

.chat-messages-inner {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100%;
    padding-bottom: var(--chat-compose-height);
}

.chat-bubble {
    max-width: 85%;
    padding: 0.6rem 0.85rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    word-break: break-word;
}

.chat-bubble-mine {
    margin-left: auto;
    background: #003333;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-bubble-theirs {
    margin-right: auto;
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

.chat-bubble-mine .chat-time {
    color: rgba(255, 255, 255, 0.85);
}

.chat-time {
    font-size: 0.7rem;
    opacity: 0.8;
}

.chat-compose {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--chat-bottom-nav-height);
    z-index: 1025;
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    max-width: 640px;
    margin: 0 auto;
}

.chat-compose-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.chat-input {
    resize: none;
    border-radius: 1.25rem;
    max-height: 120px;
    line-height: 1.4;
    padding: 0.5rem 0.85rem;
}

.chat-send-btn {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.chat-empty {
    margin: auto;
}

.form-narrow {
    max-width: 420px;
}

.form-medium {
    max-width: 480px;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #003333;
    border-color: #003333;
}

.flatpickr-day.selected:hover,
.flatpickr-day:hover {
    background: #002626;
    border-color: #002626;
}

.input-group-text[role="button"] {
    cursor: pointer;
    user-select: none;
}

@media (min-width: 992px) {
    .bottom-nav {
        display: none;
    }

    body.has-bottom-nav .main-content {
        padding-bottom: 1rem;
    }
}
