@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');


:root[data-theme="dark"] {
    --filter-bg: rgba(37, 37, 38, 0.8);
    --filter-border: rgba(60, 60, 60, 0.8);
    --header-bg: rgba(30, 30, 30, 0.8);
    --input-bg: rgba(45, 45, 45, 0.9);
    --hover-bg: #3c3c3c;
    --primary: #3794ff;
    --primary-hover: #1f82eb;
    --bg-color: #1e1e1e;
    --text-main: #d4d4d4;
    --text-muted: #858585;
    --card-bg: #252526;
    --border-color: #3c3c3c;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.6);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -2px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.6);
}

:root {
    --filter-bg: rgba(255, 255, 255, 0.7);
    --filter-border: rgba(255, 255, 255, 0.5);
    --header-bg: rgba(255, 255, 255, 0.8);
    --input-bg: rgba(255, 255, 255, 0.9);
    --hover-bg: #f1f5f9;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --bg-color: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header & Nav */
header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img,
.logo svg,
.auth-logo img,
.auth-logo svg {
    height: 44px !important;
    width: auto !important;
}

.logo>div {
    font-size: 1.2rem !important;
    line-height: 1.05 !important;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

@media (max-width: 768px) {
    .navbar {
        height: auto;
        padding: 12px 0;
        flex-direction: column;
        gap: 12px;
    }

    .nav-links {
        gap: 16px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-item {
        font-size: 0.85rem;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--text-main);
}

/* Hero Section */
.hero {
    padding: 60px 0 40px;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

@media (max-width: 768px) {
    .hero {
        padding: 40px 0 20px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: 24px;
    }
}

/* Filter Panel (Glassmorphism) */
.filter-panel {
    background: var(--filter-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--filter-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 0;
    width: 100%;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.form-group {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: var(--input-bg);
    transition: var(--transition);
    outline: none;
    color: var(--text-main);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Property Grid */
.properties-section {
    padding-bottom: 80px;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 32px;
}

.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}

@media (max-width: 480px) {
    .property-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .property-card {
        border-radius: 12px;
    }

    .property-image-wrapper {
        height: 200px;
    }

    .property-content {
        padding: 16px;
    }

    .property-price {
        font-size: 1.4rem;
        margin-bottom: 6px;
    }

    .property-title {
        font-size: 1.1rem;
        margin-bottom: 6px;
    }

    .property-address {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }

    .property-meta {
        padding: 12px 0;
        flex-direction: row;
        justify-content: space-between;
        gap: 8px;
    }

    .meta-item {
        font-size: 0.85rem;
        gap: 6px;
    }

    .property-footer {
        padding-top: 12px;
        font-size: 0.95rem;
    }

    .property-footer svg {
        width: 18px;
        height: 18px;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 24px;
    }

    .container {
        padding: 0 16px;
    }
}

/* Property Card */
.property-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.property-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.property-image-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.property-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.property-card:hover .property-image-wrapper img {
    transform: scale(1.05);
}

.property-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.status-indicator {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 5;
}

.status-tersedia { background: #10b981; color: white; }
.status-tersewa { background: #f59e0b; color: white; }
.status-terjual { background: #ef4444; color: white; }

.property-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.property-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.property-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.property-address {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.property-address svg {
    width: 16px;
    height: 16px;
}

.property-meta {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.property-footer {
    padding-top: 12px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.meta-item svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

/* Admin Styles */
.admin-container {
    max-width: 800px;
    margin: 40px auto;
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.admin-form .form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.admin-form .form-group {
    margin-bottom: 16px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
}

@media (max-width: 768px) {
    .filter-form {
        flex-direction: column;
    }

    .form-group {
        width: 100%;
    }

    .admin-form .form-row {
        flex-direction: column;
        gap: 0;
    }

    .admin-container {
        padding: 20px 16px;
        margin: 20px auto;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* Horizontal scroll for all tables on mobile */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    list-style: none;
    margin-top: 40px;
    margin-bottom: 60px;
}

.page-item {
    display: flex;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    color: var(--text-main);
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px !important;
    font-weight: 500;
    transition: var(--transition);
}

.page-item:first-child .page-link {
    margin-left: 0;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.page-item:last-child .page-link {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.page-link:hover {
    z-index: 2;
    color: var(--primary-hover);
    text-decoration: none;
    background-color: var(--hover-bg);
    border-color: var(--border-color);
}

.page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
}

.page-item.disabled .page-link {
    color: var(--text-muted);
    pointer-events: none;
    cursor: auto;
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

/* Image Slider */
.slider-wrapper {
    position: relative;
}

.slide-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    object-fit: cover;
}

.slide-img.active {
    opacity: 1;
}

/* Slider Controls */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.3s;
}

.slider-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

.slider-btn.prev {
    left: 10px;
}

.slider-btn.next {
    right: 10px;
}

/* Slider Indicators */
.slider-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.dot.active {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* Elegant Nav Items */
.nav-item {
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 4px 0;
    text-decoration: none;
    background: transparent !important;
    border: none !important;
}

.nav-item:hover {
    color: var(--primary);
    background: transparent !important;
}

.nav-item::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.nav-item:hover::after {
    width: 100%;
}

.theme-btn:hover {
    color: var(--primary) !important;
}

/* WhatsApp Widget */
@keyframes pulse-wa {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.whatsapp-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    animation: pulse-wa 2s infinite;
}

.whatsapp-widget:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.6);
    color: white;
    animation: none;
}

/* WhatsApp Popup */
.whatsapp-popup {
    position: fixed;
    bottom: 95px;
    right: 24px;
    background: var(--card-bg);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border-color);
    pointer-events: none;
    max-width: 200px;
    line-height: 1.4;
}

.whatsapp-popup.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.wa-popup-close {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background 0.2s;
}

.wa-popup-close:hover {
    background: #dc2626;
}

.wa-popup-tail {
    position: absolute;
    bottom: -6px;
    right: 24px;
    width: 12px;
    height: 12px;
    background: inherit;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    transform: rotate(45deg);
}

.main-footer {
    padding: 32px 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    margin-top: auto;
    background: var(--card-bg);
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column-reverse;
        text-align: center;
        gap: 24px;
    }

    @keyframes skeleton-loading {
        0% {
            background-position: 100% 50%;
        }

        100% {
            background-position: 0% 50%;
        }
    }

    .skeleton {
        background: linear-gradient(90deg, var(--hover-bg) 25%, var(--border-color) 50%, var(--hover-bg) 75%) !important;
        background-size: 200% 100% !important;
        animation: skeleton-loading 1.5s infinite !important;
    }

    /* Image Fade-in Effect */
    .lazy-img {
        opacity: 0;
        transition: opacity 0.5s ease-in-out;
    }

    .lazy-img.loaded {
        opacity: 1;
    }

    /* Leaflet Geocoder Custom Style */
    .leaflet-control-geocoder {
        border: none !important;
        box-shadow: var(--shadow-md) !important;
        border-radius: 8px !important;
        overflow: hidden;
        width: 320px !important;
        background: var(--card-bg) !important;
    }

    .leaflet-control-geocoder-form {
        display: flex;
        align-items: center;
    }

    .leaflet-control-geocoder-form input {
        width: 100% !important;
        padding: 10px 14px !important;
        font-size: 0.85rem !important;
        border: none !important;
        background: var(--card-bg) !important;
        color: var(--text-main) !important;
        outline: none !important;
    }

    .leaflet-control-geocoder-icon {
        display: none !important;
    }

    .leaflet-control-geocoder-alternatives {
        background: var(--card-bg) !important;
        border-top: 1px solid var(--border-color) !important;
        color: var(--text-main) !important;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .leaflet-control-geocoder-alternatives li {
        padding: 8px 12px;
        cursor: pointer;
        font-size: 0.85rem;
    }

    .leaflet-control-geocoder-alternatives li:hover {
        background: var(--hover-bg) !important;
    }
}