:root {
    --primary: #4c51bf; /* Indigo */
    --secondary: #6b46c1; /* Ungu */
    --accent: #ed64a6; /* Pinkish accent */
    --dark: #1a202c;
    --light: #f7fafc;
    --glass: rgba(255, 255, 255, 0.85);
    --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }

body { background-color: #f3f4f6; color: var(--dark); }

/* --- HEADER BLUR ROUNDED --- */
header {
    position: fixed;
    top: 20px; left: 20px; right: 20px;
    height: 70px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    z-index: 1000;
    transition: all 0.3s ease;
}

header.transparent {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}

.logo { font-weight: 800; font-size: 1.5rem; color: var(--primary); text-decoration: none; }
.logo span { color: var(--secondary); }

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #ddd; }

/* --- SEARCH SECTION --- */
.search-section { margin-top: 120px; text-align: center; padding: 20px; }
.search-box {
    background: white; display: inline-flex; padding: 10px; border-radius: 50px;
    box-shadow: 0 10px 25px rgba(76, 81, 191, 0.15); width: 100%; max-width: 600px;
}
.search-box input { border: none; outline: none; padding: 10px 20px; width: 100%; font-size: 1rem; }
.search-box button {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white; border: none; padding: 10px 30px; border-radius: 40px; cursor: pointer; font-weight: 600;
    transition: transform 0.2s;
}
.search-box button:hover { transform: scale(1.05); }

/* --- BANNER SLIDER --- */
.hero-banner {
    margin: 40px auto; width: 90%; height: 350px; border-radius: var(--radius);
    overflow: hidden; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.slide {
    width: 100%; height: 100%; position: absolute; top: 0; left: 0; opacity: 0;
    transition: opacity 1s ease-in-out; background-size: cover; background-position: center;
    display: flex; align-items: flex-end;
}
.slide.active { opacity: 1; }
.slide-content {
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    width: 100%; padding: 40px; color: white;
}
.slide-content h2 { font-size: 2rem; margin-bottom: 10px; animation: slideUp 0.8s ease; }

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --- GRID CARDS & SECTIONS --- */
.section-container { max-width: 1200px; margin: 60px auto; padding: 0 20px; }
.section-title { font-size: 1.5rem; color: var(--primary); margin-bottom: 20px; font-weight: 700; border-left: 5px solid var(--secondary); padding-left: 15px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }

.property-card {
    background: white; border-radius: var(--radius); overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer; position: relative;
}
.property-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(107, 70, 193, 0.2); }
.card-img { width: 100%; height: 180px; object-fit: cover; }
.card-info { padding: 20px; }
.card-price { color: var(--secondary); font-weight: 700; font-size: 1.1rem; }
.card-title { font-weight: 600; margin: 5px 0; color: var(--dark); }
.card-location { font-size: 0.85rem; color: #718096; display: flex; align-items: center; gap: 5px; }
.card-badge {
    position: absolute; top: 15px; left: 15px; background: var(--accent); color: white;
    padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
}

/* --- CTA JOIN --- */
.cta-section {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; text-align: center; padding: 60px 20px; margin: 60px 20px; border-radius: var(--radius);
}
.btn-white {
    background: white; color: var(--primary); padding: 12px 30px; border-radius: 30px;
    text-decoration: none; font-weight: 700; display: inline-block; margin-top: 20px;
}

/* --- FOOTER --- */
footer { 
    background: var(--dark); 
    color: white; 
    padding: 70px 20px 30px; 
    margin-top: 80px; 
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: white;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background: var(--accent);
}

.footer-links { list-style: none; }
.footer-links li {
    margin-bottom: 12px;
    color: #cbd5e0;
    display: flex; align-items: center; gap: 10px;
}
.footer-links a { color: #cbd5e0; text-decoration: none; transition: 0.3s; }
.footer-links a:hover { color: var(--accent); padding-left: 5px; }

.footer-bottom {
    text-align: center;
    margin-top: 50px;
    padding-top: 25px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #718096;
    font-size: 0.9rem;
}

/* --- HALAMAN LOGIN/AUTH --- */
.auth-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f3f4f6 0%, #e0e7ff 100%);
    padding: 20px;
}

.auth-card {
    background: white;
    width: 100%;
    max-width: 450px;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(76, 81, 191, 0.15);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-header h2 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 2rem;
}

.auth-header p {
    color: #718096;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
}

.form-input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(76, 81, 191, 0.1);
}

.form-input:disabled {
    background-color: #f8f9fa;
    color: #2d3748;
    border-color: #edf2f7;
    cursor: not-allowed;
    opacity: 1;
}

.role-selection {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.role-option {
    flex: 1;
    position: relative;
}

.role-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.role-card {
    display: block;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 0.9rem;
    color: #718096;
}

.role-option input:checked + .role-card {
    border-color: var(--primary);
    background-color: #ebf4ff;
    color: var(--primary);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(76, 81, 191, 0.3);
}

.auth-footer {
    margin-top: 25px;
    font-size: 0.9rem;
    color: #718096;
}

.auth-link {
    color: var(--secondary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.hidden {
    display: none;
}

/* Alert Box */
.alert {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: none;
}
.alert-error { background-color: #fed7d7; color: #c53030; }
.alert-success { background-color: #c6f6d5; color: #2f855a; }

/* --- HALAMAN PROFIL --- */
.profile-container {
    max-width: 1200px;
    margin: 120px auto 60px; /* Jarak dari atas karena header fixed */
    padding: 0 20px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Sidebar Profil */
.profile-sidebar {
    width: 280px;
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    position: sticky;
    top: 120px;
    flex-shrink: 0;
}

.profile-menu { list-style: none; }
.profile-menu li { margin-bottom: 10px; }

.profile-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #718096;
    text-decoration: none;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s;
    cursor: pointer;
}

.profile-menu a:hover, .profile-menu a.active {
    background: #ebf4ff;
    color: var(--primary);
}

.profile-content { flex: 1; width: 100%; }
.profile-section { display: none; animation: fadeIn 0.3s ease; }
.profile-section.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.profile-card {
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.profile-header-row {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .profile-container { flex-direction: column; }
    .profile-sidebar { width: 100%; position: static; margin-bottom: 20px; }
    .profile-header-row {
        flex-direction: column;
        text-align: center;
    }
}

.profile-avatar-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    flex-shrink: 0;
}

.profile-img-lg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--light);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.profile-img-lg:hover { transform: scale(1.05); }

.avatar-upload-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 3px solid white;
    transition: transform 0.2s;
}

.avatar-upload-btn:hover {
    transform: scale(1.1);
}

/* --- PROGRESS BAR PROFIL --- */
.progress-wrapper {
    margin-top: 20px;
    width: 100%;
    max-width: 350px; /* Batasi lebar agar rapi */
}
.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: #718096;
    font-weight: 600;
}
.progress-track {
    width: 100%;
    height: 10px;
    background: #edf2f7;
    border-radius: 10px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-info { flex: 1; }
.profile-info h2 { color: var(--dark); margin-bottom: 5px; font-size: 2rem; }
.profile-role {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}
.role-user { background: #c6f6d5; color: #22543d; } /* Hijau */
.role-owner { background: #fed7d7; color: #822727; } /* Merah */

.profile-form {
    width: 100%;
    max-width: 100%;
    text-align: left;
    border-top: 1px solid #e2e8f0;
    padding-top: 30px;
}

.profile-form .form-group {
    display: flex;
    align-items: center;
}

.profile-form .form-group label {
    width: 200px;
    margin-bottom: 0;
    flex-shrink: 0;
    color: #4a5568;
    font-weight: 600;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-left: 200px;
}

@media (max-width: 768px) {
    .profile-form .form-group { flex-direction: column; align-items: stretch; }
    .profile-form .form-group label { width: 100%; margin-bottom: 8px; }
    .form-actions { padding-left: 0; }
}

.btn-danger {
    background: #e53e3e;
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

/* --- DASHBOARD LAYOUT --- */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: white;
    padding: 30px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    position: fixed;
    height: 100%;
}

.sidebar-menu { margin-top: 40px; list-style: none; }
.sidebar-menu li { margin-bottom: 15px; }
.sidebar-menu a {
    text-decoration: none; color: #718096; font-weight: 600; display: flex; align-items: center; gap: 10px;
    padding: 10px 15px; border-radius: 12px; transition: all 0.3s;
}
.sidebar-menu a:hover, .sidebar-menu a.active {
    background: #ebf4ff; color: var(--primary);
}
.logout-btn { margin-top: auto; color: #e53e3e !important; cursor: pointer; }

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px; /* Lebar sidebar */
    padding: 40px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* Tombol Tambah Kost */
.btn-add {
    background: var(--primary);
    color: white; padding: 12px 25px; border-radius: 50px; border: none; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; gap: 8px; box-shadow: 0 5px 15px rgba(76, 81, 191, 0.3);
    transition: transform 0.2s;
}
.btn-add:hover { transform: translateY(-3px); }

/* Grid Iklan Saya */
.my-property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.admin-card {
    background: white; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.05); position: relative;
}
.admin-card img { width: 100%; height: 200px; object-fit: cover; }
.admin-card-body { padding: 20px; }
.btn-delete {
    background: #fed7d7; color: #c53030; border: none; padding: 8px 15px; border-radius: 8px;
    font-size: 0.8rem; cursor: pointer; font-weight: 600; margin-top: 10px; width: 100%;
}

/* --- MODAL (POPUP FORM) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(5px);
    z-index: 2000; display: none; justify-content: center; align-items: center;
}
.modal-overlay.active { display: flex; }

.modal-box {
    background: white; width: 800px; max-width: 95%; padding: 30px; border-radius: 20px;
    max-height: 90vh; overflow-y: auto; position: relative;
    animation: slideUp 0.3s ease;
}
.close-modal {
    position: absolute; top: 20px; right: 20px; font-size: 1.5rem; cursor: pointer; color: #718096;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .modal-form-grid { grid-template-columns: 1fr; }
}

/* --- DETAIL PAGE --- */
.detail-header { margin-top: 100px; padding: 0 20px; max-width: 1200px; margin-left: auto; margin-right: auto; }

/* Gallery */
.gallery-grid {
    display: grid; grid-template-columns: 2fr 1fr; gap: 10px;
    height: 400px; border-radius: 20px; overflow: hidden; margin-top: 20px;
}
.main-img { width: 100%; height: 100%; object-fit: cover; background: #ddd; }
.sub-img { width: 100%; height: 100%; object-fit: cover; background: #ccc; }

/* Content Layout (Kiri: Detail, Kanan: Booking Card) */
.detail-content {
    display: grid; grid-template-columns: 2fr 1fr; gap: 40px;
    max-width: 1200px; margin: 40px auto; padding: 0 20px;
}

/* Info Section */
.info-section { margin-bottom: 40px; border-bottom: 1px solid #e2e8f0; padding-bottom: 30px; }
.info-section h3 { color: var(--dark); margin-bottom: 15px; font-size: 1.2rem; }
.facility-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.facility-item { display: flex; align-items: center; gap: 10px; color: #4a5568; }
.facility-item i { color: var(--primary); width: 20px; }

/* Owner Profile Small */
.owner-badge {
    display: flex; align-items: center; gap: 15px; margin: 20px 0;
    padding: 20px; background: #f7fafc; border-radius: 12px;
}

/* Booking Card (Sticky) */
.booking-card {
    background: white; padding: 30px; border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1); border: 1px solid #e2e8f0;
    position: sticky; top: 110px; height: fit-content;
}

.price-tag { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.price-period { font-size: 0.9rem; color: #718096; font-weight: 400; }

/* Map */
#map { width: 100%; height: 300px; border-radius: 16px; margin-top: 20px; z-index: 1; }

/* Responsive untuk HP */
@media (max-width: 768px) {
    .detail-content { grid-template-columns: 1fr; }
    .gallery-grid { height: 250px; grid-template-columns: 1fr; }
    .sub-img { display: none; } /* Sembunyikan gambar kecil di HP */
}

/* --- PAYMENT PAGE --- */
.payment-container {
    max-width: 1000px;
    margin: 120px auto 60px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1.5fr 1fr; /* Kiri Form, Kanan Ringkasan */
    gap: 40px;
}

.payment-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.order-summary {
    background: #f7fafc;
    padding: 25px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: #4a5568;
}

.summary-total {
    border-top: 2px dashed #cbd5e0;
    margin-top: 20px;
    padding-top: 20px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
    display: flex; justify-content: space-between;
}

.payment-method-box {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
}
.payment-method-box:hover, .payment-method-box.active {
    border-color: var(--primary);
    background: #ebf4ff;
}

@media (max-width: 768px) {
    .payment-container { grid-template-columns: 1fr; }
    .payment-card { order: 2; } /* Di HP, Ringkasan di atas */
    .summary-sticky { position: static; }
}

/* --- FITUR FAVORIT --- */
.love-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, background 0.2s;
    z-index: 10; /* Agar di atas gambar */
    border: none;
    font-size: 1.1rem;
    color: #cbd5e0; /* Warna abu-abu saat mati */
}

.love-btn:hover {
    transform: scale(1.1);
}

.love-btn.active {
    color: #e53e3e; /* Warna merah saat aktif */
}

.love-btn.active i {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* --- FITUR FILTER & SORTING --- */
.filter-container {
    background: white;
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #718096;
}

.filter-input, .filter-select {
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    font-size: 0.9rem;
}

.filter-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    height: 40px;
    margin-top: auto; /* Agar sejajar tombolnya */
    align-self: flex-end;
}

.filter-btn:hover {
    background: var(--secondary);
}

/* Checkbox Style Simple */
.checkbox-group {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 10px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    cursor: pointer;
}

/* --- TOAST NOTIFICATION (POPUP) --- */
.toast-notification {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px); /* Mulai dari atas layar */
    z-index: 9999;
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Efek Bounce */
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 300px;
    pointer-events: none;
    background: white;
}
.toast-notification.show {
    transform: translateX(-50%) translateY(0); /* Turun ke posisi normal */
    opacity: 1;
    pointer-events: auto;
}
.toast-notification.alert-success { background-color: #f0fff4; color: #2f855a; border: 1px solid #9ae6b4; }
.toast-notification.alert-error { background-color: #fff5f5; color: #c53030; border: 1px solid #feb2b2; }