/* ============================================
   InapKost - Main Stylesheet
   ============================================ */

:root {
    --primary: #2e7d6b;
    --primary-dark: #1f5a4d;
    --primary-light: #4fa68e;
    --accent: #ff7a59;
    --accent-dark: #e8633f;
    --dark: #1a2332;
    --gray-900: #1f2937;
    --gray-700: #374151;
    --gray-500: #6b7280;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #eab308;
    --info: #0284c7;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --radius: 10px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--gray-900);
    background: var(--gray-50);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

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

/* ============= NAVBAR ============= */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    gap: 24px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 22px;
    color: var(--primary);
    flex: 0 0 auto;
    min-width: 0;
}
.brand span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-icon { font-size: 26px; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-700);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 16px;
    row-gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: 24px;
}

.nav-menu a {
    color: var(--gray-700);
    font-weight: 500;
    padding: 8px 4px;
    white-space: nowrap;
}

.nav-menu a:hover { color: var(--primary); }

.nav-user {
    position: relative;
    cursor: pointer;
}

.user-name {
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: inline-block;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    min-width: 180px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-user:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
}

.user-dropdown a:hover { background: var(--gray-100); }

/* Grouping menu dropdown user */
.user-dropdown .dropdown-group-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    font-weight: 700;
    padding: 8px 12px 4px;
    margin-top: 4px;
}
.user-dropdown hr {
    margin: 6px 0;
    border: none;
    border-top: 1px solid var(--gray-200, #eee);
}
/* jembatan hover agar dropdown tidak hilang saat mouse turun */
.nav-user::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    height: 12px;
}

/* ============= BUTTONS ============= */
.btn-primary, .btn-outline, .btn-accent, .btn-danger, .btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: var(--transition);
    text-align: center;
}

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); transform: translateY(-1px); }

.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--accent-dark); color: var(--white); transform: translateY(-1px); }

.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }

.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #b91c1c; color: var(--white); }

.btn-secondary { background: var(--gray-200); color: var(--gray-900); }
.btn-secondary:hover { background: var(--gray-300); }

.btn-block { display: block; width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ============= MAIN CONTENT ============= */
.main-content { flex: 1; }

/* ============= ALERTS ============= */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin: 20px 0;
    border-left: 4px solid;
}

.alert-success { background: #d1fae5; color: #065f46; border-color: var(--success); }
.alert-danger  { background: #fee2e2; color: #991b1b; border-color: var(--danger); }
.alert-warning { background: #fef3c7; color: #92400e; border-color: var(--warning); }
.alert-info    { background: #dbeafe; color: #1e40af; border-color: var(--info); }

/* ============= HERO ============= */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: 80px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.hero h1 {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
    position: relative;
}

.hero p {
    font-size: clamp(15px, 2vw, 18px);
    opacity: 0.95;
    max-width: 600px;
    position: relative;
}

/* Search Card di Hero */
.hero-search {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    margin-top: 36px;
    position: relative;
    z-index: 2;
}

.search-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--gray-100);
}

.search-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: var(--transition);
}

.search-tab.active {
    color: var(--primary);
    border-color: var(--primary);
}

.search-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.search-form .form-group { margin: 0; }

.search-form label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.search-form input,
.search-form select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--gray-900);
    background: var(--white);
}

.search-form input:focus,
.search-form select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============= SECTIONS ============= */
.section { padding: 60px 0; }
.section-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--gray-900);
}
.section-subtitle {
    color: var(--gray-500);
    margin-bottom: 32px;
}

/* ============= CATEGORIES ============= */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.category-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    color: var(--gray-900);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: var(--primary);
}

.category-icon { font-size: 36px; margin-bottom: 8px; }
.category-name { font-weight: 600; font-size: 14px; }

/* ============= PROPERTY CARDS ============= */
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.property-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.property-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--gray-100);
}

.property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.property-card:hover .property-image img {
    transform: scale(1.05);
}

.property-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--accent);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.property-badge.monthly { background: var(--primary); }

.property-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.property-category {
    font-size: 11px;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.property-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.property-card a:hover .property-title {
    color: var(--primary);
}

.property-location {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.property-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--gray-700);
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}

.property-meta span { display: flex; align-items: center; gap: 4px; }

.property-price {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.price-amount {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
}

.price-unit {
    font-size: 12px;
    color: var(--gray-500);
}

/* ============= PROPERTY DETAIL ============= */
.detail-gallery {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
}

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

.detail-gallery > :first-child {
    grid-row: span 2;
}

.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    margin: 24px 0;
}

.detail-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.amenity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.amenity-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 14px;
}

.booking-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 90px;
}

.booking-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
}

.booking-price-unit {
    color: var(--gray-500);
    font-size: 14px;
    font-weight: normal;
}

/* ============= FORMS ============= */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--gray-700);
}

.form-group .required { color: var(--danger); }

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 107, 0.1);
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.checkbox-item:hover {
    background: var(--gray-100);
}

.checkbox-item input[type=checkbox] {
    cursor: pointer;
}

/* ============= AUTH CARDS ============= */
.auth-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    padding: 40px 20px;
}

.auth-card {
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    background: var(--white);
    padding: 36px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.auth-card h1 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.auth-card p { color: var(--gray-500); margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 16px; color: var(--gray-500); }

/* ============= TABLES ============= */
.table-wrapper {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.table th {
    background: var(--gray-50);
    font-weight: 700;
    color: var(--gray-700);
    font-size: 12px;
    text-transform: uppercase;
}

.table tr:hover { background: var(--gray-50); }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success  { background: #d1fae5; color: #065f46; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-info     { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: var(--gray-200); color: var(--gray-700); }

/* ============= DASHBOARD ============= */
.dashboard-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    padding: 24px 0;
}

.sidebar {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    height: fit-content;
    box-shadow: var(--shadow);
}

.sidebar h3 {
    font-size: 14px;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--gray-700);
    font-weight: 500;
    margin-bottom: 4px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--primary);
    color: var(--white);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.stat-card h4 {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
}

/* ============= FILTERS SIDEBAR ============= */
.search-page {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    padding: 24px 0;
}

.filter-box {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 80px;
}

.filter-group { margin-bottom: 20px; }
.filter-group h4 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gray-700);
    margin-bottom: 10px;
}

/* ============= PAGINATION ============= */
.pagination {
    list-style: none;
    display: flex;
    gap: 4px;
    justify-content: center;
    margin: 32px 0 0;
    flex-wrap: wrap;
}

.pagination .page-link {
    padding: 8px 14px;
    background: var(--white);
    border-radius: 6px;
    box-shadow: var(--shadow);
    color: var(--gray-700);
    font-weight: 500;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    color: var(--white);
}

/* ============= FOOTER ============= */
.footer {
    background: var(--dark);
    color: var(--gray-300);
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 30px;
}

.footer h4 {
    color: var(--white);
    margin-bottom: 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-brand {
    color: var(--white);
    margin-bottom: 12px;
    font-size: 22px;
}

.footer ul { list-style: none; }
.footer ul li { margin-bottom: 6px; }
.footer a { color: var(--gray-300); font-size: 14px; }
.footer a:hover { color: var(--white); }

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--gray-500);
}

/* ============= RESPONSIVE ============= */
@media (max-width: 900px) {
    .nav-toggle { display: block; }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        align-items: stretch;
    }
    
    .nav-menu.active { display: flex; }
    .nav-menu a { padding: 12px; border-radius: 8px; }
    .nav-menu a:hover { background: var(--gray-100); }
    
    .nav-user { display: none; }
    
    .search-form {
        grid-template-columns: 1fr;
    }
    
    .detail-gallery {
        grid-template-columns: 1fr;
        aspect-ratio: auto;
    }
    
    .detail-gallery > * { aspect-ratio: 16/9; }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid,
    .search-page {
        grid-template-columns: 1fr;
    }
    
    .sidebar,
    .filter-box {
        position: static;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .booking-card {
        position: static;
    }
}

@media (max-width: 540px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .hero {
        padding: 40px 0 60px;
    }
    
    .section {
        padding: 40px 0;
    }
}

/* ============= UTILITIES ============= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}
.empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}
