/* Listings Page Styles */

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-main {
    color: #dc2626;
    text-decoration: none;
    font-weight: 700;
}

.logo-main:hover {
    color: #003d6e;
}

.logo-divider {
    color: #cbd5e1;
    font-weight: 300;
}

.logo-sub {
    color: #000000;
    text-decoration: none;
    font-weight: 700;
    font-style: italic;
}

.logo-sub:hover {
    color: #e55a2b;
}

/* Page Layout */
.listings-page {
    overflow: hidden;
}

.listings-main {
    display: flex;
    height: calc(100vh - 70px);
    margin-top: 70px;
}

/* Filter Sidebar */
.filter-sidebar {
    position: fixed;
    left: -400px;
    top: 0;
    width: 380px;
    height: 100vh;
    background: #fff;
    z-index: 1000;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 20px rgba(0,0,0,0.1);
}

.filter-sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-logo .logo-main {
    color: #dc2626;
    text-decoration: none;
    font-weight: 700;
}

.sidebar-logo .logo-divider {
    color: #cbd5e1;
    font-weight: 300;
}

.sidebar-logo .logo-sub {
    color: #000000;
    text-decoration: none;
    font-weight: 700;
    font-style: italic;
}

@media (max-width: 1024px) {
    .sidebar-logo {
        flex-wrap: wrap;
        align-content: flex-start;
        align-items: flex-start;
        column-gap: 0.4rem;
        row-gap: 0;
        max-width: 11.35rem;
        font-size: 1rem;
    }

    .sidebar-logo .logo-main {
        flex: 1 1 100%;
        font-size: 1.06rem !important;
        line-height: 1.1;
        letter-spacing: -0.025em;
        width: 100%;
        box-sizing: border-box;
        border-bottom: 1px solid #cbd5e1;
        padding-bottom: 0.12rem;
        margin-bottom: 0.1rem;
    }

    .sidebar-logo .logo-divider {
        display: none;
    }

    .sidebar-logo .logo-sub {
        font-size: 1rem !important;
        line-height: 1;
        margin: 0;
        padding: 0;
    }
}

.close-sidebar {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #6b7280;
    border-radius: 6px;
}

.close-sidebar:hover {
    background: #f3f4f6;
}

.sidebar-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-search svg {
    color: #9ca3af;
}

.sidebar-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    color: #374151;
}

.sidebar-search input::placeholder {
    color: #9ca3af;
}

.sidebar-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-tab {
    width: 40px;
    height: 40px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
}

.sidebar-tab:hover {
    border-color: #1f2937;
    color: #1f2937;
}

.sidebar-tab.active {
    background: #1f2937;
    border-color: #1f2937;
    color: #fff;
}

.sidebar-panel {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.sidebar-panel.active {
    display: flex;
    flex-direction: column;
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

/* Filter Groups */
.filter-group {
    margin-bottom: 0.5rem;
}

.filter-accordion {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: #374151;
    border-radius: 8px;
    transition: all 0.2s;
}

.filter-accordion:hover {
    background: #f3f4f6;
}

.filter-accordion span {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.accordion-arrow {
    transition: transform 0.2s;
}

.filter-accordion.active .accordion-arrow {
    transform: rotate(180deg);
}

.filter-content {
    display: none;
    padding: 0.75rem 1rem 1rem;
}

.filter-content.active {
    display: block;
}

.filter-content select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    background: #fff;
}

.filter-content select:focus {
    outline: none;
    border-color: #1f2937;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.price-inputs input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
}

.price-inputs input:focus {
    outline: none;
    border-color: #1f2937;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.btn-apply {
    margin-top: auto;
    background: #1f2937;
    color: #fff;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-apply:hover {
    background: #111827;
}

.btn-close-panel {
    margin-top: auto;
    background: #1f2937;
    color: #fff;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-close-panel:hover {
    background: #111827;
}

/* Sort Options */
.sort-options {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sort-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: #374151;
    border-radius: 8px;
    transition: all 0.2s;
}

.sort-option:hover {
    background: #f3f4f6;
}

.sort-option.active {
    background: #f3f4f6;
    color: #1f2937;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    flex: 1;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.empty-state p,
.empty-hint {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Listings Section */
.listings-section {
    flex: 1;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.listings-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.listings-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.listings-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.listings-count {
    font-size: 0.9rem;
    color: #6b7280;
}

.listings-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f3f4f6;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.search-box svg {
    color: #9ca3af;
}

.search-box input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 0.9rem;
}

.btn-search-small {
    background: #1f2937;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-search-small:hover {
    background: #111827;
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
}

.view-btn:hover {
    border-color: #1f2937;
    color: #1f2937;
}

.view-btn.active {
    background: #1f2937;
    border-color: #1f2937;
    color: #fff;
}

.view-divider {
    width: 1px;
    height: 24px;
    background: #e5e7eb;
    margin: 0 0.25rem;
}

/* Listings Container */
.listings-container {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #6b7280;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #1f2937;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

/* Listing Item */
.listing-item {
    display: flex;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.listing-item:hover {
    background: #f9fafb;
}

.listing-item-image {
    width: 150px;
    height: 110px;
    background: #f3f4f6;
    border-radius: 8px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.listing-item-image .no-img {
    font-size: 2.5rem;
    color: #9ca3af;
}

.favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

.listing-item:hover .favorite-btn {
    opacity: 1;
}

.favorite-btn:hover {
    color: #ef4444;
}

.listing-item-content {
    flex: 1;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.listing-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-item-location {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.listing-item-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.listing-item-category {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1f2937;
}

.listing-item-sector {
    font-size: 0.8rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.listing-item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 120px;
}

.listing-item-price .rent {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.listing-item-price .price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

/* Grid View */
.listings-container.grid-view {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem;
}

.listings-container.grid-view .listing-item {
    flex-direction: column;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.listings-container.grid-view .listing-item-image {
    width: 100%;
    height: 140px;
    border-radius: 0;
}

.listings-container.grid-view .listing-item-content {
    padding: 1rem;
}

.listings-container.grid-view .listing-item-price {
    padding: 0 1rem 1rem;
    align-items: flex-start;
}

/* Map Section */
.map-section {
    flex: 1;
    min-width: 400px;
    background: #e5e7eb;
}

#map {
    width: 100%;
    height: 100%;
}

/* Custom Map Markers */
.price-marker {
    position: absolute;
    transform: translate(-50%, -100%);
    background: #dc2626;
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    transition: all 0.2s ease;
    z-index: 100;
}

.price-marker::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #dc2626;
}

.price-marker:hover,
.price-marker.hover {
    background: #b91c1c;
    transform: translate(-50%, -100%) scale(1.1);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
    z-index: 200;
}

.price-marker:hover::after,
.price-marker.hover::after {
    border-top-color: #b91c1c;
}

.price-marker span {
    display: block;
}

.custom-marker {
    background: white;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-weight: 600;
    font-size: 14px;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.marker-price {
    white-space: nowrap;
}

/* Map Info Window */
.map-info-window {
    padding: 12px;
    min-width: 200px;
}

.info-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.info-location {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.info-price {
    font-size: 18px;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 12px;
}

.info-link {
    display: inline-block;
    padding: 8px 16px;
    background: #dc2626;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.info-link:hover {
    background: #003d6e;
}

/* Sidebar overlay */
.filter-sidebar.active::before {
    content: '';
    position: fixed;
    left: 380px;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: -1;
}

/* Responsive */
@media (max-width: 1200px) {
    .map-section {
        display: none;
    }
    
    .listings-section {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .listings-main {
        height: calc(100vh - 60px);
        margin-top: 60px;
    }
    
    .filter-sidebar {
        width: 100%;
        left: -100%;
    }
    
    .filter-sidebar.active::before {
        display: none;
    }
    
    .listings-header {
        padding: 1rem;
    }
    
    .listings-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .listings-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .view-controls {
        justify-content: flex-end;
    }
    
    .listing-item {
        flex-direction: column;
        padding: 1rem;
    }
    
    .listing-item-image {
        width: 100%;
        height: 180px;
        margin-bottom: 1rem;
    }
    
    .listing-item-content {
        padding: 0;
        margin-bottom: 1rem;
    }
    
    .listing-item-price {
        align-items: flex-start;
    }
    
    .listings-container.grid-view {
        grid-template-columns: 1fr;
    }
}

/* Auth Menu */
.auth-menu {
    position: relative;
}

.auth-icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
}

.auth-icon-btn:hover {
    background: #f1f5f9;
    color: #dc2626;
}

.user-initials {
    width: 40px;
    height: 40px;
    background: #dc2626;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.auth-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    min-width: 220px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
}

.auth-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 8px;
}

.dropdown-avatar {
    width: 36px;
    height: 36px;
    background: #dc2626;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
}

.dropdown-name {
    font-weight: 500;
    color: #1e293b;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.95rem;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.dropdown-item.logout {
    color: #ef4444;
}

.dropdown-item.logout:hover {
    background: #fef2f2;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 8px 0;
}
