/**
 * TransHoes (TDT) — Main application styles
 * Brand: teal #0d9488 — no purple themes
 */

:root,
[data-bs-theme="light"] {
    --tdt-teal: #0d9488;
    --tdt-teal-dark: #0f766e;
    --tdt-teal-light: #14b8a6;
    --tdt-teal-subtle: rgba(13, 148, 136, 0.12);
    --tdt-gradient: linear-gradient(135deg, #0d9488 0%, #14b8a6 50%, #0f766e 100%);
    --tdt-gradient-soft: linear-gradient(180deg, rgba(13, 148, 136, 0.08) 0%, transparent 100%);
    --tdt-body-bg: #f8fafc;
    --tdt-card-bg: #ffffff;
    --tdt-border: rgba(0, 0, 0, 0.08);
    --tdt-text-muted: #64748b;
    --tdt-navbar-bg: rgba(255, 255, 255, 0.92);
    --tdt-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    --tdt-shadow-lg: 0 10px 40px rgba(15, 23, 42, 0.12);
}

[data-bs-theme="dark"] {
    --tdt-teal-subtle: rgba(20, 184, 166, 0.15);
    --tdt-body-bg: #0f172a;
    --tdt-card-bg: #1e293b;
    --tdt-border: rgba(255, 255, 255, 0.08);
    --tdt-text-muted: #94a3b8;
    --tdt-navbar-bg: rgba(15, 23, 42, 0.95);
    --tdt-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --tdt-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Bootstrap overrides */
.text-teal { color: var(--tdt-teal) !important; }
.bg-teal { background-color: var(--tdt-teal) !important; }
.bg-teal-subtle { background-color: var(--tdt-teal-subtle) !important; }
.border-teal { border-color: var(--tdt-teal) !important; }

.btn-teal {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--tdt-teal);
    --bs-btn-border-color: var(--tdt-teal);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--tdt-teal-dark);
    --bs-btn-hover-border-color: var(--tdt-teal-dark);
    --bs-btn-active-bg: var(--tdt-teal-dark);
    --bs-btn-active-border-color: var(--tdt-teal-dark);
}

.btn-outline-teal {
    --bs-btn-color: var(--tdt-teal);
    --bs-btn-border-color: var(--tdt-teal);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--tdt-teal);
    --bs-btn-hover-border-color: var(--tdt-teal);
}

.nav-pills .nav-link.active {
    background-color: var(--tdt-teal);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--tdt-teal-light);
    box-shadow: 0 0 0 0.2rem rgba(13, 148, 136, 0.2);
}

/* Layout */
body.tdt-app,
body.tdt-guest {
    background-color: var(--tdt-body-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.tdt-main { flex: 1; }

.tdt-navbar {
    background: var(--tdt-navbar-bg) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--tdt-border);
    box-shadow: var(--tdt-shadow);
}

.tdt-logo {
    background: var(--tdt-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.25rem;
}

.tdt-nav-avatar {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
}

.tdt-badge {
    position: absolute;
    top: 2px;
    right: -4px;
    font-size: 0.65rem;
}

.tdt-footer {
    background: var(--tdt-card-bg);
    border-top: 1px solid var(--tdt-border);
    color: var(--tdt-text-muted);
}

.tdt-footer a {
    color: var(--tdt-text-muted);
    text-decoration: none;
}

.tdt-footer a:hover { color: var(--tdt-teal); }

/* Hero (landing) */
.tdt-hero {
    background: var(--tdt-gradient);
    position: relative;
    overflow: hidden;
}

.tdt-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.12) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 40%);
    pointer-events: none;
}

.tdt-hero-title { letter-spacing: -0.02em; }

.tdt-stat-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    padding: 1rem;
    backdrop-filter: blur(8px);
}

.tdt-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.tdt-stat-label {
    font-size: 0.85rem;
    opacity: 0.85;
}

.tdt-country-card,
.tdt-feature-icon {
    transition: transform 0.2s, box-shadow 0.2s;
}

.tdt-country-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--tdt-shadow-lg);
}

.tdt-country-icon {
    color: var(--tdt-teal);
    font-size: 1.25rem;
}

.tdt-feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tdt-teal-subtle);
    color: var(--tdt-teal);
    border-radius: 12px;
    font-size: 1.25rem;
}

/* Auth */
.tdt-auth-wrap { min-height: calc(100vh - 120px); }

.tdt-auth-card {
    background: var(--tdt-card-bg);
    border-radius: 1rem !important;
}

.letter-spacing-wide { letter-spacing: 0.35em; }

.tdt-post-card { cursor: pointer; }
.tdt-post-card .tdt-post-actions,
.tdt-post-card .dropdown { cursor: default; }

.tdt-post-video-link { color: inherit; }
.tdt-video-play-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.tdt-video-play-badge i {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.tdt-composer {
    background: var(--tdt-card-bg);
    border: 1px solid var(--tdt-border);
    box-shadow: var(--tdt-shadow);
}

.tdt-post-card {
    background: var(--tdt-card-bg);
    border: 1px solid var(--tdt-border);
    box-shadow: var(--tdt-shadow);
    transition: box-shadow 0.2s;
}

.tdt-post-card:hover { box-shadow: var(--tdt-shadow-lg); }

.tdt-post-avatar {
    width: 44px;
    height: 44px;
    object-fit: cover;
}

.tdt-post-image {
    max-height: 420px;
    object-fit: cover;
    width: 100%;
}

.tdt-post-content { word-break: break-word; }

.tdt-post-content .hashtag,
.tdt-post-content .mention {
    color: var(--tdt-teal);
    text-decoration: none;
    font-weight: 500;
}

.tdt-post-content .hashtag:hover,
.tdt-post-content .mention:hover { text-decoration: underline; }

.tdt-post-actions .btn-link {
    text-decoration: none;
    padding: 0.25rem 0.5rem;
}

.tdt-post-actions .btn-link.active { font-weight: 600; }

.tdt-feed-tabs .nav-link:not(.active) { color: var(--tdt-text-muted); }

/* Profile */
.tdt-profile-cover-wrap {
    position: relative;
    height: 220px;
    background: var(--tdt-gradient);
}

.tdt-profile-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tdt-profile-header { margin-top: -48px; }

.tdt-profile-avatar-wrap { position: relative; }

.tdt-profile-avatar {
    width: 120px;
    height: 120px;
    object-fit: cover;
    background: var(--tdt-card-bg);
}

.tdt-profile-avatar-private { width: 96px; height: 96px; object-fit: cover; }

.tdt-avatar-upload,
.tdt-cover-upload {
    position: absolute;
}

.tdt-avatar-upload {
    bottom: 4px;
    right: 4px;
}

.tdt-cover-upload {
    bottom: 12px;
    right: 12px;
}

.btn-opacity { background: rgba(0,0,0,0.5); color: #fff; border: none; }

/* Directory */
.tdt-directory-scroll { max-height: 400px; overflow-y: auto; }
.tdt-directory-filter { min-width: min(100%, 280px); }

.tdt-profile-locked {
    background: var(--tdt-gradient-soft);
    border-radius: 0.75rem;
    border: 1px dashed var(--tdt-border);
}
.tdt-lock-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--tdt-teal-subtle);
    color: var(--tdt-teal);
    font-size: 1.35rem;
}

/* Dating & user cards */
.tdt-user-card,
.tdt-dating-card {
    background: var(--tdt-card-bg);
    border: 1px solid var(--tdt-border);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tdt-user-card:hover,
.tdt-dating-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--tdt-shadow-lg);
}

.tdt-user-card-avatar {
    width: 72px;
    height: 72px;
    object-fit: cover;
}

.tdt-dating-card-img-wrap {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--tdt-teal-subtle);
}

.tdt-dating-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tdt-online-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: #22c55e;
    color: #fff;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.tdt-online-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    flex-shrink: 0;
}

.tdt-unread-dot {
    width: 8px;
    height: 8px;
    background: var(--tdt-teal);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Chat */
.tdt-chat-layout { min-height: 70vh; }

.tdt-chat-sidebar { max-height: 75vh; overflow-y: auto; }

.tdt-conversation-list .list-group-item.active {
    background: var(--tdt-teal-subtle);
    border-color: var(--tdt-border);
    color: inherit;
}

.tdt-chat-panel { min-height: 60vh; }

.tdt-chat-messages {
    overflow-y: auto;
    max-height: 55vh;
    display: flex;
    flex-direction: column;
}

.tdt-chat-bubble-wrap { max-width: 75%; }

.tdt-chat-bubble-wrap.mine {
    align-self: flex-end;
    text-align: right;
}

.tdt-chat-bubble-wrap.theirs { align-self: flex-start; }

.tdt-chat-bubble {
    display: inline-block;
    padding: 0.5rem 0.85rem;
    border-radius: 1rem;
    background: var(--tdt-teal-subtle);
    text-align: left;
    word-break: break-word;
}

.tdt-chat-bubble-wrap.mine .tdt-chat-bubble {
    background: var(--tdt-teal);
    color: #fff;
}

.tdt-chat-empty { min-height: 300px; background: var(--tdt-card-bg); }

/* Gallery */
.tdt-album-cover { height: 120px; }

.tdt-gallery-item img {
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform 0.2s;
}

.tdt-gallery-item:hover img { transform: scale(1.03); }

/* Settings */
.tdt-settings-nav .list-group-item.active {
    background: var(--tdt-teal);
    border-color: var(--tdt-teal);
}

/* Search */
.tdt-search-filters { z-index: 10; }

/* Default avatar fallback via CSS (img[src*="default-avatar"]) */
img[src*="default-avatar"] {
    background: #e2e8f0;
}

[data-bs-theme="dark"] img[src*="default-avatar"] {
    background: #334155;
}

/* Responsive */
@media (max-width: 767.98px) {
    .tdt-profile-cover-wrap { height: 160px; }
    .tdt-profile-avatar { width: 88px; height: 88px; }
    .tdt-hero-title { font-size: 2.25rem; }
    .tdt-chat-layout .tdt-chat-sidebar { max-height: none; }
}

@media (max-width: 575.98px) {
    .tdt-post-actions .btn-link span:not(.tdt-like-count) { display: none; }
}

/* Utilities */
.min-w-0 { min-width: 0; }

.spinner-border.text-teal {
    color: var(--tdt-teal) !important;
}

.tdt-post-card { cursor: pointer; }
.tdt-post-card .tdt-post-actions,
.tdt-post-card .dropdown { cursor: default; }
.tdt-post-video-link { color: inherit; }
.tdt-video-play-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.tdt-video-play-badge i {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Reddit-style floating chat popup */
.tdt-chat-fab {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 56px;
    height: 56px;
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}
.tdt-chat-fab.is-hidden { display: none !important; }

.tdt-chat-popup {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1050;
    width: min(380px, calc(100vw - 1.5rem));
}
.tdt-chat-popup[hidden] {
    display: none !important;
}
.tdt-chat-popup.is-open {
    display: block !important;
}
.tdt-chat-popup-panel {
    height: min(560px, calc(100vh - 5rem));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 1rem !important;
}
.tdt-chat-popup-head {
    background: var(--tdt-card-bg);
    flex-shrink: 0;
}
.tdt-chat-popup-inbox,
.tdt-chat-popup-thread {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.tdt-chat-inbox-list {
    overflow-y: auto;
    flex: 1;
}
.tdt-chat-popup-messages {
    overflow-y: auto;
    background: var(--tdt-gradient-soft);
}
.tdt-chat-popup .tdt-chat-bubble-wrap {
    display: flex;
    flex-direction: column;
}
.tdt-chat-popup .tdt-chat-bubble-wrap.mine { align-items: flex-end; margin-left: auto; }
.tdt-chat-popup .tdt-chat-bubble-wrap.theirs { align-items: flex-start; margin-right: auto; }

@media (max-width: 575.98px) {
    .tdt-chat-popup {
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
    }
    .tdt-chat-popup-panel {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0 !important;
    }
    .tdt-chat-fab { right: 1rem; bottom: 1rem; }
}

/* Lightbox */
body.tdt-lightbox-open { overflow: hidden; }
a.tdt-lightbox { cursor: zoom-in; text-decoration: none; color: inherit; }
.tdt-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 3.5rem 4rem;
}
.tdt-lightbox-overlay[hidden] { display: none !important; }
.tdt-lightbox-stage {
    max-width: min(1100px, 100%);
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tdt-lightbox-image,
.tdt-lightbox-video {
    max-width: 100%;
    max-height: calc(100vh - 7rem);
    border-radius: 0.5rem;
    box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
.tdt-lightbox-close,
.tdt-lightbox-prev,
.tdt-lightbox-next {
    position: absolute;
    border: 0;
    background: rgba(255,255,255,.12);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s;
}
.tdt-lightbox-close:hover,
.tdt-lightbox-prev:hover,
.tdt-lightbox-next:hover { background: rgba(255,255,255,.22); }
.tdt-lightbox-close {
    top: 1rem;
    right: 1rem;
    font-size: 1.75rem;
    line-height: 1;
}
.tdt-lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.tdt-lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.tdt-lightbox-caption,
.tdt-lightbox-counter {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255,255,255,.85);
    font-size: .9rem;
    padding: 0 1rem;
}
.tdt-lightbox-caption { bottom: 2.25rem; }
.tdt-lightbox-counter { bottom: .75rem; opacity: .7; }

@media (max-width: 575.98px) {
    .tdt-lightbox-overlay { padding: 3.5rem .75rem 4rem; }
    .tdt-lightbox-prev { left: .35rem; }
    .tdt-lightbox-next { right: .35rem; }
}

/* Classified ad list boxes (HuntLocals-style) */
.tdt-ad-listings .list-item { padding: 0; }
.tdt-ad-listings .list-item > .row {
    margin-bottom: 1.25rem;
    border-radius: 20px;
    border: 1px solid #e8e7ea;
    overflow: hidden;
    align-items: stretch;
    background: var(--bs-body-bg, #fff);
}
.tdt-ad-listings .listing-image {
    display: flex;
    height: 150px;
    overflow: hidden;
    padding: 0;
}
.tdt-ad-listings .listing-image a {
    display: block;
    width: 100%;
    height: 100%;
}
.tdt-ad-listings .listing-image img {
    width: 100%;
    height: 100%;
    border-radius: 20px 0 0 20px;
    object-fit: cover;
    object-position: center;
}
.tdt-ad-listings .list-details {
    padding: 0.5rem 0.75rem 0.65rem;
}
.tdt-ad-listings .list-details h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    color: inherit;
}
.tdt-ad-listings .list-details a { text-decoration: none; color: inherit; }
.tdt-ad-listings .list-details a:hover h3 { text-decoration: underline; }
.tdt-ad-listings .list-details .card-text {
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    max-height: 4.5em;
    overflow: hidden;
    color: var(--bs-secondary-color, #6c757d);
}
.tdt-ad-listings .tdt-ad-meta {
    font-size: 0.9rem;
    font-weight: 600;
}
.tdt-wp-btn {
    background-color: #4cba59;
    border-color: #4cba59;
    color: #fff;
}
.tdt-wp-btn:hover {
    background-color: #3ca048;
    border-color: #3ca048;
    color: #fff;
}
.tdt-post-ads-step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 2px solid #adb5bd;
    color: #6c757d;
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
}
.tdt-post-ads-step.is-active .tdt-post-ads-step-icon {
    border-color: #ee8722;
    color: #ee8722;
}
.tdt-post-ads-step.is-active { color: #ee8722; }

[data-bs-theme="dark"] .tdt-ad-listings .list-item > .row {
    border-color: rgba(255,255,255,.12);
    background: rgba(255,255,255,.03);
}

@media (max-width: 575.98px) {
    .tdt-ad-listings .listing-image { height: 120px; }
    .tdt-ad-listings .list-details h3 { font-size: 1rem; }
}
