/**
 * RateRun Directory Styles
 * Matches the RateRun theme design system
 */

/* === CRITICAL: Override theme body constraints for directory pages === */
body.directory-page {
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior-y: auto !important;
}

/* Hide the app grid layout on directory pages */
body.directory-page .app-grid {
    display: none !important;
}

body.directory-page .mobile-bottom-nav {
    display: none !important;
}

/* === CSS Variables (inherited from theme, with directory-specific additions) === */
:root {
    --dir-bg-app: #0f1115;
    --dir-bg-panel: #161b22;
    --dir-bg-card: #1c2128;
    --dir-border: #30363d;
    --dir-text-main: #f0f6fc;
    --dir-text-muted: #8b949e;
    --dir-accent: #238636;
    --dir-accent-hover: #2ea043;
    --dir-radius: 12px;
    --dir-radius-sm: 8px;
    --dir-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* === Directory Wrapper === */
.directory-wrapper {
    min-height: 100vh;
    background: var(--dir-bg-app);
    color: var(--dir-text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.directory-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* === Header === */
.directory-header {
    background: rgba(22, 27, 34, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--dir-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.directory-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.directory-logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--dir-text-main);
}

.directory-logo-img {
    height: 32px;
    border-radius: 6px;
}

.directory-logo-text {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--dir-text-muted);
}

.directory-nav {
    display: flex;
    gap: 8px;
}

.directory-nav-link {
    padding: 8px 16px;
    color: var(--dir-text-muted);
    text-decoration: none;
    border-radius: var(--dir-radius-sm);
    transition: all 0.2s;
    font-size: 0.9rem;
}

.directory-nav-link:hover {
    color: var(--dir-text-main);
    background: rgba(255, 255, 255, 0.05);
}

.directory-nav-link.active {
    color: var(--dir-accent);
    background: rgba(35, 134, 54, 0.1);
}

.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--dir-accent);
    color: white;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: 5px;
}

.directory-header-actions {
    display: flex;
    gap: 10px;
}

.directory-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--dir-text-main);
    cursor: pointer;
    padding: 8px;
}

.directory-mobile-nav {
    display: none;
    flex-direction: column;
    background: var(--dir-bg-panel);
    border-bottom: 1px solid var(--dir-border);
    padding: 10px 20px;
    position: relative;
    z-index: 99;
}

.directory-mobile-nav.open {
    display: flex;
}

.directory-mobile-nav a {
    padding: 12px 0;
    color: var(--dir-text-main);
    text-decoration: none;
    border-bottom: 1px solid var(--dir-border);
}

.directory-mobile-nav a:last-child {
    border-bottom: none;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--dir-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--dir-accent);
    color: white;
}

.btn-primary:hover {
    background: var(--dir-accent-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--dir-border);
    color: var(--dir-text-main);
}

.btn-outline:hover {
    border-color: var(--dir-accent);
    color: var(--dir-accent);
}

.btn-ghost {
    background: transparent;
    color: var(--dir-text-muted);
}

.btn-ghost:hover {
    color: var(--dir-text-main);
    background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === Hero Section === */
.directory-hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(180deg, rgba(35, 134, 54, 0.1) 0%, transparent 100%);
    border-radius: var(--dir-radius);
    margin-bottom: 40px;
}

.directory-hero h1 {
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.directory-hero p {
    color: var(--dir-text-muted);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* === Search Form === */
.directory-search-form {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto 30px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dir-text-muted);
}

.search-input {
    width: 100%;
    padding: 14px 14px 14px 45px;
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius-sm);
    color: var(--dir-text-main);
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--dir-accent);
}

.search-typeahead {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--dir-bg-card);
    border: 1px solid var(--dir-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.search-typeahead-group {
    padding: 6px 0;
    border-bottom: 1px solid var(--dir-border);
}

.search-typeahead-group:last-child {
    border-bottom: none;
}

.search-typeahead-label {
    padding: 4px 16px;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--dir-text-muted);
    letter-spacing: 0.5px;
}

.search-typeahead-item {
    display: block;
    padding: 8px 16px;
    color: var(--dir-text-main);
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
}

.search-typeahead-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--dir-accent);
}

/* === Quick Categories === */
.quick-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.quick-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: 20px;
    color: var(--dir-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.quick-category:hover {
    border-color: var(--dir-accent);
    color: var(--dir-accent);
}

.quick-category-icon {
    display: flex;
}

/* === Recently Viewed === */
.recently-viewed-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--dir-border);
}

.recently-viewed-title {
    font-size: 0.9rem;
    color: var(--dir-text-muted);
    margin: 0 0 12px;
    font-weight: 500;
}

.recently-viewed-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}

.recently-viewed-grid::-webkit-scrollbar {
    display: none;
}

.rv-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    max-width: 240px;
    padding: 10px 14px;
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: 10px;
    text-decoration: none;
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.rv-card:hover {
    border-color: var(--dir-accent);
}

.rv-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--dir-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--dir-text);
    flex-shrink: 0;
    overflow: hidden;
}

.rv-avatar.has-logo {
    background: transparent;
}

.rv-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rv-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rv-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dir-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rv-category {
    font-size: 0.75rem;
    color: var(--dir-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === Content Grid (Sidebar + Main) === */
.directory-content-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
}

/* === Mobile Filters Toggle (hidden on desktop) === */
.mobile-filters-toggle {
    display: none;
}

/* === Sidebar === */
.directory-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.filter-section {
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.filter-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dir-text-main);
}

.filter-list {
    list-style: none;
}

.filter-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    color: var(--dir-text-muted);
    text-decoration: none;
    border-radius: var(--dir-radius-sm);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-link:hover {
    color: var(--dir-text-main);
    background: rgba(255, 255, 255, 0.05);
}

.filter-link.active {
    color: var(--dir-accent);
    background: rgba(35, 134, 54, 0.1);
}

.filter-icon {
    display: flex;
    color: var(--dir-text-muted);
}

.filter-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--dir-text-muted);
    background: rgba(255,255,255,0.06);
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.filter-link.active .filter-count {
    background: rgba(35, 134, 54, 0.15);
    color: var(--dir-accent);
}

.filter-sublist {
    list-style: none;
    margin-left: 20px;
    margin-top: 5px;
}

.filter-link-sub {
    font-size: 0.85rem;
    padding: 6px 10px;
}

.filter-select {
    width: 100%;
    padding: 10px;
    background: var(--dir-bg-app);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius-sm);
    color: var(--dir-text-main);
    font-size: 0.9rem;
}

.sidebar-cta {
    background: linear-gradient(135deg, var(--dir-accent) 0%, #1a6328 100%);
    border-radius: var(--dir-radius);
    padding: 20px;
    text-align: center;
}

.sidebar-cta h4 {
    margin-bottom: 8px;
}

.sidebar-cta p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.sidebar-cta .btn {
    background: white;
    color: var(--dir-accent);
}

/* === Listings Grid === */
.listings-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.listings-header h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.listings-subtitle {
    color: var(--dir-text-muted);
    font-size: 0.9rem;
}

.listings-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sort-select {
    padding: 6px 30px 6px 10px;
    border: 1px solid var(--dir-border);
    border-radius: 6px;
    background: var(--dir-card-bg);
    color: var(--dir-text);
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.sort-select:focus {
    outline: none;
    border-color: var(--dir-primary);
}

.active-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(35, 134, 54, 0.2);
    border: 1px solid var(--dir-accent);
    border-radius: 20px;
    color: var(--dir-accent);
    font-size: 0.85rem;
}

.filter-tag-remove {
    color: var(--dir-accent);
    text-decoration: none;
    font-weight: bold;
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* === Listing Card === */
.listing-card {
    display: block;
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius);
    padding: 20px;
    text-decoration: none;
    color: var(--dir-text-main);
    transition: all 0.2s;
}

.listing-card:hover {
    border-color: var(--dir-accent);
    transform: translateY(-2px);
    box-shadow: var(--dir-shadow);
}

.listing-card-header {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
}

.listing-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--dir-accent), #1a6328);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.listing-card-title h3 {
    font-size: 1rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--dir-accent);
    border-radius: 50%;
    color: white;
    font-size: 0.65rem;
}

/* Featured listing badge & card highlight */
.featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    background: linear-gradient(135deg, #f0c27f, #fc5c7d);
    color: #000;
    padding: 3px 10px;
    border-radius: 0 0 8px 8px;
    position: absolute;
    top: 0;
    right: 16px;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.listing-card-featured {
    position: relative;
    border-color: rgba(240, 194, 127, 0.4);
    box-shadow: 0 0 0 1px rgba(240, 194, 127, 0.15);
}

.listing-card-featured:hover {
    border-color: rgba(240, 194, 127, 0.6);
}

.listing-category {
    font-size: 0.8rem;
    color: var(--dir-text-muted);
}

.listing-tagline {
    font-size: 0.9rem;
    color: var(--dir-text-muted);
    margin-bottom: 15px;
    line-height: 1.4;
}

.listing-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.listing-location {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--dir-text-muted);
}

/* === Loading & Empty States === */
.listings-loading,
.no-listings,
.no-messages,
.auth-required,
.upgrade-required,
.not-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--dir-text-muted);
}

.listings-loading .spinner,
.messages-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--dir-border);
    border-top-color: var(--dir-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-listings h3,
.no-messages h3,
.auth-required h2,
.upgrade-required h2,
.not-found h1 {
    color: var(--dir-text-main);
    margin: 15px 0 10px;
}

.no-listings svg,
.no-messages svg {
    color: var(--dir-border);
}

/* Skeleton Loading Cards */
.skeleton-card {
    pointer-events: none;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--dir-border);
    flex-shrink: 0;
}

.skeleton-line {
    border-radius: 4px;
    background: var(--dir-border);
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.15; }
}

.skeleton-pulse {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* === Pagination === */
.listings-pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

.pagination-info {
    color: var(--dir-text-muted);
    font-size: 0.9rem;
}

/* === Single Listing Page === */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
    font-size: 0.85rem;
    color: var(--dir-text-muted);
}

.breadcrumb a {
    color: var(--dir-text-muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--dir-accent);
}

.breadcrumb-sep {
    opacity: 0.5;
}

.draft-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 166, 0, 0.1);
    border: 1px solid #ffa500;
    border-radius: var(--dir-radius-sm);
    padding: 12px 20px;
    margin-bottom: 25px;
    color: #ffa500;
}

.listing-detail {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
}

.listing-main {
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius);
    padding: 30px;
}

.listing-header {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--dir-border);
}

.listing-avatar-large {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--dir-accent), #1a6328);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
}

.listing-header-info h1 {
    font-size: 1.6rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.verified-badge-large {
    font-size: 0.75rem;
    background: var(--dir-accent);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: normal;
}

.listing-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.listing-category-badge,
.listing-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--dir-text-muted);
}

.listing-rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.85rem;
    color: var(--dir-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.listing-rating-badge:hover {
    color: var(--dir-text-main);
}

.listing-rating-badge .star-filled {
    color: #f59e0b;
}

.listing-rating-badge .star-empty {
    color: var(--dir-text-muted);
    opacity: 0.3;
}

.listing-rating-count {
    margin-left: 2px;
}

.listing-tagline-large {
    font-size: 1.1rem;
    color: var(--dir-text-muted);
}

.listing-section {
    margin-bottom: 30px;
}

.listing-section h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.listing-description {
    color: var(--dir-text-muted);
    line-height: 1.7;
}

.listing-stats {
    display: flex;
    gap: 40px;
    padding: 20px;
    background: var(--dir-bg-app);
    border-radius: var(--dir-radius-sm);
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--dir-text-main);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--dir-text-muted);
}

/* === Sidebar (Single Listing) === */
.listing-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.listing-actions {
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius);
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.listing-actions .btn.favorited {
    color: #ff6b6b;
}

.listing-contact-card {
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.listing-contact-card h3 {
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    color: var(--dir-text-main);
    text-decoration: none;
    background: var(--dir-bg-app);
    border-radius: var(--dir-radius-sm);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.contact-item:hover {
    background: rgba(35, 134, 54, 0.1);
}

.contact-locked {
    text-align: center;
    color: var(--dir-text-muted);
}

.contact-locked svg {
    margin-bottom: 10px;
    opacity: 0.5;
}

.contact-locked-hint {
    font-size: 0.8rem;
    margin-top: 10px;
}

.raterun-promo {
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius);
    padding: 20px;
    text-align: center;
}

.promo-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--dir-text-muted);
    margin-bottom: 10px;
}

.promo-logo {
    height: 40px;
    margin-bottom: 10px;
}

.raterun-promo p {
    font-size: 0.85rem;
    color: var(--dir-text-muted);
    margin-bottom: 15px;
}

/* === Modal === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius);
    width: 100%;
    max-width: 500px;
    margin: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--dir-border);
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--dir-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

#contact-form {
    padding: 20px;
}

/* === Form Styles === */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background: var(--dir-bg-app);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius-sm);
    color: var(--dir-text-main);
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--dir-accent);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--dir-text-muted);
}

.form-hint a {
    color: var(--dir-accent);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group-btn {
    display: flex;
    align-items: flex-end;
}

/* === Manage Page === */
.manage-container {
    max-width: 1000px;
}

.manage-header {
    margin-bottom: 30px;
}

.manage-header h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.manage-header p {
    color: var(--dir-text-muted);
}

.manage-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.listing-form {
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius);
    padding: 30px;
}

.form-section {
    margin-bottom: 35px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--dir-border);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.form-section h2 {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.pro-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 166, 0, 0.1);
    border-radius: var(--dir-radius-sm);
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: #ffa500;
}

.pro-notice a {
    color: #ffa500;
    font-weight: 600;
}

.form-actions-sticky {
    display: flex;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--dir-border);
}

.add-location-form {
    background: var(--dir-bg-app);
    padding: 15px;
    border-radius: var(--dir-radius-sm);
    margin-top: 10px;
}

/* === Manage Sidebar === */
.manage-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-card {
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.sidebar-card h3 {
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.published {
    background: rgba(35, 134, 54, 0.2);
    color: var(--dir-accent);
}

.status-badge.draft {
    background: rgba(255, 166, 0, 0.2);
    color: #ffa500;
}

.status-badge.new {
    background: rgba(139, 148, 158, 0.2);
    color: var(--dir-text-muted);
}

.publish-status p {
    font-size: 0.85rem;
    color: var(--dir-text-muted);
    margin: 10px 0 15px;
}

.listing-preview {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.preview-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--dir-accent), #1a6328);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.preview-info h4 {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.preview-tagline {
    font-size: 0.8rem;
    color: var(--dir-text-muted);
}

.sidebar-card.tips ul {
    list-style: none;
}

.sidebar-card.tips li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--dir-text-muted);
}

.sidebar-card.tips li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--dir-accent);
}

.completion-bar {
    width: 100%;
    height: 8px;
    background: var(--dir-bg-app);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.completion-fill {
    height: 100%;
    background: linear-gradient(90deg, #238636, #2ea043);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.completion-pct {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dir-accent);
    margin: 0 0 4px;
}

.completion-nudge-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    max-width: 340px;
    background: var(--dir-bg-card);
    border: 1px solid var(--dir-border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: slideInUp 0.3s ease;
}

.completion-nudge-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: var(--dir-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.widget-code-box {
    width: 100%;
    min-height: 60px;
    font-family: monospace;
    font-size: 0.7rem;
    padding: 8px;
    background: var(--dir-bg-app);
    border: 1px solid var(--dir-border);
    color: var(--dir-text-muted);
    border-radius: 6px;
    resize: none;
    cursor: pointer;
}

/* === Messages === */
.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.messages-tabs {
    display: flex;
    gap: 5px;
    background: var(--dir-bg-panel);
    padding: 4px;
    border-radius: var(--dir-radius-sm);
}

.tab-btn {
    padding: 8px 20px;
    background: transparent;
    border: none;
    color: var(--dir-text-muted);
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
}

.tab-btn.active {
    background: var(--dir-accent);
    color: white;
}

.messages-list {
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius);
}

.message-item {
    display: flex;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid var(--dir-border);
    cursor: pointer;
    transition: background 0.2s;
}

.message-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.message-item:last-child {
    border-bottom: none;
}

.message-item.unread {
    background: rgba(35, 134, 54, 0.05);
}

.message-avatar {
    width: 45px;
    height: 45px;
    background: var(--dir-bg-app);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.message-from {
    font-weight: 600;
}

.quote-badge {
    font-size: 0.7rem;
    background: rgba(35, 134, 54, 0.2);
    color: var(--dir-accent);
    padding: 2px 8px;
    border-radius: 10px;
}

.message-date {
    font-size: 0.8rem;
    color: var(--dir-text-muted);
    margin-left: auto;
}

.message-subject {
    font-weight: 500;
    margin-bottom: 5px;
}

.message-preview {
    font-size: 0.9rem;
    color: var(--dir-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-listing {
    font-size: 0.8rem;
    color: var(--dir-text-muted);
    margin-top: 5px;
}

/* === Favorites === */
.favorites-header {
    margin-bottom: 25px;
}

.favorites-header h1 {
    margin-bottom: 5px;
}

.favorites-header p {
    color: var(--dir-text-muted);
}

.remove-favorite-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.remove-favorite-btn:hover {
    opacity: 1;
}

/* === Search Results === */
.search-header {
    margin-bottom: 30px;
}

.search-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.search-header h1 {
    margin-bottom: 10px;
}

.search-header p {
    color: var(--dir-text-muted);
    margin-bottom: 20px;
}

.search-form-inline {
    max-width: 100%;
}

.results-count {
    grid-column: 1 / -1;
    font-size: 0.9rem;
    color: var(--dir-text-muted);
    margin-bottom: 10px;
}

/* === Footer === */
.directory-footer {
    background: var(--dir-bg-panel);
    border-top: 1px solid var(--dir-border);
    margin-top: 60px;
}

.directory-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
}

.directory-footer-brand .footer-logo {
    height: 40px;
    margin-bottom: 15px;
}

.directory-footer-brand p {
    color: var(--dir-text-muted);
    font-size: 0.9rem;
}

.directory-footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.footer-col h4 {
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.footer-col a {
    display: block;
    color: var(--dir-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.footer-col a:hover {
    color: var(--dir-accent);
}

.directory-footer-cta {
    text-align: right;
}

.directory-footer-cta h4 {
    margin-bottom: 10px;
}

.directory-footer-cta p {
    color: var(--dir-text-muted);
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.directory-footer-bottom {
    border-top: 1px solid var(--dir-border);
    padding: 20px;
    text-align: center;
    color: var(--dir-text-muted);
    font-size: 0.8rem;
}

/* === Toast Notifications === */
.directory-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.directory-toast {
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    color: var(--dir-text-main);
    padding: 14px 20px;
    border-radius: var(--dir-radius-sm);
    box-shadow: var(--dir-shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    border-left: 4px solid var(--dir-text-muted);
    animation: slideIn 0.3s ease;
}

.directory-toast.success {
    border-left-color: var(--dir-accent);
}

.directory-toast.error {
    border-left-color: #ff6b6b;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* === Mobile Responsive === */
@media screen and (max-width: 900px) {
    .directory-header-inner {
        flex-wrap: wrap;
    }

    .directory-nav,
    .directory-header-actions {
        display: none;
    }

    .directory-mobile-toggle {
        display: block;
    }

    .directory-content-grid {
        grid-template-columns: 1fr;
    }

    .mobile-filters-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        order: -2;
        width: 100%;
        padding: 12px 16px;
        background: var(--dir-bg-panel);
        border: 1px solid var(--dir-border);
        border-radius: 10px;
        color: var(--dir-text);
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        transition: border-color 0.2s;
    }

    .mobile-filters-toggle:hover {
        border-color: var(--dir-accent);
    }

    .mobile-filters-chevron {
        margin-left: auto;
        transition: transform 0.3s;
    }

    .mobile-filters-toggle.open .mobile-filters-chevron {
        transform: rotate(180deg);
    }

    .directory-sidebar {
        position: static;
        order: -1;
        display: none;
    }

    .directory-sidebar.open {
        display: block;
    }

    .listing-detail {
        grid-template-columns: 1fr;
    }

    .listing-sidebar {
        position: static;
    }

    .manage-grid {
        grid-template-columns: 1fr;
    }

    .manage-sidebar {
        position: static;
        order: -1;
    }

    .directory-hero h1 {
        font-size: 1.6rem;
    }

    .directory-search-form {
        flex-direction: column;
    }

    .listing-header {
        flex-direction: column;
        text-align: center;
    }

    .listing-meta {
        justify-content: center;
        flex-wrap: wrap;
    }

    .listing-stats {
        flex-direction: column;
        gap: 20px;
    }

    .directory-footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .directory-footer-links {
        justify-content: center;
    }

    .directory-footer-cta {
        text-align: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .messages-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

@media screen and (max-width: 600px) {
    .directory-container {
        padding: 20px 15px;
    }

    .listings-grid {
        grid-template-columns: 1fr;
    }

    .listings-header {
        flex-direction: column;
        gap: 12px;
    }

    .search-header-top {
        flex-direction: column;
    }

    .quick-categories {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        mask-image: linear-gradient(to right, #000 85%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, #000 85%, transparent 100%);
    }

    .quick-categories::-webkit-scrollbar {
        display: none;
    }

    .quick-category {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

/* === Features Selector (Manage Form) === */

.form-section-desc {
    color: var(--dir-text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.form-hint-inline {
    color: var(--dir-text-muted);
    font-weight: 400;
    font-size: 0.85rem;
}

.features-input-wrap {
    position: relative;
}

.selected-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.selected-features:empty {
    margin-bottom: 0;
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--dir-accent);
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.feature-tag-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    margin-left: 2px;
}

.feature-tag-remove:hover {
    color: #fff;
}

.feature-input-row {
    display: flex;
    gap: 8px;
}

.feature-input-row input {
    flex: 1;
}

.feature-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--dir-bg-card);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius-sm);
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--dir-shadow);
}

.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.suggestion-item:hover {
    background: var(--dir-bg-panel);
}

.suggestion-count {
    color: var(--dir-text-muted);
    font-size: 0.8rem;
}

.popular-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feature-chip {
    display: inline-flex;
    align-items: center;
    background: var(--dir-bg-panel);
    color: var(--dir-text-main);
    border: 1px solid var(--dir-border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
}

.feature-chip:hover {
    border-color: var(--dir-accent);
    background: rgba(35, 134, 54, 0.15);
}

.feature-chip.selected {
    opacity: 0.4;
    pointer-events: none;
}

/* === Features on Listing Cards === */

.listing-card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.listing-feature-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(35, 134, 54, 0.15);
    color: var(--dir-accent);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* === Features on Single Listing Page === */

.listing-features-section {
    margin-top: 24px;
}

.listing-features-section h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.listing-features-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.listing-feature-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--dir-text-main);
}

.listing-feature-item svg {
    color: var(--dir-accent);
    flex-shrink: 0;
}

/* === Features Filter in Sidebar === */

.features-filter {
    margin-top: 20px;
}

.features-filter h4 {
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.features-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.feature-filter-chip {
    display: inline-flex;
    align-items: center;
    background: var(--dir-bg-panel);
    color: var(--dir-text-muted);
    border: 1px solid var(--dir-border);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.feature-filter-chip:hover {
    border-color: var(--dir-accent);
    color: var(--dir-text-main);
}

.feature-filter-chip.active {
    background: var(--dir-accent);
    border-color: var(--dir-accent);
    color: #fff;
}

/* === Share Buttons on Single Listing === */

.listing-share {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--dir-border);
}

.listing-share h3 {
    font-size: 0.95rem;
    color: var(--dir-text-muted);
    margin-bottom: 12px;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--dir-border);
    background: var(--dir-bg-panel);
    color: var(--dir-text-muted);
    font-family: inherit;
}

.share-btn:hover {
    border-color: var(--dir-text-muted);
    color: var(--dir-text-main);
}

.share-btn svg {
    flex-shrink: 0;
}

.share-copy:hover { border-color: var(--dir-accent); color: var(--dir-accent); }
.share-x:hover { border-color: #fff; color: #fff; }
.share-facebook:hover { border-color: #1877f2; color: #1877f2; }
.share-linkedin:hover { border-color: #0a66c2; color: #0a66c2; }
.share-whatsapp:hover { border-color: #25d366; color: #25d366; }

/* === Logo / Avatar Images === */

.listing-avatar.has-logo,
.listing-avatar-large.has-logo,
.preview-avatar.has-logo {
    background: none;
    padding: 0;
    overflow: hidden;
}

.listing-avatar.has-logo img,
.listing-avatar-large.has-logo img,
.preview-avatar.has-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* === Logo Upload (Manage Form) === */

.logo-upload-area {
    cursor: pointer;
    border: 2px dashed var(--dir-border);
    border-radius: 12px;
    transition: border-color 0.2s;
    overflow: hidden;
}

.logo-upload-area:hover,
.logo-upload-area.drag-over {
    border-color: var(--dir-accent);
}

.logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 30px;
    color: var(--dir-text-muted);
    text-align: center;
}

.logo-placeholder svg {
    opacity: 0.5;
}

.logo-hint {
    font-size: 0.75rem;
    opacity: 0.7;
}

.logo-preview {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: var(--dir-bg-card);
}

.logo-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 12px;
    object-fit: cover;
}

.logo-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--dir-border);
    background: var(--dir-bg-panel);
    color: var(--dir-text-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.logo-remove-btn:hover {
    background: #da3633;
    border-color: #da3633;
    color: #fff;
}

/* === Message Thread View === */

.message-item {
    cursor: pointer;
}

.message-arrow {
    display: flex;
    align-items: center;
    color: var(--dir-text-muted);
    flex-shrink: 0;
    margin-left: 8px;
}

.thread-view {
    max-width: 700px;
}

.thread-info {
    margin: 16px 0;
}

.thread-info h3 {
    margin: 0;
    font-size: 1.1rem;
}

.thread-listing-name {
    color: var(--dir-text-muted);
    font-size: 0.85rem;
    margin: 4px 0 0;
}

.thread-messages {
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
}

.thread-msg {
    display: flex;
}

.thread-msg-mine {
    justify-content: flex-end;
}

.thread-msg-theirs {
    justify-content: flex-start;
}

.thread-msg-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.thread-msg-mine .thread-msg-bubble {
    background: var(--dir-accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.thread-msg-theirs .thread-msg-bubble {
    background: var(--dir-bg-card);
    border: 1px solid var(--dir-border);
    color: var(--dir-text-main);
    border-bottom-left-radius: 4px;
}

.thread-msg-subject {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.85rem;
    opacity: 0.85;
}

.thread-msg-time {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 6px;
    text-align: right;
}

.thread-reply {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--dir-border);
}

.thread-reply form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.thread-reply textarea {
    flex: 1;
    background: var(--dir-bg-card);
    border: 1px solid var(--dir-border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--dir-text-main);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.thread-reply textarea:focus {
    outline: none;
    border-color: var(--dir-accent);
}

@media (max-width: 600px) {
    .thread-msg-bubble {
        max-width: 90%;
    }
    .thread-reply form {
        flex-direction: column;
    }
    .thread-reply .btn {
        width: 100%;
    }
}

/* === Location Map (Single Listing) === */

.listing-map-section {
    margin-top: 24px;
}

.listing-map-section h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.listing-map {
    width: 100%;
    height: 300px;
    border-radius: var(--dir-radius);
    border: 1px solid var(--dir-border);
    overflow: hidden;
    z-index: 1;
}

.listing-map .leaflet-popup-content-wrapper {
    background: var(--dir-bg-panel);
    color: var(--dir-text-main);
    border-radius: 8px;
    box-shadow: var(--dir-shadow);
}

.listing-map .leaflet-popup-tip {
    background: var(--dir-bg-panel);
}

.listing-map .leaflet-popup-content {
    margin: 10px 14px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.listing-map .leaflet-popup-content strong {
    display: block;
    margin-bottom: 2px;
}

/* === Listing Analytics (Manage Sidebar) === */

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 12px 0;
}

.analytics-stat {
    text-align: center;
    padding: 12px 4px;
    background: var(--dir-bg-app);
    border-radius: 8px;
}

.analytics-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dir-accent);
}

.analytics-label {
    display: block;
    font-size: 0.7rem;
    color: var(--dir-text-muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-hint {
    text-align: center;
    font-size: 0.8rem;
    color: var(--dir-text-muted);
    margin: 8px 0 0;
}

/* === Reviews Section (Single Listing) === */

.listing-reviews-section {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--dir-border);
}

.listing-reviews-section h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.reviews-count {
    color: var(--dir-text-muted);
    font-weight: 400;
    font-size: 0.9rem;
}

.reviews-summary {
    margin-bottom: 20px;
}

.reviews-avg {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reviews-avg-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dir-text-main);
}

.reviews-avg-stars {
    display: flex;
    gap: 2px;
}

.reviews-avg-label {
    color: var(--dir-text-muted);
    font-size: 0.85rem;
}

.star-filled {
    color: #f59e0b;
}

.star-empty {
    color: var(--dir-border);
}

/* Star Picker */
.star-picker {
    display: flex;
    gap: 4px;
    margin: 6px 0;
}

.star-pick {
    font-size: 1.8rem;
    color: var(--dir-border);
    cursor: pointer;
    transition: color 0.15s;
    line-height: 1;
}

.star-pick.star-active {
    color: #f59e0b;
}

.star-pick.star-hover {
    color: #fbbf24;
}

/* Review Form */
.review-form-wrap {
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.review-form-wrap h3 {
    font-size: 1rem;
    margin-bottom: 14px;
}

.review-form-wrap .form-group {
    margin-bottom: 14px;
}

.review-form-wrap label {
    display: block;
    font-size: 0.85rem;
    color: var(--dir-text-muted);
    margin-bottom: 4px;
}

.review-form-wrap input,
.review-form-wrap textarea {
    width: 100%;
    background: var(--dir-bg-card);
    border: 1px solid var(--dir-border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--dir-text-main);
    font-family: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.review-form-wrap input:focus,
.review-form-wrap textarea:focus {
    outline: none;
    border-color: var(--dir-accent);
}

.reviews-login-hint {
    color: var(--dir-text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.reviews-login-hint a {
    color: var(--dir-accent);
    text-decoration: none;
}

.reviews-empty {
    color: var(--dir-text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* Review Cards */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.review-card {
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius-sm);
    padding: 16px;
}

.review-card.review-hidden {
    display: none;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.review-author {
    font-weight: 600;
    font-size: 0.9rem;
}

.review-stars {
    display: flex;
    gap: 1px;
    font-size: 0.9rem;
}

.review-date {
    color: var(--dir-text-muted);
    font-size: 0.8rem;
    margin-left: auto;
}

.review-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.review-body {
    color: var(--dir-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.review-delete-btn {
    background: none;
    border: none;
    color: #da3633;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    margin-top: 8px;
}

.review-delete-btn:hover {
    text-decoration: underline;
}

/* Owner Reply to Review */
.review-owner-reply {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--dir-bg);
    border-left: 3px solid var(--dir-primary);
    border-radius: 0 8px 8px 0;
}

.review-owner-reply-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.review-owner-reply-header strong {
    color: var(--dir-text);
}

.review-owner-reply-body {
    color: var(--dir-text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.review-reply-btn {
    margin-top: 8px;
    font-size: 0.82rem;
}

.review-reply-form {
    margin-top: 10px;
}

.review-reply-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--dir-border);
    border-radius: 6px;
    background: var(--dir-card-bg);
    color: var(--dir-text);
    font-size: 0.88rem;
    resize: vertical;
    font-family: inherit;
}

.review-reply-textarea:focus {
    outline: none;
    border-color: var(--dir-primary);
}

/* Rating Stars on Listing Cards */
.listing-card-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 0.8rem;
}

.listing-card-rating .stars {
    display: flex;
    gap: 1px;
    color: #f59e0b;
    font-size: 0.85rem;
}

.listing-card-rating .rating-text {
    color: var(--dir-text-muted);
}

/* === Related Listings === */

.related-listings-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--dir-border);
}

.related-listings-section h2 {
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.related-listings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.related-listing-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--dir-card-bg);
    border: 1px solid var(--dir-border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--dir-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
}

.related-listing-card:hover {
    border-color: var(--dir-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.related-listing-logo {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.related-listing-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dir-bg);
    color: var(--dir-text-muted);
    font-weight: 700;
    font-size: 1.1rem;
}

.related-listing-info {
    flex: 1;
    min-width: 0;
}

.related-listing-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-listing-category {
    color: var(--dir-text-muted);
    font-size: 0.78rem;
    margin-top: 2px;
}

.related-listing-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    margin-top: 3px;
    color: var(--dir-text);
}

.related-listing-rating .star-filled {
    color: #f59e0b;
}

.related-listing-reviews {
    color: var(--dir-text-muted);
    font-size: 0.75rem;
}

.related-listing-card .verified-badge-sm {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    background: var(--dir-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

@media (max-width: 600px) {
    .related-listings-grid {
        grid-template-columns: 1fr;
    }
}

/* === Support / Tickets === */

.support-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.support-header h1 {
    margin: 0;
}

.support-subtitle {
    color: var(--dir-text-muted);
    font-size: 0.9rem;
    margin: 4px 0 0;
}

/* Ticket Form */
.ticket-form-wrap {
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius);
    padding: 24px;
    margin-bottom: 24px;
}

.ticket-form-wrap h3 {
    margin: 0 0 16px;
    font-size: 1.05rem;
}

.ticket-form-wrap .form-group {
    margin-bottom: 14px;
}

.ticket-form-wrap label {
    display: block;
    font-size: 0.85rem;
    color: var(--dir-text-muted);
    margin-bottom: 4px;
}

.ticket-form-wrap input,
.ticket-form-wrap textarea,
.ticket-form-wrap select {
    width: 100%;
    background: var(--dir-bg-card);
    border: 1px solid var(--dir-border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--dir-text-main);
    font-family: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.ticket-form-wrap input:focus,
.ticket-form-wrap textarea:focus,
.ticket-form-wrap select:focus {
    outline: none;
    border-color: var(--dir-accent);
}

.ticket-form-wrap select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.ticket-form-wrap select option {
    background: var(--dir-bg-card);
    color: var(--dir-text-main);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Ticket List */
.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticket-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--dir-bg-panel);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius-sm);
    padding: 16px 20px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.ticket-item:hover {
    border-color: var(--dir-accent);
}

.ticket-item-main {
    flex: 1;
    min-width: 0;
}

.ticket-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.ticket-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    text-transform: capitalize;
}

.ticket-category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    background: var(--dir-bg-card);
    border: 1px solid var(--dir-border);
    color: var(--dir-text-muted);
}

.ticket-date {
    font-size: 0.8rem;
    color: var(--dir-text-muted);
    margin-left: auto;
}

.ticket-item-subject {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-item-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--dir-text-muted);
    margin-top: 4px;
}

/* Ticket Detail */
.ticket-detail-header {
    margin: 16px 0;
}

.ticket-detail-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ticket-detail-subject {
    margin: 0;
    font-size: 1.2rem;
}

.thread-msg-admin-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    opacity: 0.7;
}

@media (max-width: 600px) {
    .support-header {
        flex-direction: column;
    }

    .ticket-item {
        padding: 12px 14px;
    }

    .ticket-date {
        margin-left: 0;
    }

    .ticket-item-subject {
        white-space: normal;
    }
}

/* ========================================
   AUTH MODAL
   ======================================== */

.auth-modal-content {
    max-width: 440px;
}

.auth-modal-body {
    padding: 24px;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--dir-border);
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    color: var(--dir-text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.auth-tab:hover {
    color: var(--dir-text-main);
}

.auth-tab.active {
    color: var(--dir-text-main);
    border-bottom-color: var(--dir-accent);
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--dir-text-muted);
}

.auth-form .form-group input {
    width: 100%;
    padding: 12px;
    background: var(--dir-bg-app);
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius-sm);
    color: var(--dir-text-main);
    font-size: 0.95rem;
    box-sizing: border-box;
}

.auth-form .form-group input:focus {
    outline: none;
    border-color: var(--dir-accent);
}

.auth-form .form-hint {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--dir-text-muted);
    text-decoration: none;
}

.auth-form .form-hint:hover {
    color: var(--dir-accent);
}

.auth-msg {
    margin-top: 14px;
    text-align: center;
    font-size: 0.9rem;
    min-height: 20px;
    line-height: 1.5;
}

.auth-msg.success { color: var(--dir-accent); }
.auth-msg.error { color: #ff6b6b; }
.auth-msg.info { color: var(--dir-text-muted); }

/* Account Type Selector */
.account-type-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.account-type-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--dir-border);
    border-radius: var(--dir-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.account-type-option:hover {
    border-color: var(--dir-text-muted);
}

.account-type-option.selected {
    border-color: var(--dir-accent);
    background: rgba(35, 134, 54, 0.08);
}

.account-type-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dir-bg-app);
    border-radius: 8px;
    flex-shrink: 0;
    color: var(--dir-text-muted);
}

.account-type-option.selected .account-type-icon {
    color: var(--dir-accent);
}

.account-type-info strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.account-type-info span {
    display: block;
    font-size: 0.78rem;
    color: var(--dir-text-muted);
}

/* Post-login actions */
.post-login-actions {
    text-align: center;
    padding: 20px 0;
}

.post-login-actions p {
    color: var(--dir-text-muted);
    margin-bottom: 16px;
}

.post-login-actions .btn {
    margin-bottom: 8px;
}

/* Upsell Banner */
.directory-upsell-banner {
    background: linear-gradient(135deg, rgba(35, 134, 54, 0.15) 0%, rgba(35, 134, 54, 0.05) 100%);
    border: 1px solid rgba(35, 134, 54, 0.3);
    border-radius: var(--dir-radius);
    padding: 20px 24px;
    margin: 0 auto 30px;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.directory-upsell-banner p {
    color: var(--dir-text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.directory-upsell-banner p strong {
    color: var(--dir-text-main);
}

.upsell-dismiss {
    background: none;
    border: none;
    color: var(--dir-text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
}

.upsell-dismiss:hover {
    color: var(--dir-text-main);
}

/* Auth modal mobile adjustments */
@media screen and (max-width: 600px) {
    .auth-modal-content {
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .account-type-selector {
        gap: 8px;
    }

    .account-type-option {
        padding: 10px;
    }

    .directory-upsell-banner {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }
}

/* ========================================
   REPORT LISTING
   ======================================== */

.report-listing-btn {
    font-size: 0.8rem;
    color: var(--dir-text-muted);
    gap: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.report-listing-btn:hover {
    color: #ff6b6b;
}

.claim-listing-btn {
    font-size: 0.85rem;
    gap: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-color: rgba(240, 194, 127, 0.4);
    color: #f0c27f;
}

.claim-listing-btn:hover {
    border-color: #f0c27f;
    background: rgba(240, 194, 127, 0.1);
}

/* ========================================
   PORTFOLIO GALLERY
   ======================================== */

/* --- Manage page gallery --- */
.gallery-upload-area {
    margin-top: 8px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--dir-border);
    cursor: grab;
}

.gallery-item.dragging {
    opacity: 0.4;
}

.gallery-item.drag-over {
    border-color: var(--dir-accent);
    box-shadow: 0 0 0 2px var(--dir-accent);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.gallery-item:hover .gallery-item-remove {
    opacity: 1;
}

.gallery-caption-input {
    width: 100%;
    font-size: 0.75rem;
    padding: 4px 6px;
    background: var(--dir-bg-card);
    border: 1px solid var(--dir-border);
    color: var(--dir-text);
    border-radius: 4px;
    margin-top: 4px;
    box-sizing: border-box;
}

.gallery-caption-input:focus {
    border-color: var(--dir-accent);
    outline: none;
}

.gallery-add-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    border: 2px dashed var(--dir-border);
    border-radius: 8px;
    color: var(--dir-text-muted);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    font-size: 0.85rem;
}

.gallery-add-btn:hover {
    border-color: var(--dir-accent);
    color: var(--dir-accent);
}

.gallery-count {
    font-size: 0.75rem;
    opacity: 0.6;
}

.pro-badge-inline {
    font-size: 0.65rem;
    font-weight: 600;
    background: linear-gradient(135deg, #f0c27f, #fc5c7d);
    color: #000;
    padding: 2px 8px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Single listing gallery --- */
.listing-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.listing-gallery-item {
    aspect-ratio: 4/3;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--dir-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.listing-gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.listing-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Gallery lightbox --- */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.gallery-lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.gallery-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.gallery-lightbox-close:hover {
    opacity: 1;
}

.gallery-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.gallery-lightbox-nav:hover {
    background: rgba(255,255,255,0.3);
}

.gallery-lightbox-prev { left: 16px; }
.gallery-lightbox-next { right: 16px; }

.gallery-lightbox-caption {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    max-width: 80%;
    text-align: center;
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .listing-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-lightbox {
        padding: 16px;
    }

    .gallery-lightbox-nav {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
}

/* ========================================
   SETTINGS PAGE
   ======================================== */

.settings-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 0;
}

.settings-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dir-text-main);
    margin-bottom: 32px;
}

.settings-section {
    background: var(--dir-bg-card);
    border: 1px solid var(--dir-border);
    border-radius: 12px;
    padding: 24px;
}

.settings-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dir-text-main);
    margin-bottom: 4px;
}

.settings-section-desc {
    font-size: 0.85rem;
    color: var(--dir-text-muted);
    margin-bottom: 20px;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--dir-border);
}

.settings-toggle-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-toggle-row:first-child {
    padding-top: 0;
}

.settings-toggle-info {
    flex: 1;
}

.settings-toggle-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--dir-text-main);
    margin-bottom: 2px;
}

.settings-toggle-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--dir-text-muted);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--dir-border);
    border-radius: 24px;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--dir-accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* Status message */
.settings-status {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--dir-text-muted);
}

.settings-status-success {
    color: #3fb950;
}

.settings-status-error {
    color: #ff6b6b;
}

@media (max-width: 600px) {
    .settings-page {
        padding: 20px 0;
    }

    .settings-section {
        padding: 16px;
    }
}

/* === PRO: Gold verified badge === */

.verified-gold {
    color: #f0c27f !important;
    text-shadow: 0 0 6px rgba(240, 194, 127, 0.4);
}

/* === PRO: Accent colour picker === */

.accent-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.accent-color-picker {
    width: 44px;
    height: 38px;
    border: 1px solid #30363d;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    padding: 2px;
}

.accent-color-hex {
    width: 100px;
    font-family: monospace;
}

/* ===== Availability ===== */

/* Badge on listing-single header */
.availability-badge {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 8px;
}
.availability-badge.available {
    color: #3fb950;
    background: rgba(63,185,80,0.1);
    border: 1px solid rgba(63,185,80,0.3);
}
.availability-badge.unavailable {
    color: #8b949e;
    background: rgba(139,148,158,0.1);
    border: 1px solid rgba(139,148,158,0.2);
}

/* Green dot on browse cards */
.availability-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: auto;
}
.availability-dot.available {
    background: #3fb950;
    box-shadow: 0 0 6px rgba(63,185,80,0.4);
}

/* Toggle switch on manage page */
.availability-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.availability-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #30363d;
    border-radius: 24px;
    transition: 0.2s;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}
.availability-toggle input:checked + .toggle-slider {
    background: #3fb950;
}
.availability-toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ===== Pricing ===== */

/* Listing single page */
.listing-pricing {
    margin-top: 12px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.pricing-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: #3fb950;
}
.pricing-label {
    font-size: 0.85rem;
    color: #8b949e;
}

/* Browse card tag */
.pricing-card-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: #3fb950;
    white-space: nowrap;
}
.pricing-card-label {
    font-weight: 400;
    color: #8b949e;
}

/* ===== Service Areas ===== */
.service-areas-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.service-area-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid #30363d;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #c9d1d9;
}

/* ===== Active Badge ===== */
.active-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
    color: #3fb950;
    background: rgba(63,185,80,0.1);
    border: 1px solid rgba(63,185,80,0.25);
    vertical-align: middle;
    margin-left: 4px;
}

/* ===== Trust Signals ===== */
.listing-trust-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.listing-trust-card h3 {
    font-size: 0.95rem;
    margin-bottom: 14px;
    color: #c9d1d9;
}
.trust-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #c9d1d9;
}
.trust-item strong {
    color: #3fb950;
}
