:root {
    /* Brand Colors (Bhumimitra - Premium Emerald & Gold Theme) */
    --primary-color: #064e3b; /* Deep emerald */
    --primary-light: #047857;
    --accent-color: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.3);
    
    /* New Royal Gold Identity */
    --gold-accent: #f59e0b;
    --gold-dark: #d97706;
    --gold-glow: rgba(245, 158, 11, 0.4);
    
    /* UI Colors (Light Mode Default) */
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.85);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    
    /* Spacing & Borders */
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --nav-height: 70px;
    --header-height: 60px;
    --padding-container: clamp(16px, 4vw, 32px);
    
    /* Typography */
    --font-family: 'Outfit', sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glass: 0 4px 30px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a;
        --surface-color: #1e293b;
        --surface-glass: rgba(30, 41, 59, 0.85);
        --text-primary: #f8fafc;
        --text-secondary: #94a3b8;
        --border-color: #334155;
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
        --shadow-glass: 0 4px 30px rgba(0, 0, 0, 0.2);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    overflow-x: hidden !important;
    width: 100%;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden !important;
}

/* Typography Utilities */
.text-accent { color: var(--accent-color); }
.text-gold { color: var(--gold-accent); }

/* Premium Gradient Text */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; line-height: 1.2; margin-bottom: 1rem; }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 700; margin-bottom: 1rem; }
h3, h4 { font-weight: 600; }
.section-title {
    font-size: clamp(1.15rem, 3vw, 1.4rem);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.see-all {
    font-size: 0.875rem;
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
}

/* Glassmorphism utility */
.glass {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* App Shell Layout */
#app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow-x: hidden !important;
    width: 100%;
}

.app-header {
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--padding-container);
}

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

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.icon-btn:hover { background-color: var(--border-color); }

.icon-btn[aria-label="Favorites"]:hover {
    color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.08) !important;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    padding-top: calc(var(--header-height) + 16px);
    padding-bottom: calc(var(--nav-height) + 24px);
    padding-inline: var(--padding-container);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 50;
    border-top: 1px solid var(--border-color);
    border-bottom: none;
    padding-bottom: env(safe-area-inset-bottom); /* iOS safe area */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    gap: 4px;
    width: 20%;
    transition: color 0.3s ease;
}

.nav-item i {
    font-size: 1.25rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item.active {
    color: var(--primary-light);
}

.nav-item.active i {
    transform: translateY(-2px);
}

.nav-item.fab-item {
    position: relative;
    top: -24px;
    z-index: 100;
    width: auto;
    flex: 1;
}

.fab {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    border: 6px solid var(--surface-color); /* Creates a massive clean cutout effect */
    box-sizing: content-box !important; /* Prevents border from squishing the inside */
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: fabPulse 2.5s infinite;
    position: relative; /* For absolutely positioning the icon inside */
}

@keyframes fabPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.nav-item.fab-item:active .fab, .nav-item.fab-item:hover .fab {
    transform: scale(0.92) translateY(2px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    animation: none;
}

.fab i {
    font-size: 1.6rem !important;
    color: white !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important; /* Forces DEAD CENTER alignment always */
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

/* Loader */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}
.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Hero Section / Categories */
.search-bar {
    display: flex;
    align-items: center;
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    padding: 12px 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}
.search-bar i { color: var(--text-secondary); margin-right: 12px; }
.search-bar input {
    border: none;
    background: transparent;
    flex: 1;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
}
.search-bar .filter-btn {
    border: none;
    background: transparent;
    color: var(--primary-light);
    font-size: 1.25rem;
    cursor: pointer;
}

.categories {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-inline: calc(var(--padding-container) * -1);
    padding-inline: var(--padding-container);
    scrollbar-width: none; /* Firefox */
}
.categories::-webkit-scrollbar { display: none; /* Chrome */ }

.category-pill {
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--surface-color);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}
.category-pill.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Property Cards */
.property-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 16px;
}

.property-card {
    background: var(--surface-color);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}
.property-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(4, 120, 87, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}
.property-card:active { transform: scale(0.98); }

.card-image-wrapper {
    position: relative;
    height: 200px;
    width: 100%;
}
.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.status-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.owner-verified {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 2;
    border: 1px solid var(--gold-accent);
}

.owner-verified i {
    color: var(--gold-accent);
}
@media (prefers-color-scheme: dark) {
    .owner-verified { background: rgba(30, 41, 59, 0.9); color: var(--gold-accent); border-color: var(--gold-dark); }
}

.card-content {
    padding: 16px;
}
.property-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 4px;
}
.property-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.property-location {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.property-features {
    display: flex;
    gap: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}
.feature {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.4s ease forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Desktop / Responsive Layout */
.desktop-nav {
    display: none;
}

/* Footer */
.app-footer {
    background-color: var(--primary-color);
    color: white;
    padding: 32px var(--padding-container) 24px;
    margin-top: 40px;
    border-radius: 24px 24px 0 0;
    text-align: center;
}

.app-footer .footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.app-footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.app-footer .footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.app-footer .footer-links a:hover {
    color: white;
}

.app-footer .copyright {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.mobile-only {
    display: flex !important;
}

.desktop-only {
    display: none !important;
}

@media (min-width: 768px) {
    .mobile-only {
        display: none !important;
    }
    
    .desktop-only {
        display: flex !important;
    }

    .bottom-nav {
        display: none !important;
    }
    
    /* Perfect flex centering for header to prevent any link shifting */
    .app-header {
        position: fixed;
        top: 0;
        left: 0 !important;
        right: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0;
        transform: none !important;
        padding: 0 4% !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .app-header .logo,
    .app-header .header-back {
        flex: 0 0 260px !important;
        width: 260px !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px;
    }

    .app-header .header-actions {
        flex: 0 0 260px !important;
        width: 260px !important;
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        gap: 12px;
    }

    .app-header .desktop-nav {
        flex: 1 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 28px !important;
    }
    
    .desktop-nav a {
        text-decoration: none;
        color: var(--text-primary);
        font-weight: 500;
        transition: color 0.2s;
        white-space: nowrap;
    }
    
    .desktop-nav a:hover, .desktop-nav a.active {
        color: var(--primary-light);
    }

    #app {
        max-width: 100% !important;
        width: 100%;
        box-shadow: none;
        border: none;
    }

    .app-content {
        max-width: 1400px;
        margin: 0 auto;
        width: 100%;
        padding-bottom: 40px; /* less padding since bottom nav is gone */
        padding-top: calc(var(--header-height) + 32px);
        padding-inline: 4% !important;
    }

    .property-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 24px;
    }

    .app-footer {
        width: 100% !important;
        border-radius: 24px !important;
        box-sizing: border-box !important;
        padding: 48px 40px !important;
        margin-top: 60px !important;
        position: static !important;
        left: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-inline: 0 !important;
        box-shadow: var(--shadow-md);
        border: 1px solid rgba(16, 185, 129, 0.1);
    }
    
    .app-footer .footer-links {
        gap: 32px !important;
        margin-bottom: 32px !important;
    }
}

/* Premium Like Button Styles */
.like-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.like-btn:hover {
    transform: scale(1.1);
    color: #e11d48;
    background: #ffffff;
}

.like-btn.liked {
    color: #e11d48;
    background: #ffffff;
    animation: heartPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.5) forwards;
}

.like-btn i {
    transition: transform 0.2s ease;
}

.like-btn:active i {
    transform: scale(0.8);
}

@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

