/* Global Styles */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    
    /* Light mode colors */
    --bg-color: #FCFCFC;
    --text-color: #212529;
    --text-muted: #6c757d;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --navbar-bg: #0d6efd;
    --navbar-text: #ffffff;
    
    /* Transition property */
    --transition-disabled: all 0.3s ease;
}

/* Disable all transitions when no-transitions class is present */
.no-transitions *,
.no-transitions {
    transition: none !important;
}

/* Dark mode colors */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e9ecef;
    --text-muted: #adb5bd;
    --card-bg: #2d2d2d;
    --border-color: #495057;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --navbar-bg: #0d1117;
    --navbar-text: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    padding: 0;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition-disabled, background-color 0.3s ease, color 0.3s ease);
    
    /* padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    box-sizing: border-box; */
}

main {
    background-color: var(--bg-color);
    transition: var(--transition-disabled, background-color 0.3s ease);
    /* padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-top: max(16px, env(safe-area-inset-top));
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right)); */
}

footer {
    /* padding-bottom: max(16px, env(safe-area-inset-bottom)); */
}

.navbar {
    padding-top: max(.5rem, env(safe-area-inset-top));
    background-color: var(--navbar-bg) !important;
    /* transition: var(--transition-disabled, background-color 0.3s ease); */
    z-index: 1040;
    overflow: visible;
}

.navbar-nav {
    display: flex;
    flex-direction: row;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
    gap: 18px;
    align-items: center;
    justify-content: end;
    overflow: visible;
    position: relative;
}

.nav-item.dropdown {
    position: relative;
    overflow: visible;
}

.dropdown-menu-end {
    right: 0;
    left: auto;
}

/* Prevent dropdown from affecting navbar height */
.navbar .dropdown-menu {
    position: absolute !important;
    float: none;
    margin: 0;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Flash Messages Overlay */
.flash-messages-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1039 !important;
    pointer-events: none;
    padding: 0;
    margin: 0;
}

.flash-messages-overlay .alert {
    cursor: pointer;
    margin: 0;
    margin-top: 64px;
    padding: 0.4rem 1rem;
    border: none;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: auto;
    font-weight: 500;
    letter-spacing: 0.025em;
    /* transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); */
    animation: slideDown 0.3s ease-out;
}

/* Light mode flash message styles */
.flash-messages-overlay .alert-success {
    background: rgba(25, 135, 84, 0.95);
    color: #ffffff;
    border-left: 4px solid #198754;
}

.flash-messages-overlay .alert-danger {
    background: rgba(220, 53, 69, 0.95);
    color: #ffffff;
    border-left: 4px solid #dc3545;
}

/* Dark mode flash message styles */
[data-theme="dark"] .flash-messages-overlay .alert-success {
    background: rgba(25, 135, 84, 0.9);
    color: #ffffff;
    border-left: 4px solid #20c997;
}

[data-theme="dark"] .flash-messages-overlay .alert-danger {
    background: rgba(220, 53, 69, 0.9);
    color: #ffffff;
    border-left: 4px solid #ff6b6b;
}

/* Flash message animations */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.flash-messages-overlay .alert.fade-out {
    animation: slideUp 0.3s ease-in forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .flash-messages-overlay .alert {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
}

/* Ensure dropdown works properly on mobile */
@media (max-width: 991.98px) {
    .dropdown-menu {
        position: static !important;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
    }
    
    .dropdown-menu-end {
        right: auto;
        left: auto;
    }
}

/* Dark mode specific styles */
[data-theme="dark"] .card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .form-control {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .form-control:focus {
    background-color: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--text-color);
}

[data-theme="dark"] .btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: var(--border-color);
    color: var(--bg-color);
}

/* Dark mode toggle button styles */
.theme-toggle {
    background: none;
    border: none;
    color: var(--navbar-text);
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--navbar-text);
}

.theme-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

@media (max-width: 991.98px) {
  .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    /* Prevent content from being hidden under navbar */
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  }

  .flash-messages-overlay {
    position: fixed;
  }

  body {
    padding-top: calc(
        max(.5rem, env(safe-area-inset-top)) + 
        var(--bs-navbar-height, 56px)
    );
  }
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.navbar-logo {
    height: 40px;
    width: auto;
    transition: transform 0.3s ease;
    border-radius: 100%;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

/* Admin indicator */
.admin-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 20px;
    color: #ffc107;
    font-size: 0.875rem;
    font-weight: 600;
    animation: pulse-glow 2s ease-in-out infinite;
}

.admin-indicator i {
    font-size: 1rem;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 193, 7, 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 193, 7, 0.6);
    }
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.dropdown-menu {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    margin-top: 0.125rem;
    transform: none !important;
}

.dropdown-item {
    color: var(--text-color);
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: white;
}

[data-theme="dark"] .dropdown-menu {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

/* Generic Modal Dark Mode Support */
[data-theme="dark"] .modal-content {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}
[data-theme="dark"] .modal-header {
    border-bottom-color: var(--border-color);
}
[data-theme="dark"] .modal-footer {
    border-top-color: var(--border-color);
}
[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ============================================ */
/* Contact Advertiser Modal Styles              */
/* ============================================ */
.contact-modal-content {
  background: var(--card-bg);
  border: none;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

[data-theme] #contactAdvertiserModal .modal-dialog {
  /* default keeps Bootstrap behavior on mobile */
}
@media (min-width: 992px) {
  #contactAdvertiserModal .modal-dialog {
    max-width: 625px; /* 25% wider than default ~500px */
  }
}

[data-theme="dark"] .contact-modal-content {
  background: rgba(33, 37, 41, 0.95);
  backdrop-filter: blur(10px);
}

.contact-modal-content .modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
}

.contact-modal-content .modal-title {
  color: var(--text-color);
  font-weight: 700;
  font-size: 0.875rem; /* 30% smaller than default ~1.25rem */
}

.contact-modal-content .modal-body {
  padding: 1rem 1.25rem 1.25rem;
}

.contact-header {
  display: flex;
  gap: 12px;
}

.contact-header .contact-cover {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.contact-header .contact-title {
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 2px;
}

.contact-header .contact-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.contact-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.contact-sub .contact-avatar {
  margin-right: 8px;
  vertical-align: middle;
}

.contact-field .form-label {
  font-weight: 600;
  color: var(--text-color);
}

.contact-field .input-group-text {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-muted);
}

[data-theme="dark"] .contact-field .input-group-text {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-color);
}

.contact-field .form-control {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-color);
}

.contact-actions {
  gap: 8px;
}

.contact-actions .btn-primary {
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.25);
}

/* Success animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
.fade-in-up {
  animation: fadeInUp 0.35s ease-out both;
}

.contact-success-icon {
  font-size: 2rem;
}

.contact-disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.contact-disclaimer a {
  text-decoration: underline;
}

/* Already contacted indicator */
.ad-card.already_contacted {
  outline: 2px solid rgba(25, 135, 84, 0.35);
  border-radius: 12px;
}
.already-contacted-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(25, 135, 84, 0.12);
  color: #198754;
  font-weight: 600;
  font-size: 0.8rem;
}

/* Compact "ticket" style for the inputs area inside the contact modal (not the modal itself) */
.contact-modal-content #contactAdvertiserForm,
.contact-modal-content #contactAdvertiserFormPanel,
.contact-modal-content form[id^="contactAdvertiserFormPanel-"] {
  background: var(--bg-secondary);
  border: 2px dashed var(--border-color);
  border-radius: 14px;
  padding: 0.75rem 0.75rem;
}

[data-theme="dark"] .contact-modal-content #contactAdvertiserForm,
[data-theme="dark"] .contact-modal-content #contactAdvertiserFormPanel,
[data-theme="dark"] .contact-modal-content form[id^="contactAdvertiserFormPanel-"] {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-color);
}

.contact-modal-content #contactAdvertiserForm .contact-field,
.contact-modal-content #contactAdvertiserFormPanel .contact-field,
.contact-modal-content form[id^="contactAdvertiserFormPanel-"] .contact-field {
  margin-bottom: 0.5rem !important; /* make it more compact */
}

.contact-modal-content #contactAdvertiserForm .form-label,
.contact-modal-content #contactAdvertiserFormPanel .form-label,
.contact-modal-content form[id^="contactAdvertiserFormPanel-"] .form-label {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.contact-modal-content #contactAdvertiserForm .input-group-text,
.contact-modal-content #contactAdvertiserFormPanel .input-group-text,
.contact-modal-content form[id^="contactAdvertiserFormPanel-"] .input-group-text {
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
}

.contact-modal-content #contactAdvertiserForm .form-control,
.contact-modal-content #contactAdvertiserFormPanel .form-control,
.contact-modal-content form[id^="contactAdvertiserFormPanel-"] .form-control {
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  font-size: 0.95rem;
}

.contact-modal-content #contactAdvertiserForm .contact-actions,
.contact-modal-content #contactAdvertiserFormPanel .contact-actions,
.contact-modal-content form[id^="contactAdvertiserFormPanel-"] .contact-actions {
  margin-top: 0.25rem;
}

.contact-modal-content #contactAdvertiserForm .form-check-label,
.contact-modal-content #contactAdvertiserFormPanel .form-check-label,
.contact-modal-content form[id^="contactAdvertiserFormPanel-"] .form-check-label {
  font-size: 0.8rem;
}

/* Contact success checklist */
.contact-tips-list {
  list-style: none;
  padding-left: 0;
  margin: 0.25rem 0 0;
  text-align: left;
}
.contact-tips-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 6px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.contact-tips-list .tip-icon {
  color: #198754;
  font-size: 0.95rem;
  line-height: 1.2;
  margin-top: 2px;
}

.location-info {
    font-size: 0.9rem;
}

/* ============================================ */
/* News Card Styles                             */
/* ============================================ */

.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  background: linear-gradient(180deg, var(--card-bg) 0%, rgba(255, 255, 255, 0.96) 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1.25rem;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

[data-theme="dark"] .news-card {
  background: linear-gradient(180deg, rgba(22, 27, 34, 0.96) 0%, rgba(11, 15, 22, 0.92) 100%);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}

.news-card:hover {
  transform: translateY(-6px);
  border-color: rgba(13, 110, 253, 0.35);
  box-shadow: 0 35px 80px rgba(13, 110, 253, 0.18);
}

.news-card-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  min-height: 220px;
  background: var(--bg-secondary);
}

.news-card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 45%, rgba(15, 23, 42, 0.45) 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}

.news-card:hover .news-card-media::after {
  opacity: 1;
}

.news-card-media img,
.news-card-media .placeholder-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.25, 0.25, 0, 1);
}

.news-card:hover .news-card-media img {
  transform: scale(1.05);
}

.news-card .placeholder-image {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.16));
  color: var(--text-muted);
  font-size: 2rem;
}

[data-theme="dark"] .news-card .placeholder-image {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
}

.news-card-body {
  padding: 1.4rem 1.5rem 1.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.news-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  row-gap: 0.4rem;
}

.news-card-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  background: rgba(13, 110, 253, 0.12);
  color: var(--primary-color);
  border: 1px solid rgba(13, 110, 253, 0.25);
}

[data-theme="dark"] .news-card-chip {
  background: rgba(13, 110, 253, 0.25);
  color: #d6e4ff;
  border-color: rgba(13, 110, 253, 0.35);
}

.news-card-chip i,
.news-card-meta-date i {
  font-size: 0.7rem;
}

.news-card-meta-date {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.news-card-meta-views {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

.news-card-title {
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.35rem);
  line-height: 1.35;
  margin: 0;
  color: var(--text-color);
}

.news-card-summary {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.news-card-footer {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  align-items: flex-start;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
}

.news-card-footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-color);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.news-card-footer-cta i {
  font-size: 0.88rem;
  transition: transform 0.2s ease;
}

.news-card:hover .news-card-footer-cta {
  border-color: rgba(13, 110, 253, 0.4);
  background: rgba(13, 110, 253, 0.08);
  transform: translateX(4px);
}

.news-card:hover .news-card-footer-cta i {
  transform: translateX(3px);
}

[data-theme="dark"] .news-card-footer-cta {
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .news-card:hover .news-card-footer-cta {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

.featured-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  background: linear-gradient(135deg, #ffe066, #ffb347);
  color: #111;
  box-shadow: 0 12px 25px rgba(255, 179, 71, 0.4);
  animation: badgePulse 2.6s ease-in-out infinite;
}

.featured-badge i {
  font-size: 0.75rem;
}

[data-theme="dark"] .featured-badge {
  background: linear-gradient(135deg, #ffd166, #f4a261);
  color: #111;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
}

@media (max-width: 768px) {
  .news-card-body {
    padding: 1.25rem 1.25rem 1.4rem;
  }

  .news-card-media {
    min-height: 200px;
  }

  .featured-badge {
    font-size: 0.65rem;
    padding: 0.3rem 0.65rem;
  }
}

@media (max-width: 576px) {
  .news-card-media {
    min-height: 180px;
  }

  .news-card-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- RESULTS ADS STYLES (Unified from search.css and home.css) --- */

/* Animated gradient keyframes for result cards */
@keyframes borderGradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Results Grid */
.results-grid {
  margin-top: 1.5rem;
  margin-bottom: 3.5rem;
}

.results-grid .result-card,
.map-popup .result-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
  position: relative;
  overflow: hidden;
  height: 260px;
  width: 100%;
  display: block;
  border: 3px solid transparent;
  border-radius: 16px;
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-image: linear-gradient(var(--card-bg), var(--card-bg)), linear-gradient(45deg, #667eea7b 0%, #764ba280 20%, #f193fb71 40%, #f5576c7b 60%, #4facfe7c 80%, #00f1fe74 100%);
  background-size: 100% 100%, 300% 100%;
  /* animation: borderGradientShift 12s ease-in-out infinite;
  will-change: background-position; */
}

.card-img-full {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.card-img-overlay-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.5rem 0.5rem 0.75rem 0.5rem;
  z-index: 2;
  width: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 62%, rgba(0, 0, 0, 0.0) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.result-desc {
  font-size: 0.49em; /* reduced ~30% */
  font-weight: 400;
  color: #fff;
  text-shadow: 1px 1px 4px rgb(0 0 0);
}

.results-grid .card-footer,
.results-grid .card-body {
  display: none !important;
}

.results-grid .result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  /* animation: borderGradientShift 1.5s ease-in-out infinite; */
}

.placeholder-image {
  background: var(--border-color);
}

/* Result card link styling */
.result-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.result-card-link:hover {
  text-decoration: none;
  color: inherit;
}

/* Condensed card text */
.results-grid .card-text {
  font-size: 0.85rem;
  color: var(--text-color);
}

.results-grid .card-footer {
  font-size: 1.25em;
  font-weight: bold;
  padding: 0.25rem 0.5rem;
  border-radius: 0 0 .25rem .25rem;
  background-color: var(--primary-color);
  color: white;
  text-align: center;
}

.results-grid .edit-ad-btn {
  position: absolute;
  z-index: 10;
  margin: 11px;
  border-radius: 8px;
}

.results-grid.edit-ad-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Featured Card Styles */
.result-card.featured-card {
  border: 3px solid #ffc107;
  box-shadow: 0 8px 24px rgba(255, 193, 7, 0.3);
  background-image: linear-gradient(var(--card-bg), var(--card-bg)), 
                    linear-gradient(45deg, #ffc107 0%, #ff9800 50%, #ffc107 100%);
  animation: featuredGlow 3s ease-in-out infinite;
}

.result-card.featured-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 32px rgba(255, 193, 7, 0.4);
}

@keyframes featuredGlow {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(255, 193, 7, 0.3);
  }
  50% {
    box-shadow: 0 8px 32px rgba(255, 193, 7, 0.5);
  }
}

/* Make Leaflet popup chrome transparent within our map containers globally */
.search-map-container .leaflet-popup-content-wrapper,
.search-map-container .leaflet-popup-tip {
  background: transparent;
  box-shadow: none;
  border: none;
}
.search-map-container .leaflet-popup-content {
  margin: 0;
}

/* Apply same popup reset to inline preview map containers */
.search-map-preview .leaflet-popup-content-wrapper,
.search-map-preview .leaflet-popup-tip {
  background: transparent;
  box-shadow: none;
  border: none;
  border-radius: 0;
  padding: 0;
}
.search-map-preview .leaflet-popup-content {
  margin: 0;
  padding: 0;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Featured card typography */
.featured-card .result-desc {
  font-size: 1.1em;
  font-weight: 600;
}

/* Dark mode adjustments for featured cards */
[data-theme="dark"] .result-card.featured-card {
  border-color: #ffb300;
  box-shadow: 0 8px 24px rgba(255, 179, 0, 0.4);
}

/* Floating Search Button (Home only for now) */
.floating-search-btn {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 20%, #f093fb 40%, #f5576c 60%, #4facfe 80%, #00f2fe 100%);
  background-size: 300% 100%;
  box-shadow: 0 10px 30px rgba(102,126,234,0.25);
  z-index: 1045;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.2s ease;
}

.floating-search-btn i {
  font-size: 1.25rem;
}

.floating-search-btn:hover {
  transform: translateY(-2px) scale(1.03);
}

.floating-search-btn.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .floating-search-btn {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}




/* Responsive adjustments for result cards */
@media (max-width: 500px) {
  .navbar-brand {
    font-size: 1.2rem;
  }
}


@media (max-width: 290px) {
  .navbar-logo {
    height: 32px;
  }
}


/* ============================================ */
/* Modal Card Styles (generic) */
/* ============================================ */

/* Modal Icon */
.option-icon-modal {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s ease;
}

.option-card-modal:hover .option-icon-modal {
  transform: scale(1.1) rotate(5deg);
}

/* Modal Text */
.option-title-modal {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text-color);
}

.option-subtitle-modal {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 0.5rem;
}

.option-description-modal {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-color);
  opacity: 0.75;
  margin-bottom: 1rem;
  flex-grow: 1;
}

/* Coming Soon Badge Modal */
.coming-soon-badge-modal {
  position: absolute;
  top: 12px;
  right: -25px;
  background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
  color: white;
  padding: 0.25rem 1.75rem;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transform: rotate(45deg);
  box-shadow: 0 3px 10px rgba(245, 87, 108, 0.3);
  z-index: 1;
}

/* CTA Button Modal */
.option-cta-modal {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.75rem;
  transition: all 0.3s ease;
  margin-top: auto;
}

.free-option-modal .option-cta-modal {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.free-option-modal:hover .option-cta-modal {
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  transform: scale(1.05);
}

.option-cta-modal.disabled {
  background: var(--bs-gray-300);
  color: var(--bs-gray-600);
  cursor: not-allowed;
  opacity: 0.6;
}

[data-theme="dark"] .option-cta-modal.disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

.option-cta-modal i {
  transition: transform 0.3s ease;
  font-size: 0.7rem;
}

.free-option-modal:hover .option-cta-modal i {
  transform: translateX(3px);
}

/* Mobile Full Screen Modal */
@media (max-width: 768px) {
  #publishOptionsModal.modal {
    padding: 0 !important;
  }
  
  .publish-modal-dialog {
    margin: 0;
    max-width: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for better mobile support */
  }
  
  .publish-modal-content {
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  
  .publish-modal-content .modal-header {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
  }
  
  .publish-modal-content .modal-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    align-items: center;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
  }
  
  .publish-modal-content .modal-body .row {
    width: 100%;
    margin: 0;
  }
  
  .option-card-modal {
    padding: 1.5rem 1.25rem;
    min-height: auto;
  }
  
  .option-icon-modal {
    width: 55px;
    height: 55px;
    font-size: 1.4rem;
  }
  
  .option-title-modal {
    font-size: 1.15rem;
  }
  
  .option-subtitle-modal {
    font-size: 0.8rem;
  }
  
  .option-description-modal {
    font-size: 0.8rem;
  }
  
  .option-cta-modal {
    padding: 0.7rem 1.4rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .publish-modal-content .modal-title {
    font-size: 1.2rem;
  }
  
  .publish-modal-content .modal-header {
    padding: 0.875rem 1rem;
  }
  
  .publish-modal-content .modal-body {
    padding: 0.75rem;
  }
  
  .option-card-modal {
    padding: 1.25rem 0.875rem;
    min-height: auto;
  }
  
  .option-icon-modal {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
  }
  
  .option-title-modal {
    font-size: 1rem;
  }
  
  .option-subtitle-modal {
    font-size: 0.7rem;
  }
  
  .option-description-modal {
    font-size: 0.7rem;
    line-height: 1.3;
  }
  
  .option-cta-modal {
    padding: 0.6rem 1.2rem;
    font-size: 0.75rem;
  }
}
