/* General Body and Font */
body {
    font-family: 'Inter', sans-serif;
    background-color: #FAFAF8;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dark body {
    background-color: #1a1a1a;
    color: #e5e5e5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
}

/* Dark Mode Styles */
.dark .bg-white {
    background-color: #2d2d2d !important;
}

.dark .bg-gray-50 {
    background-color: #1a1a1a !important;
}

.dark .text-gray-800,
.dark .text-gray-900 {
    color: #e5e5e5 !important;
}

.dark .text-gray-600,
.dark .text-gray-700 {
    color: #a0a0a0 !important;
}

.dark .border-gray-200,
.dark .border-gray-300 {
    border-color: #404040 !important;
}

.dark .shadow-sm,
.dark .shadow-md,
.dark .shadow-lg {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
}

.dark .bg-brand-brown {
    background-color: #8B6F47 !important;
}

.dark .profile-content {
    background-color: #2d2d2d !important;
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #FAFAF8 0%, #F5F3EF 100%);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.splash-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Hero Section Background */
.hero-bg {
    background-image: linear-gradient(rgba(107, 68, 35, 0.85), rgba(107, 68, 35, 0.6)), url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Main content scrollable area */
.flex-1.overflow-y-auto {
    padding-bottom: 96px;
}

/* Main App Layout */
#app-container.sidebar-collapsed #desktop-sidebar {
    width: 0 !important;
    overflow: hidden;
}

/* Desktop Sidebar */
#desktop-sidebar {
    transition: width 0.3s ease-in-out, overflow 0s linear 0.3s;
}

/* Main Content Wrapper */
.main-content-wrapper {
    transition: margin-left 0.3s ease-in-out;
}

/* Desktop Layout - No default margin, sidebar uses absolute positioning concept */
@media (min-width: 1024px) {
    #desktop-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 30;
    }

    .main-content-wrapper {
        margin-left: 16rem; /* 256px, same as sidebar width */
    }

    #app-container.sidebar-collapsed .main-content-wrapper {
        margin-left: 0;
    }
}

/* Mobile Bottom Navigation - Hidden on desktop */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-top: 1px solid #E5E7EB;
    z-index: 40;
}

@media (min-width: 1024px) {
    .bottom-nav {
        display: none;
    }
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #6B7280;
    transition: color 0.3s ease;
}

.nav-link.nav-active {
    color: #1F2937;
}

/* Property Card Styles */
.property-card {
    transition: all 0.3s ease;
}

.property-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(107, 68, 35, 0.15);
    border-color: #B8860B;
}

/* Fallback for older browsers that don't support backdrop-filter */
@supports not (backdrop-filter: blur(12px)) {
    .bottom-nav {
        background: #ffffff;
    }
}

/* Profile/Property Viewer Popup */
.profile-popup {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 50;
    transition: right 0.3s ease-in-out;
    overflow-y: auto;
}

.profile-popup.active {
    right: 0;
}

.profile-content {
    padding: 2rem;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: #F3F4F6;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #6B7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #E5E7EB;
    color: #374151;
}

.profile-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 45;
    transition: background 0.3s ease;
    pointer-events: none;
}

.profile-backdrop.active {
    background: rgba(0, 0, 0, 0.5);
    pointer-events: all;
}

/* Profile Circle Button in Bottom Nav */
.profile-circle {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #6B4423 0%, #8B7355 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(107, 68, 35, 0.3);
    transition: all 0.3s ease;
    border: 2px solid #B8860B;
}

.profile-nav-btn:hover .profile-circle {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(184, 134, 11, 0.4);
    background: linear-gradient(135deg, #8B7355 0%, #6B4423 100%);
}

.profile-nav-btn {
    position: relative;
}

/* Active nav link - brand color */
.nav-link.nav-active {
    color: #6B4423 !important;
}

/* Mobile Sidebar Styles */
.mobile-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 240px;
    background: #6B4423;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    z-index: 50;
    transition: width 0.3s ease-in-out;
    overflow: hidden;
}

.mobile-sidebar.minimized {
    width: 70px;
}

.mobile-sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem 0;
}

.mobile-sidebar-header {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    margin-bottom: 2rem;
    gap: 0.75rem;
}

.mobile-toggle-btn {
    background: rgba(184, 134, 11, 0.15);
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem;
    color: #B8860B;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-toggle-btn:hover {
    background: rgba(184, 134, 11, 0.25);
    transform: scale(1.05);
}

.mobile-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.mobile-sidebar.minimized .mobile-sidebar-logo {
    opacity: 0;
    width: 0;
}

.mobile-sidebar-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.mobile-sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 0.75rem;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    gap: 0.75rem;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.mobile-nav-item:hover {
    background: rgba(184, 134, 11, 0.15);
    color: white;
}

.mobile-nav-item.active {
    background: rgba(184, 134, 11, 0.25);
    color: white;
    font-weight: 600;
}

.mobile-nav-item .nav-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    stroke-width: 2;
}

.mobile-nav-item .nav-text {
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.mobile-sidebar.minimized .nav-text {
    opacity: 0;
    width: 0;
}

.mobile-sidebar-footer {
    border-top: 1px solid rgba(184, 134, 11, 0.3);
    padding: 1rem 0.75rem 0;
}

.mobile-sidebar-branding {
    margin-top: 1rem;
    padding: 0 0.75rem;
    transition: opacity 0.3s ease;
}

.mobile-sidebar.minimized .mobile-sidebar-branding {
    opacity: 0;
}

.branding-text {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin-bottom: 0.25rem;
}

.branding-location {
    font-size: 0.65rem;
    color: #B8860B;
    text-align: center;
    font-weight: 600;
}

/* Adjust main content when mobile sidebar is present */
@media (max-width: 1023px) {
    .main-content-wrapper {
        margin-left: 240px;
        transition: margin-left 0.3s ease-in-out;
    }

    .mobile-sidebar.minimized ~ .main-content-wrapper {
        margin-left: 70px;
    }
}

/* Dark mode adjustments for mobile sidebar */
.dark .mobile-sidebar {
    background: #6B4423;
}