/* ==================== INEST RESPONSIVE CSS FRAMEWORK ==================== */

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f9f9f9;
    color: #333;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ==================== HEADER RESPONSIVE STYLES ==================== */
/* Use higher specificity to override inline styles */
body header {
    background-color: #0b3a7e !important;
    padding: 20px !important;
    color: white !important;
}

body .header-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
}

body .logo img {
    height: 55px !important;
    max-width: 180px !important;
}

body .right-section {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 15px !important;
}

body .search-bar {
    margin-bottom: 0 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
}

body .search-bar input {
    padding: 8px 12px !important;
    width: 220px !important;
    border: none !important;
    border-radius: 5px !important;
    flex: 1 !important;
    min-width: 150px !important;
    font-size: 13px !important;
}

body .search-bar button {
    padding: 8px 16px !important;
    background-color: #1a73e8 !important;
    color: white !important;
    border: none !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    font-size: 13px !important;
}

.nav-bar ul {
    list-style: none;
    display: flex !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

.nav-bar ul li {
    position: relative;
}

.nav-bar ul > li > a {
    color: white !important;
    text-decoration: none !important;
    padding: 6px 8px !important;
    border-radius: 5px !important;
    transition: background-color 0.3s !important;
    font-size: 13px !important;
    white-space: nowrap !important;
}

.nav-bar ul > li > a:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Dropdown styles */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: block !important;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    position: absolute;
    background-color: white;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 5px;
    top: 100%;
    left: 0;
    margin-top: 5px;
    pointer-events: none;
}

.dropdown.active .dropdown-content {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Disable existing hover rule globally */
body .dropdown:hover .dropdown-content {
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

body .dropdown.active:hover .dropdown-content, 
body .dropdown.active .dropdown-content {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-content a {
    color: #333 !important;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-radius: 0;
    transition: background-color 0.3s;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

/* Search Dropdown Specific */
.search-dropdown-container {
    position: relative;
}

.search-dropdown {
    min-width: 320px !important;
    padding: 15px;
    right: 0;
    left: auto !important;
}

.search-bar-dropdown {
    display: flex;
    gap: 10px;
}

.search-bar-dropdown input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

.search-bar-dropdown button {
    padding: 10px 20px;
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

/* Get Nest Button Specific */
.get-nest-btn {
    background-color: #FFD700 !important;
    color: #0b3a7e !important;
    font-weight: bold;
    padding: 8px 16px !important;
    border-radius: 5px !important;
    border: 1px solid #FFD700 !important;
}

.get-nest-btn:hover {
    background-color: #FFC107 !important;
}

.get-nest-container .dropdown-content {
    right: 0;
    left: auto !important;
}

/* Auth buttons */
.auth-buttons {
    display: flex !important;
    gap: 8px !important;
    margin-left: 5px !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
}

.auth-buttons a {
    padding: 6px 10px !important;
    border: 1px solid white !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
}

.auth-buttons .login-btn:hover {
    background-color: white;
    color: #0b3a7e !important;
}

.auth-buttons .register-btn {
    background-color: #FFD700;
    color: #333 !important;
    border-color: #FFD700;
}

.auth-buttons .register-btn:hover {
    background-color: #FFC107;
}

/* ==================== CONTENT RESPONSIVE STYLES ==================== */

/* Banner Styles */
.banner {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #fff;
    padding: 20px;
}

.banner-container {
    width: 90%;
    max-width: 1200px;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto;
}

.banner-container img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
}

.banner-info {
    width: 100%;
    max-width: 1170px;
    background-color: #0b3a7e;
    color: white;
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
}

.banner-info h2, .banner-info p {
    margin: 5px 0;
}

/* Content Containers */
.house-listing, .filter-section, .content-section {
    background: white;
    padding: 20px;
    margin: 20px auto;
    width: 90%;
    max-width: 1200px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.listing-header h2 {
    margin: 0;
    flex: 1;
}

.listing-header button {
    padding: 10px 20px;
    border: none;
    background: #1a73e8;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
}

/* Grid Systems */
.filter-grid, .property-grid, .content-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.property-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.content-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Property Cards */
.property, .pg-card, .house-card {
    display: flex;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.property:hover, .pg-card:hover, .house-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.property img, .pg-card img, .house-card img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 15px;
    flex-shrink: 0;
}

.property-info {
    flex: 1;
}

.property-info h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.property-info p {
    margin: 4px 0;
    color: #666;
    font-size: 14px;
}

.property-rating {
    margin-left: auto;
    text-align: right;
}

.heart-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    margin-left: 10px;
    transition: color 0.3s;
}

.heart-btn:hover {
    color: red;
}

/* Filter Styles */
.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="number"],
.filter-group input[type="range"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.filter-group input[type="checkbox"] {
    margin-right: 8px;
}

.price-range {
    display: flex;
    gap: 10px;
    align-items: center;
}

.price-range input {
    flex: 1;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #1a73e8;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #1557b0;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-success {
    background-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
}

/* Footer */
.footer {
    background-color: #004b9b;
    color: white;
    padding: 40px 20px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-section a {
    color: white;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
}

.footer-section a:hover {
    text-decoration: underline;
}

.social-icons a {
    margin-right: 15px;
    font-size: 24px;
    color: white;
    text-decoration: none;
}

/* ==================== RESPONSIVE MEDIA QUERIES ==================== */

/* Large Tablets (1024px and below) */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 20px;
    }
    
    .search-bar input {
        width: 250px;
    }
    
    .nav-bar ul {
        gap: 10px;
    }
    
    .nav-bar ul li a {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .house-listing, .filter-section, .content-section {
        width: 95%;
        padding: 15px;
    }
}

/* Tablets (768px and below) */
@media (max-width: 768px) {
    /* Header Responsive - Force override with maximum specificity */
    body header {
        padding: 15px 20px !important;
    }
    
    body .header-container {
        flex-direction: column !important;
        align-items: center !important;
        gap: 15px !important;
    }
    
    body .logo img {
        height: 60px !important;
    }
    
    body .right-section {
        width: 100% !important;
        align-items: center !important;
    }
    
    .search-bar {
        width: 100%;
        justify-content: center;
        margin-bottom: 15px;
    }
    
    .search-bar input {
        width: 70%;
        max-width: 300px;
    }
    
    .search-bar button {
        width: auto;
        min-width: 80px;
    }
    
    .nav-bar ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .nav-bar ul li a {
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .auth-buttons {
        margin-left: 0;
        margin-top: 10px;
        justify-content: center;
    }
    
    /* Content Responsive */
    .house-listing, .filter-section, .content-section {
        width: 95%;
        padding: 15px;
        margin: 15px auto;
    }
    
    .listing-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .listing-header button {
        width: 100%;
        max-width: 200px;
    }
    
    /* Property Cards */
    .property, .pg-card, .house-card {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .property img, .pg-card img, .house-card img {
        width: 100px;
        height: 100px;
        margin: 0 auto 15px;
    }
    
    .property-info h3 {
        font-size: 16px;
    }
    
    .property-info p {
        font-size: 14px;
    }
    
    .property-rating {
        margin: 10px 0 0 0;
        text-align: center;
    }
    
    /* Grid Adjustments */
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .property-grid {
        grid-template-columns: 1fr;
    }
    
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer {
        padding: 30px 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
    }
}

/* Small Tablets / Large Phones (600px and below) */
@media (max-width: 600px) {
    /* Header */
    .search-bar {
        flex-direction: column;
        width: 100%;
    }
    
    .search-bar input {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .search-bar button {
        width: 100%;
    }
    
    .nav-bar ul {
        flex-direction: column;
        width: 100%;
        gap: 5px;
    }
    
    .nav-bar ul li {
        width: 100%;
        text-align: center;
    }
    
    .nav-bar ul li a {
        display: block;
        width: 100%;
        padding: 10px;
    }
    
    .dropdown-content {
        position: static;
        display: block;
        box-shadow: none;
        background: rgba(255,255,255,0.1);
        margin: 5px 0;
    }
    
    /* Content */
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .property, .pg-card, .house-card {
        padding: 10px;
    }
    
    .property img, .pg-card img, .house-card img {
        width: 80px;
        height: 80px;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
}

/* Mobile Phones (480px and below) */
@media (max-width: 480px) {
    /* Header */
    header {
        padding: 10px 15px;
    }
    
    .logo img {
        height: 50px;
    }
    
    /* Content */
    .house-listing, .filter-section, .content-section {
        width: 95%;
        padding: 10px;
        margin: 10px auto;
    }
    
    .banner {
        padding: 10px;
    }
    
    .banner-info {
        padding: 10px;
    }
    
    .banner-info h2 {
        font-size: 18px;
    }
    
    .banner-info p {
        font-size: 14px;
    }
    
    .property-info h3 {
        font-size: 14px;
    }
    
    .property-info p {
        font-size: 12px;
    }
    
    .listing-header h2 {
        font-size: 18px;
    }
    
    /* Forms */
    .filter-group select,
    .filter-group input {
        padding: 8px;
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Extra Small Phones (360px and below) */
@media (max-width: 360px) {
    .logo img {
        height: 40px;
    }
    
    .search-bar input {
        padding: 8px;
        font-size: 14px;
    }
    
    .search-bar button {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .property img, .pg-card img, .house-card img {
        width: 70px;
        height: 70px;
    }
    
    .property-info h3 {
        font-size: 13px;
    }
    
    .property-info p {
        font-size: 11px;
    }
    
    .banner-info h2 {
        font-size: 16px;
    }
    
    .banner-info p {
        font-size: 12px;
    }
}

/* Landscape Orientation on Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .right-section {
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }
    
    .search-bar {
        margin-bottom: 0;
        flex-direction: row;
    }
    
    .nav-bar ul {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Print Styles */
@media print {
    .nav-bar, .search-bar, .auth-buttons {
        display: none;
    }
    
    .house-listing, .filter-section, .content-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Responsive Show/Hide */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }

@media (max-width: 768px) {
    .d-md-none { display: none; }
    .d-md-block { display: block; }
    .d-md-inline { display: inline; }
    .d-md-inline-block { display: inline-block; }
    .d-md-flex { display: flex; }
}

@media (max-width: 480px) {
    .d-sm-none { display: none; }
    .d-sm-block { display: block; }
    .d-sm-inline { display: inline; }
    .d-sm-inline-block { display: inline-block; }
    .d-sm-flex { display: flex; }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1a73e8;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== CRITICAL MOBILE OVERRIDES ==================== */
/* These rules have highest priority to force responsiveness */

/* Force mobile responsive behavior for all screens 768px and below */
@media screen and (max-width: 768px) {
    /* Force header to be responsive */
    html body header .header-container {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
    
    html body header .right-section {
        width: 100% !important;
        align-items: center !important;
        flex-direction: column !important;
    }
    
    html body header .search-bar {
        width: 100% !important;
        flex-direction: row !important;
        justify-content: center !important;
        margin-bottom: 15px !important;
    }
    
    html body header .search-bar input {
        width: 70% !important;
        max-width: 250px !important;
        flex: 1 !important;
        min-width: 150px !important;
    }
    
    html body header .search-bar button {
        width: 25% !important;
        max-width: 80px !important;
        margin-left: 5px !important;
    }
    
    html body header .nav-bar ul {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 5px !important;
        width: 100% !important;
    }
    
    html body header .nav-bar ul li a {
        font-size: 12px !important;
        padding: 5px 8px !important;
    }
    
    /* Force content to be responsive */
    html body .house-listing,
    html body .content-section,
    html body .filter-section {
        width: 95% !important;
        padding: 15px !important;
        margin: 15px auto !important;
    }
    
    html body .property,
    html body .pg-card,
    html body .house-card {
        flex-direction: column !important;
        text-align: center !important;
        padding: 15px !important;
    }
    
    html body .property img,
    html body .pg-card img,
    html body .house-card img {
        width: 100px !important;
        height: 100px !important;
        margin: 0 auto 15px !important;
    }
    
    html body .banner-container {
        width: 95% !important;
    }
}

/* Force mobile responsive behavior for small screens 480px and below */
@media screen and (max-width: 480px) {
    html body header {
        padding: 10px !important;
    }
    
    html body header .logo img {
        height: 50px !important;
    }
    
    html body header .search-bar {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    html body header .search-bar input {
        width: 100% !important;
        margin-bottom: 10px !important;
    }
    
    html body header .search-bar button {
        width: 100% !important;
    }
    
    html body header .nav-bar ul {
        flex-direction: column !important;
        width: 100% !important;
        gap: 5px !important;
    }
    
    html body header .nav-bar ul li {
        width: 100% !important;
        text-align: center !important;
    }
    
    html body header .nav-bar ul li a {
        display: block !important;
        width: 100% !important;
        padding: 10px !important;
        text-align: center !important;
    }
    
    html body .house-listing,
    html body .content-section,
    html body .filter-section {
        width: 95% !important;
        padding: 10px !important;
    }
    
    html body .property img,
    html body .pg-card img,
    html body .house-card img {
        width: 80px !important;
        height: 80px !important;
    }
    
    html body .banner {
        padding: 10px !important;
    }
    
    html body .banner-info {
        padding: 10px !important;
    }
    
    html body .banner-info h2 {
        font-size: 16px !important;
    }
    
    html body .banner-info p {
        font-size: 12px !important;
    }
}

/* Ultra-high priority overrides for very small screens */
@media screen and (max-width: 360px) {
    html body header .logo img {
        height: 40px !important;
    }
    
    html body .property img,
    html body .pg-card img,
    html body .house-card img {
        width: 70px !important;
        height: 70px !important;
    }
}
/* === Global header alignment (applies to all pages) === */

header {
    background-color: #0b3a7e;
    color: white;
}

/* Flex container for header */
.header-container {
    display: flex;
    justify-content: space-between;   /* Logo left, nav/search right */
    align-items: flex-start;              /* ✅ vertical centering */
    height: 72px;                     /* consistent height */
}
header .logo {
                display: flex;
                justify-content: center;   /* Center horizontally */
                align-items: center;       /* Center vertically */
                height: 100%;
            }

            .header-container {
                display: flex;
                align-items: center;       /* Ensures vertical centering of ALL header items */
            }
/* === GLOBAL NAVIGATION (DESKTOP) === */
.main-nav ul {
    display: flex;
    justify-content: flex-end;     /* Right align nav links */
    gap: 22px;                     /* Even spacing between links */
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.main-nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.main-nav ul li a:hover {
    text-decoration: underline;
}


/* Logo wrapper */
