/* LustLinx Main Styles */

:root {
    --ll-primary: #dc3545;
    --ll-primary-dark: #b02a37;
    --ll-secondary: #6c757d;
    --ll-dark: #1a1a2e;
    --ll-darker: #16213e;
    --ll-accent: #e94560;
    --ll-light: #f8f9fa;
    --ll-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --ll-card-hover-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

footer {
    margin-top: auto;
}

.footer-quick-links {
    display: inline-block;
    text-align: right;
    position: relative;
}

.footer-quick-links-toggle {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
}

.footer-quick-links-toggle::-webkit-details-marker {
    display: none;
}

.footer-quick-links-toggle:focus {
    outline: none;
}

.footer-quick-links-icon {
    display: inline-block;
    margin-left: 0.25rem;
    transition: transform 0.2s ease;
}

.footer-quick-links[open] .footer-quick-links-icon {
    transform: rotate(180deg);
}

.footer-quick-links ul {
    margin: 0;
    padding: 0.6rem 0.75rem;
    min-width: 240px;
    background: #ffffff;
    color: #111111;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.5rem);
    z-index: 30;
}

.footer-quick-links a {
    color: #111111 !important;
    text-decoration: none;
}

.footer-quick-links a:hover,
.footer-quick-links a:focus {
    color: #000000 !important;
    text-decoration: none;
}

.footer-quick-links li + li {
    margin-top: 0.35rem;
}

/* Navbar */
.navbar-brand {
    font-size: 1.4rem;
    letter-spacing: 1px;
}

@media (min-width: 992px) {
    .navbar-main > .container {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .navbar-main .navbar-brand {
        margin-top: 0.15rem;
        margin-bottom: 0;
    }
}

.navbar .badge {
    font-size: 0.65rem;
    vertical-align: top;
}

.navbar-toggler {
    position: relative;
}

.navbar-toggler .js-unread-badge-nav-toggle {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 1.15rem;
    padding: 0.22rem 0.34rem;
    line-height: 1;
    font-size: 0.62rem;
}

.navbar-stack-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.navbar-search-form {
    width: 100%;
    max-width: none;
    margin-bottom: 0.9rem;
}

/* Keep navbar search on its own row under brand/menu on desktop. */
.navbar-main > .container > .navbar-search-form {
    flex: 0 0 100%;
}

.navbar-search-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

#navbarSearchForm .navbar-search-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    overflow: visible;
}

/* Ensure Google Places custom element behaves like a standard field in navbar row. */
#navbarSearchForm gmp-place-autocomplete.nav-location {
    display: block;
}

#navbarSearchForm .navbar-search-row > .form-control,
#navbarSearchForm .navbar-search-row > .form-select,
#navbarSearchForm .navbar-search-row > .btn {
    width: auto !important;
    margin-bottom: 0 !important;
}

.navbar-search-form .form-control,
.navbar-search-form .form-select,
.navbar-search-form .btn {
    height: 34px;
    font-size: 0.82rem;
}

.navbar-search-form .form-control,
.navbar-search-form .form-select {
    border-color: rgba(255, 255, 255, 0.28);
}

.navbar-search-form .form-control::placeholder {
    color: #6c757d;
}

.navbar-search-form #navCategoryCombined {
    max-width: 250px;
}

.navbar-search-form #navRadius {
    max-width: 180px;
}

.navbar-search-form .nav-keyword {
    flex: 1 1 200px;
    min-width: 0;
}

.navbar-search-form .nav-category-combined {
    flex: 0 0 250px;
}

.navbar-search-form .nav-location {
    flex: 1 1 340px;
    min-width: 0;
}

.navbar-search-form .nav-radius {
    flex: 0 0 180px;
}

.navbar-search-form .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Keep Google Places suggestions above the sticky navbar. */
.pac-container {
    z-index: 1031 !important;
}

@media (max-width: 991.98px) {
    .navbar-stack-wrap {
        padding-top: 0.5rem;
    }

    #navbarSearchForm .navbar-search-row {
        flex-direction: column !important;
        align-items: stretch;
        overflow-x: visible;
        gap: 0.45rem;
    }

    #navbarSearchForm .navbar-search-row > .form-control,
    #navbarSearchForm .navbar-search-row > .form-select,
    #navbarSearchForm .navbar-search-row > .btn {
        width: 100% !important;
    }

    .navbar-search-form #navCategoryCombined,
    .navbar-search-form #navRadius {
        max-width: none;
    }

    .navbar-search-form .nav-category-combined,
    .navbar-search-form .nav-location,
    .navbar-search-form .nav-keyword,
    .navbar-search-form .nav-radius,
    .navbar-search-form .btn {
        flex: 1 1 auto;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--ll-dark) 0%, var(--ll-darker) 50%, var(--ll-accent) 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section .lead {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-search {
    max-width: 700px;
    margin: 0 auto;
}

.hero-search-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.hero-search-row + .hero-search-row {
    margin-top: 0.5rem;
}

.hero-search .form-control {
    height: 50px;
    border-radius: 25px;
    padding-left: 20px;
    font-size: 1.1rem;
}

.hero-search .form-select {
    height: 50px;
    border-radius: 25px;
    padding-left: 20px;
}

.hero-search .btn {
    height: 50px;
    border-radius: 25px;
    padding: 0 30px;
}

.hero-search .hero-keyword,
.hero-search .hero-location {
    flex: 1 1 auto;
    min-width: 0;
}

.hero-search .hero-category-combined {
    flex: 0 0 320px;
    max-width: 320px;
}

.hero-search .hero-radius {
    flex: 0 0 180px;
    max-width: 180px;
}

.hero-search .hero-search-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .hero-search-row {
        flex-wrap: wrap;
    }

    .hero-search .hero-category-combined,
    .hero-search .hero-radius,
    .hero-search .hero-search-btn {
        flex: 1 1 100%;
        max-width: none;
    }
}

/* Category Cards */
.category-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ll-card-hover-shadow);
}

.category-card .card-body {
    text-align: center;
    padding: 2rem 1rem;
}

.category-card .category-icon {
    font-size: 2.5rem;
    color: var(--ll-accent);
    margin-bottom: 1rem;
}

.category-card .category-count {
    font-size: 0.85rem;
    color: var(--ll-secondary);
}

/* Ad Cards */
.ad-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    position: relative;
}

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

.card-img-wrapper {
    height: 200px;
    overflow: hidden;
    background-color: #e9ecef;
    line-height: 0;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-img-wrapper .no-image-placeholder i {
    font-size: 2rem;
}

.ad-card .card-body {
    padding: 1rem;
}

.ad-card .card-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.badge-sm {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2em 0.5em;
}

.bedroom-role-badge {
    border: 1px solid transparent;
    font-weight: 600;
}

.bedroom-role-badge--top {
    background-color: #0d6efd;
    border-color: #0a58ca;
    color: #ffffff;
}

.bedroom-role-badge--versatile-top {
    background-color: #6f42c1;
    border-color: #59359a;
    color: #ffffff;
}

.bedroom-role-badge--versatile {
    background-color: #198754;
    border-color: #146c43;
    color: #ffffff;
}

.bedroom-role-badge--versatile-bottom {
    background-color: #fd7e14;
    border-color: #d7660d;
    color: #111111;
}

.bedroom-role-badge--bottom {
    background-color: #d63384;
    border-color: #b02a6b;
    color: #ffffff;
}

.bedroom-role-badge--not-specified {
    background-color: #6c757d;
    border-color: #565e64;
    color: #ffffff;
}

.bedroom-role-badge--default {
    background-color: #495057;
    border-color: #343a40;
    color: #ffffff;
}

.card-meta {
    border-top: 1px solid #f0f0f0;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.bookmark-icon-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 25;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: rgba(0, 0, 0, 0.12);
    color: #6c757d;
    padding: 0;
}

.bookmark-icon-btn i {
    font-size: 0.95rem;
}

.bookmark-icon-btn.is-bookmarked {
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.35);
}

.bookmark-text-btn.is-bookmarked {
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.35);
    background-color: rgba(220, 53, 69, 0.08);
}

.bookmark-toggle-btn:disabled {
    opacity: 0.75;
}

/* Blurred Overlay for Guest View */
.ad-blurred {
    position: relative;
    --guest-card-blur: 16px;
}

.ad-blurred .card-img-wrapper img,
.ad-blurred .card-img-wrapper .no-image-placeholder,
.ad-blurred .card-body {
    filter: blur(var(--guest-card-blur)) saturate(0.2) brightness(0.55);
    -webkit-filter: blur(var(--guest-card-blur)) saturate(0.2) brightness(0.55);
}

.blur-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.48);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    cursor: pointer;
    border-radius: 12px;
}

.blur-text {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-radius: 25px;
}

/* Nearby Ads Sidebar */
.nearby-ads-sidebar {
    position: sticky;
    top: 80px;
}

.nearby-card {
    transition: box-shadow 0.2s;
    border: none;
}

.nearby-card:hover {
    box-shadow: var(--ll-card-hover-shadow);
}

.nearby-img-wrapper {
    height: 80px;
    overflow: hidden;
    line-height: 0;
}

.nearby-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Ad Detail Page */
.ad-detail-gallery {
    margin-bottom: 1.5rem;
}

.ad-detail-main-image {
    --ad-main-image-radius: 15px;
    border-radius: var(--ad-main-image-radius);
    overflow: hidden;
    height: min(500px, 70vh);
    background-color: #f5f5f5;
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

.ad-detail-main-image > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: var(--ad-main-image-radius) !important;
    overflow: hidden;
}

.ad-detail-main-image img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    border-radius: var(--ad-main-image-radius) !important;
}

.ad-detail-main-image.image-protected::after,
.ad-detail-main-image .watermark-overlay {
    border-radius: var(--ad-main-image-radius) !important;
}

@media (max-width: 767.98px) {
    .ad-detail-main-image {
        height: min(420px, 60vh);
    }
}

.ad-detail-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 0;
}

.ad-detail-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.ad-detail-thumb:hover,
.ad-detail-thumb.active {
    border-color: var(--ll-primary);
}

.ad-detail-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ad-detail-thumb .image-protected {
    width: 100%;
    height: 100%;
    display: block;
}

.ad-detail-info dt {
    font-weight: 600;
    color: var(--ll-secondary);
}

.ad-title-row {
    display: block;
}

.ad-title-inline {
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.ad-meta-actions-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ad-badges-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.ad-badges-group .badge {
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.ad-title-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.ad-title-action form {
    margin: 0;
}

.ad-footer-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ad-footer-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ad-footer-actions form {
    margin: 0;
    display: inline-flex !important;
    align-items: center;
}

.ad-footer-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.ad-footer-actions .btn i {
    line-height: 1;
}

.ad-footer-time {
    margin-left: auto;
    white-space: nowrap;
}

/* Search Page */
.filter-sidebar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--ll-card-shadow);
}

.filter-sidebar.filters-disabled .filter-group {
    opacity: 0.75;
}

.filter-sidebar.filters-disabled input,
.filter-sidebar.filters-disabled select,
.filter-sidebar.filters-disabled button {
    cursor: not-allowed;
}

.filter-sidebar h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--ll-dark);
}

.filter-group {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f0f0f0;
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Multi-select Checkboxes for Bedroom Role */
.role-filter-group .form-check {
    margin-bottom: 0.25rem;
}

/* Image Preview */
.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e9ecef;
    line-height: 0;
}

.image-preview-item[draggable="true"] {
    cursor: grab;
}

.image-preview-item[draggable="true"]:active {
    cursor: grabbing;
}

.image-preview-item.is-dragging {
    opacity: 0.65;
}

.image-preview-item.drop-target {
    border-color: var(--ll-primary);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-preview-item .remove-image {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image Upload Dropzone */
.upload-dropzone {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    color: #6c757d;
    transition: border-color 0.2s, background-color 0.2s;
    cursor: pointer;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--ll-primary);
    background-color: rgba(220, 53, 69, 0.05);
}

.upload-dropzone i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 12px;
}

.modal-header {
    border-radius: 12px 12px 0 0;
}

/* Password Strength */
.password-strength-bar {
    height: 4px;
    border-radius: 2px;
    transition: all 0.3s;
    background-color: #e9ecef;
}

.password-strength-bar.strength-1 { background: linear-gradient(to right, #dc3545 25%, #e9ecef 25%); }
.password-strength-bar.strength-2 { background: linear-gradient(to right, #ffc107 50%, #e9ecef 50%); }
.password-strength-bar.strength-3 { background: linear-gradient(to right, #28a745 75%, #e9ecef 75%); }
.password-strength-bar.strength-4 { background: #28a745; }

/* Status Badges */
.badge-pending { background-color: #ffc107; color: #000; }
.badge-approved { background-color: #28a745; }
.badge-disabled { background-color: #dc3545; }

/* Section Headers */
.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-weight: 700;
    color: var(--ll-dark);
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 40px 0;
    }
    .hero-section h1 {
        font-size: 2rem;
    }
    .card-img-wrapper {
        height: 160px;
    }
    .ad-title-row {
        margin-bottom: 0.75rem !important;
    }

    .ad-meta-actions-row {
        align-items: flex-start;
        gap: 0.5rem;
    }

    .ad-badges-group {
        width: 100%;
    }

    .ad-title-action {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }

    .ad-title-action.d-flex {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .ad-footer-row {
        align-items: flex-start;
        gap: 0.35rem;
        flex-wrap: wrap;
    }

    .ad-footer-actions {
        order: 2;
        width: 100%;
        min-width: 0;
        flex: 0 0 100%;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.3rem;
        margin-top: 0.35rem;
    }

    .ad-footer-actions .btn {
        padding: 0.2rem 0.42rem;
        font-size: 0.72rem;
        line-height: 1.15;
        white-space: nowrap;
    }

    .ad-footer-actions .btn i {
        font-size: 0.78rem;
    }

    .ad-footer-time {
        order: 1;
        margin-left: 0;
        width: 100%;
        text-align: right;
        flex: 0 0 auto;
        font-size: 0.74rem;
    }
}

@media (max-width: 420px) {
    .ad-footer-actions .btn {
        padding: 0.16rem 0.34rem;
        font-size: 0.68rem;
    }
}
