/* Design System Variables */
:root {
    --bg-primary: #f9fafb;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --brand-blue: #1e3a8a;
    --brand-green: #059669;
    --hero-gradient: linear-gradient(to right, #2563eb, #1e40af);
}

.dark-theme {
    --bg-primary: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --brand-blue: #3b82f6;
    --brand-green: #10b981;
    --hero-gradient: linear-gradient(to right, #1e40af, #0f172a);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
}

/* Dark Mode Utility Overrides for Tailwind classes */
.dark-theme .bg-white {
    background-color: var(--bg-card) !important;
}
.dark-theme .bg-gray-50,
.dark-theme .bg-gray-100 {
    background-color: var(--bg-primary) !important;
}
.dark-theme .text-gray-900,
.dark-theme .text-gray-800,
.dark-theme .text-gray-700 {
    color: var(--text-main) !important;
}
.dark-theme .text-gray-600,
.dark-theme .text-gray-500,
.dark-theme .text-gray-400 {
    color: var(--text-muted) !important;
}
.dark-theme .border-gray-100,
.dark-theme .border-gray-200,
.dark-theme .border-gray-300,
.dark-theme .border {
    border-color: var(--border-color) !important;
}

/* Custom styles */
.search-box:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Property Card Styles */
.property-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s;
    width: 100%;
    cursor: pointer;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Image Section */
.card-image {
    position: relative;
    height: 240px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.property-card:hover .card-image img {
    transform: scale(1.05);
}

/* Badge */
.sale-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #10b981;
    color: white;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Wishlist Button */
.wishlist-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--bg-card);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wishlist-btn:hover {
    background: #ef4444;
    color: white;
}

/* Content Section */
.card-content {
    padding: 18px;
}

.property-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.property-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 12px;
}

.property-location i {
    font-size: 12px;
    color: #2563eb;
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
}

/* Price Section */
.price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.price {
    font-size: 20px;
    font-weight: 700;
    color: #2563eb;
}

.view-btn {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: white;
    padding: 8px 18px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.view-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
    transform: scale(1.02);
}

/* Logo & Animation Styles */
.logo-container {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    text-decoration: none !important;
}

.logo-container img {
    height: 80px; /* Increased Size */
    width: auto;
    animation: elephantWalk 2s ease-in-out infinite;
    transform-origin: bottom center;
}

@keyframes elephantWalk {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-4px) rotate(-4deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(-4px) rotate(4deg); }
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1;
}

.brand-main {
    font-size: 2.25rem; /* Increased Size */
    font-weight: 950;
    color: var(--brand-blue);
    letter-spacing: -1.5px;
}

.brand-sub {
    display: flex;
    font-size: 1.5rem; /* Increased Size */
    font-weight: 800;
    color: var(--brand-green);
}

.animated-letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(12px);
    animation: revealLetter 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes revealLetter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered delays for "lands.lk" (8 characters) */
.animated-letter:nth-child(1) { animation-delay: 0.1s; }
.animated-letter:nth-child(2) { animation-delay: 0.2s; }
.animated-letter:nth-child(3) { animation-delay: 0.3s; }
.animated-letter:nth-child(4) { animation-delay: 0.4s; }
.animated-letter:nth-child(5) { animation-delay: 0.5s; }
.animated-letter:nth-child(6) { animation-delay: 0.6s; }
.animated-letter:nth-child(7) { animation-delay: 0.7s; }
.animated-letter:nth-child(8) { animation-delay: 0.8s; }

/* Premium Dark Mode Lamp Toggle (Pull String) */
.lamp-toggle-container {
    position: relative;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    margin-left: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lamp-body {
    width: 32px;
    height: 40px;
    background: #fbbf24; /* Lamp Glow Gold */
    border-radius: 50% 50% 10px 10px;
    position: relative;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
    transition: all 0.3s ease;
    z-index: 10;
}

.dark-theme .lamp-body {
    background: #475569;
    box-shadow: none;
}

.lamp-base {
    width: 40px;
    height: 8px;
    background: #475569;
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 4px 4px;
}

.pull-string {
    width: 2px;
    height: 50px;
    background: #cbd5e1;
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    transition: height 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pull-string::after {
    content: '';
    width: 12px;
    height: 20px;
    background: #1e293b;
    border-radius: 4px;
    position: absolute;
    bottom: -15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pull-string:active {
    height: 70px;
}

.lamp-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.6) 0%, rgba(251, 191, 36, 0) 70%);
    opacity: 1;
    transition: opacity 0.3s;
    z-index: 5;
}

.dark-theme .lamp-glow {
    opacity: 0;
}

/* ============================================================
   DARK MODE — TAILWIND OVERRIDE LAYER
   These rules fight hardcoded Tailwind utility classes so the
   .dark-theme class actually works across all pages.
   ============================================================ */

/* Body & page backgrounds */
body.dark-theme,
.dark-theme.bg-gray-100 {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

/* Navigation */
.dark-theme nav,
.dark-theme nav.bg-white {
    background-color: #1e293b !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important;
    border-bottom: 1px solid #334155 !important;
}

/* All white-background elements */
.dark-theme .bg-white {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* Gray section backgrounds */
.dark-theme .bg-gray-50,
.dark-theme section.bg-gray-50 {
    background-color: #0f172a !important;
}
.dark-theme .bg-gray-100 {
    background-color: #0f172a !important;
}

/* Sidebar & panel backgrounds */
.dark-theme .bg-gray-200 {
    background-color: #334155 !important;
}

/* Text colors */
.dark-theme .text-gray-900 { color: #f1f5f9 !important; }
.dark-theme .text-gray-800 { color: #e2e8f0 !important; }
.dark-theme .text-gray-700 { color: #cbd5e1 !important; }
.dark-theme .text-gray-600 { color: #94a3b8 !important; }
.dark-theme .text-gray-500 { color: #64748b !important; }
.dark-theme .text-gray-400 { color: #475569 !important; }

/* Section that are hardcoded white */
.dark-theme section.bg-white {
    background-color: #1e293b !important;
}

/* "Why Choose Us" section */
.dark-theme .text-gray-600 p,
.dark-theme section.bg-white p {
    color: #94a3b8 !important;
}

/* Border colors */
.dark-theme .border-gray-200,
.dark-theme .border-gray-100,
.dark-theme .border-gray-300 {
    border-color: #334155 !important;
}

/* Inputs, selects, textareas */
.dark-theme input,
.dark-theme select,
.dark-theme textarea {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}
.dark-theme input::placeholder { color: #64748b !important; }

/* Filter/sidebar cards */
.dark-theme .rounded-2xl.bg-white,
.dark-theme .rounded-2xl.shadow-sm {
    background-color: #1e293b !important;
}

/* Pricing cards */
.dark-theme .pricing-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}
.dark-theme .card-header {
    border-bottom-color: #334155 !important;
}
.dark-theme .price .amount { color: #f1f5f9 !important; }
.dark-theme .feature-item {
    color: #cbd5e1 !important;
    border-bottom-color: #334155 !important;
}
.dark-theme .pricing-section {
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%) !important;
}
.dark-theme .ad-headline h2 {
    background: linear-gradient(135deg, #60a5fa, #34d399) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
}
.dark-theme .feature-badge {
    background: #0f172a !important;
    color: #34d399 !important;
}

/* Footer adjustments */
.dark-theme footer.bg-gray-800 {
    background-color: #020617 !important;
}

/* Search bar inside hero */
.dark-theme .bg-white.rounded-lg {
    background-color: #1e293b !important;
}
.dark-theme #searchBar {
    border-color: #334155 !important;
}
.dark-theme #searchLocation {
    color: #f8fafc !important;
    background-color: transparent !important;
}
.dark-theme .border-r.border-gray-200 {
    border-right-color: #334155 !important;
}

/* Nav links in dark mode */
.dark-theme nav a.text-gray-700 {
    color: #cbd5e1 !important;
}
.dark-theme nav a:hover {
    color: #60a5fa !important;
}

/* Sign up button subtle dark adaptation */
.dark-theme .bg-blue-50 {
    background-color: rgba(59, 130, 246, 0.15) !important;
}

/* Pull string knob in dark */
.dark-theme .pull-string::after {
    background: #f8fafc !important;
}

/* Extra filters panel */
.dark-theme #extraFilters {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}
.dark-theme #extraFilters label { color: #cbd5e1 !important; }
.dark-theme #extraFilters .bg-gray-100 {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
}

/* Responsive Menu Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slideDown {
    animation: slideDown 0.3s ease-out forwards;
}

#mobileMenu.hidden {
    display: none;
}

#mobileMenu:not(.hidden) {
    display: block;
}

/* Ensure images and videos are responsive */
img, video {
    max-width: 100%;
    height: auto;
}

/* Adjustments for smaller screens */
@media (max-width: 640px) {
    .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 {
        font-size: 1.875rem !important; /* text-3xl */
    }
    
    h2 {
        font-size: 1.5rem !important; /* text-2xl */
    }
}
