/* LandDiscounter Custom Styles */
:root {
    --dark-green: #2F3E2F;
    --light-green: #7CA66B;
    --orange: #FFA94D;
    --off-white: #FAF7F1;
    --white: #FFFFFF;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background-color: var(--off-white);
    color: var(--dark-green);
    line-height: 1.6;
    /* Responsive typography using clamp() */
    font-size: clamp(0.875rem, 2.5vw, 1.125rem);
}

/* Header and Navigation */
.navbar {
    background-color: var(--dark-green) !important;
    padding: 1rem 0;
    min-height: 160px;
    align-items: center;
    /* Ensure navbar doesn't cover content */
    position: relative;
    z-index: 1050;
}

/* Mobile Navigation Optimizations */
.navbar-toggler {
    padding: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 165, 0, 0.25);
}

.navbar-collapse {
    margin-top: 1rem;
}

/* Mobile-first navigation spacing */
.navbar-nav .nav-item {
    margin: 0.25rem 0;
}

/* Fix dropdown menu positioning and z-index */
.navbar .dropdown-menu {
    z-index: 1060 !important;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Add spacing to main content to prevent overlap */
main {
    padding-top: 20px;
}

/* Ensure alert container has proper spacing */
#alertContainer {
    margin-top: 20px !important;
}

.thin-header {
    padding: 0.5rem 0 !important;
    min-height: 160px !important;
}

.logo-img {
    /* Responsive logo sizing */
    height: clamp(80px, 15vw, 140px);
    width: auto;
    margin-right: 0.5rem;
    object-fit: contain;
    background: transparent;
    border-radius: 8px;
}

.navbar-brand {
    color: var(--white) !important;
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-brand .brand-text {
    display: none;
}

.navbar-brand.show-text .brand-text {
    display: inline;
}

.navbar-nav .nav-link {
    color: var(--off-white) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--orange) !important;
}

.btn-primary {
    background-color: var(--light-green);
    border-color: var(--light-green);
    color: var(--white);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--dark-green);
    border-color: var(--dark-green);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--orange);
    border-color: var(--orange);
    color: var(--white);
    font-weight: 600;
}

/* Form select styling for better visibility */
.form-select {
    min-width: 120px;
    white-space: nowrap;
}

.form-select option {
    padding: 0.5rem;
    white-space: nowrap;
}

.btn-secondary:hover {
    background-color: #e6934a;
    border-color: #e6934a;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--dark-green) 0%, var(--light-green) 100%);
    color: var(--white);
    padding: 4rem 0;
    margin-bottom: 3rem;
}

.hero-content h1 {
    /* Responsive font sizing: 1.75rem on mobile, scales to 3rem on desktop */
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: bold;
    margin-bottom: 1rem;
}

.hero-content p {
    /* Responsive paragraph sizing */
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-bottom: 2rem;
}

/* Gradient Header Styles for Overpayment Calculator */
.gradient-header-blue {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 50%, #003d82 100%);
    border: none;
    position: relative;
    overflow: hidden;
}

.gradient-header-blue::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.gradient-header-blue:hover::before {
    left: 100%;
}

.gradient-header-teal {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 50%, #0f6674 100%);
    border: none;
    position: relative;
    overflow: hidden;
}

.gradient-header-teal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.gradient-header-teal:hover::before {
    left: 100%;
}

.gradient-header-green {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 50%, #155724 100%);
    border: none;
    position: relative;
    overflow: hidden;
}

.gradient-header-green::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.gradient-header-green:hover::before {
    left: 100%;
}

.gradient-header-blue h5,
.gradient-header-blue h6,
.gradient-header-teal h5,
.gradient-header-teal h6,
.gradient-header-green h5,
.gradient-header-green h6 {
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.gradient-header-blue i,
.gradient-header-teal i,
.gradient-header-green i {
    position: relative;
    z-index: 1;
    margin-right: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Search Section */
.search-section {
    background-color: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-top: -2rem;
    position: relative;
    z-index: 10;
}

.search-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: end;
}

.search-filters .form-group {
    flex: 1;
    min-width: 200px;
}

/* Property Cards */
.property-card {
    background-color: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 2rem;
    height: 100%;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.property-image {
    height: 250px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.property-image .property-price {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--light-green);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1rem;
    z-index: 10;
}

.financing-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--orange);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 3;
}

.property-details {
    padding: 1.5rem;
}

.property-title {
    /* Responsive property title */
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    font-weight: bold;
    color: var(--dark-green);
    margin-bottom: 0.5rem;
}

.property-address {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.property-specs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.spec-item {
    text-align: center;
}

.spec-value {
    font-weight: bold;
    color: var(--dark-green);
    display: block;
}

.spec-label {
    font-size: 0.8rem;
    color: #666;
}

/* Property Detail Page */
.property-detail-hero {
    background-color: var(--dark-green);
    color: var(--white);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.image-gallery {
    margin-bottom: 2rem;
}

.main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 1rem;
}

.thumbnail-images {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.thumbnail:hover, .thumbnail.active {
    opacity: 1;
}

/* Dashboard */
.dashboard-card {
    background-color: var(--white);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.dashboard-stat {
    text-align: center;
    padding: 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--light-green);
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* Payment Due Cards */
.payment-due-card {
    transition: transform 0.2s, box-shadow 0.2s;
    background: white;
}

.payment-due-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.bg-light-danger {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

.bg-light-warning {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

/* Amortization Table */
.amortization-table {
    overflow-x: auto;
}

.amortization-table table {
    width: 100%;
    min-width: 600px;
}

.amortization-table th {
    background-color: var(--light-green);
    color: var(--white);
}

.amortization-table td, .amortization-table th {
    padding: 0.75rem;
    text-align: right;
}

/* Forms */
.form-container {
    background-color: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: var(--light-green);
    box-shadow: 0 0 0 0.2rem rgba(124, 166, 107, 0.25);
}

/* Signature Pad */
.signature-container {
    border: 2px solid var(--light-green);
    border-radius: 8px;
    margin: 1rem 0;
}

.signature-pad {
    width: 100%;
    height: 200px;
    border: none;
    border-radius: 6px;
}

.signature-controls {
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

/* Payment Section */
.payment-summary {
    background-color: var(--light-green);
    color: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
}

.payment-amount {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.payment-breakdown {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* PayPal Button Container */
.paypal-container {
    max-width: 400px;
    margin: 2rem auto;
}

/* Admin Panel */
.admin-sidebar {
    background-color: var(--dark-green);
    color: #ffffff !important;
    padding: 1rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    z-index: 100;
    width: 100%;
    max-width: 250px;
}

/* Ensure all text within admin sidebar is white */
.admin-sidebar h3,
.admin-sidebar h4,
.admin-sidebar p,
.admin-sidebar span,
.admin-sidebar a,
.admin-sidebar li {
    color: #ffffff !important;
}

/* Admin layout container to prevent overlap */
.admin-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.admin-content {
    flex: 1;
    min-width: 0;
}

/* Responsive admin layout */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        position: static;
        max-width: none;
        width: 100%;
        margin-bottom: 1rem;
    }
}

.admin-sidebar .nav-link {
    color: #ffffff !important;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: background-color 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: var(--light-green);
    color: var(--white);
}

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

.admin-stat-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #cce7ff;
    color: #004085;
}

/* Footer */
.footer {
    background-color: var(--dark-green);
    color: var(--white);
    padding: 2rem 0;
    margin-top: 3rem;
}

.thin-footer {
    padding: 1rem 0 !important;
    font-size: 0.9rem;
}

.footer-logo {
    height: 60px;
    width: auto;
    margin-right: 0.5rem;
    object-fit: contain;
    background: transparent;
    border-radius: 4px;
}

.footer a {
    color: var(--orange);
    text-decoration: none;
}

.footer a:hover {
    color: var(--off-white);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .search-filters {
        flex-direction: column;
    }

    .search-filters .form-group {
        min-width: 100%;
    }

    .property-specs {
        flex-direction: column;
        gap: 1rem;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .main-image {
        height: 250px;
    }

    .benefits-columns {
        flex-direction: column;
        gap: 1rem;
    }

    /* Footer mobile responsiveness */
    .footer {
        text-align: center !important;
    }

    .footer .row {
        text-align: center !important;
    }

    .footer .col-md-4 {
        margin-bottom: 1.5rem;
        text-align: center !important;
    }

    .footer .col-md-4:last-child {
        margin-bottom: 0;
    }

    .contact-columns {
        flex-direction: column;
        gap: 1.5rem;
        justify-content: center;
        text-align: center !important;
        align-items: center;
    }

    .contact-column {
        text-align: center !important;
        align-items: center;
    }

    .contact-title,
    .contact-person,
    .contact-details {
        text-align: center !important;
    }

    .footer-logo {
        display: block;
        margin: 0 auto 0.5rem auto;
    }

    .benefits-column {
        min-width: 100%;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 2rem 0;
    }

    .search-section {
        margin-top: -1rem;
        padding: 1rem;
    }

    .property-card .property-details {
        padding: 1rem;
    }

    .form-container {
        padding: 1rem;
    }

    /* Footer mobile enhancements for small screens */
    .footer {
        padding: 1.5rem 0;
    }

    .footer .col-md-4 {
        margin-bottom: 1.5rem;
    }

    .contact-details {
        font-size: 0.85rem;
        line-height: 1.4;
        word-break: break-word;
    }

    .contact-person {
        font-size: 0.9rem;
    }

    .contact-title {
        font-size: 0.85rem;
    }

    /* Increase touch targets for mobile */
    .footer a {
        padding: 0.25rem 0.5rem;
        display: inline-block;
    }

    /* Better logo sizing on mobile */
    .footer-logo {
        height: 50px;
        margin-bottom: 0.75rem;
    }

    /* Navbar improvements for mobile */
    .logo-img {
        height: 80px;
    }

    /* Better button sizing for touch */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--off-white);
}

::-webkit-scrollbar-thumb {
    background: var(--light-green);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-green);
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--off-white);
    border-top: 3px solid var(--light-green);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Map Integration */
.map-container {
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    margin: 1rem 0;
    width: 100%;
}

/* Property Detail Page Map Section */
.property-detail .map-section {
    width: 100%;
    margin-bottom: 2rem;
}

.property-detail .map-section .map-container {
    width: 100%;
    max-width: none;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Status Badges */
.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-available {
    background-color: var(--light-green);
    color: var(--white);
}

.status-sold {
    background-color: var(--orange);
    color: var(--white);
}

.status-under_contract {
    background-color: #ffc107;
    color: #212529;
}

.status-archived {
    background-color: #6c757d;
    color: var(--white);
}

/* Payment Status Icons */
.payment-status-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 24px;
    color: white;
    font-weight: bold;
}

.status-completed {
    background-color: #28a745;
    color: white;
}

.status-pending {
    background-color: #dc3545;
    color: white;
}

.status-inactive {
    background-color: #6c757d;
    color: white;
}

.payment-step {
    text-align: center;
    padding: 20px;
    margin: 10px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.payment-step.completed {
    border-color: #28a745;
    background-color: #f8fff9;
}

.payment-step.pending {
    border-color: #dc3545;
    background-color: #fff8f8;
}

.payment-step.inactive {
    border-color: #6c757d;
    background-color: #f8f9fa;
}

/* Homepage Layout */
.homepage-container {
    display: flex;
    background-color: var(--off-white);
}

.map-section {
    width: 60%;
    position: relative;
    background-color: transparent;
    display: flex;
    flex-direction: column;
}

.interactive-map {
    width: 100%;
    height: 500px;
    position: relative;
}

/* How It Works Under Map */
.how-it-works-under-map {
    background-color: var(--light-green);
    padding: 1.5rem;
    color: white;
}

.how-it-works-under-map h5 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.steps-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 1rem;
}

.step-item {
    flex: 1;
    color: white;
}

.step-item h6 {
    color: white;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.step-item p {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.9;
    line-height: 1.4;
}

.step-icon i {
    color: var(--orange);
}

/* Purchase Options Under Map */
.purchase-options-under-map {
    background-color: var(--dark-green);
    padding: 1.5rem;
    border-top: 2px solid var(--orange);
}

.purchase-options-under-map h5 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.purchase-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 0.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.purchase-option {
    flex: 1;
    text-align: left;
}

.option-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.option-header i {
    background: linear-gradient(135deg, #FFD700, #FFA500, #FFD700, #B8860B);
    background-size: 200% 200%;
    animation: goldShimmer 3s ease-in-out infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.5));
}

.option-header h6 {
    color: white;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.option-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem 0;
    text-align: left;
}

.option-list li {
    color: var(--off-white);
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
}

.option-list i {
    background: linear-gradient(135deg, #FFD700, #FFA500, #FFD700, #B8860B);
    background-size: 200% 200%;
    animation: goldShimmer 3s ease-in-out infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.5));
    font-size: 1rem;
    min-width: 14px;
}

.option-desc {
    color: var(--off-white);
    font-size: 1rem;
    margin: 0;
    opacity: 0.9;
    font-style: italic;
    text-align: left;
    line-height: 1.4;
}

.contact-info {
    border-top: 1px solid var(--light-green);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.contact-info p {
    color: var(--off-white);
    font-size: 0.8rem;
}

/* Gold foil shimmer animation */
@keyframes goldShimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Why Choose Section on Left */
.why-choose-section {
    background-color: var(--light-green);
    padding: 1rem;
    border-top: 2px solid var(--orange);
}

/* Benefits columns styling */
.benefits-columns {
    display: flex;
    gap: 2rem;
    justify-content: space-between;
}

.benefits-column {
    flex: 1;
    min-width: 250px;
}

.benefits-list-left {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--white);
}

.benefits-list-left li {
    margin-bottom: 0.8rem;
    padding-left: 0;
    display: flex;
    align-items: center;
    color: white;
    font-size: 0.9rem;
}

.benefits-list-left i {
    color: var(--orange);
    margin-right: 0.75rem;
    font-size: 1rem;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FF8C00);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

/* Map Popup Styling */
.popup-price {
    color: var(--dark-green) !important;
    font-size: 1.1rem;
}

.property-marker-popup .leaflet-popup-content-wrapper {
    background-color: white;
    color: #333;
}

/* Footer Contact Styling */
.contact-columns {
    display: flex;
    gap: 2rem;
    justify-content: flex-end;
    text-align: right;
}

.contact-column {
    display: flex;
    flex-direction: column;
}

.contact-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.1rem;
}

.contact-person {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.2rem;
}

.contact-details {
    font-size: 0.75rem;
    line-height: 1.1;
    opacity: 0.9;
}

.interactive-map iframe {
    width: 100%;
    height: 100%;
    border: none;
}



.search-card {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    color: var(--dark-green);
}

.search-card-full-width {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    margin: 0;
    width: 100%;
    color: var(--dark-green);
    border-radius: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.search-card h4 {
    color: var(--dark-green);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.search-form-below-map .form-control {
    padding: 0.75rem;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    font-size: 1rem;
}

.search-form-below-map .form-control-lg {
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.search-form-below-map .form-control:focus {
    border-color: var(--light-green);
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
}

/* Permanent alerts that shouldn't auto-hide */
.alert-permanent {
    position: relative;
    z-index: 1;
}

/* Ensure info alerts stay visible and are properly styled */
.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
    border-radius: 8px;
    margin: 1rem 0;
    padding: 1rem;
}

.search-form-below-map .btn {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
}

/* Stats panel below map */
.stats-panel-below-map {
    background-color: var(--dark-green);
    color: var(--white);
    border-top: 3px solid var(--light-green);
}

.stats-panel-below-map .stats-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    align-items: center;
}

.stats-panel-below-map .stat-item {
    text-align: center;
    min-width: 80px;
}

.stats-panel-below-map .stat-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--orange);
    display: block;
    line-height: 1.2;
}

.stats-panel-below-map .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.2rem;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .homepage-container {
        flex-direction: column;
    }

    .map-section {
        width: 100%;
        min-height: 50vh;
    }

    .listings-section {
        width: 100%;
    }



    .stats-panel-below-map .stats-row {
        gap: 1rem;
    }

    .stats-panel-below-map .stat-number {
        font-size: 1.5rem;
    }
}

.listings-section {
    width: 40%;
    background-color: var(--white);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.listings-header {
    padding: 1.5rem;
    background-color: var(--light-green);
    color: var(--white);
    text-align: center;
}

.listings-header h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.listings-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.property-list {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.property-listing-card {
    display: flex;
    background-color: var(--white);
    border: 1px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.property-listing-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.property-image-thumb {
    width: 100px;
    height: 100px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.property-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.property-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.property-header .property-price {
    position: relative;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--dark-green);
}

.financing-available {
    background-color: var(--orange);
    color: var(--white);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.property-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-green);
    margin-bottom: 0.3rem;
}

.property-location {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
}

.property-apn {
    color: #555;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.property-apn i {
    color: var(--orange);
    margin-right: 4px;
}

/* List view specific styling */
.property-list-details .property-apn {
    color: #555;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.property-list-details .property-apn i {
    color: var(--orange);
    margin-right: 6px;
}

/* Similar Properties Styling */
.similar-properties .similar-property-item {
    border-radius: 8px;
    transition: all 0.2s ease;
}

.similar-properties .similar-property-item:hover {
    background-color: #f8f9fa;
    padding: 0.5rem;
    margin: -0.5rem;
}

.similar-property-image {
    border: 1px solid #e0e0e0;
}

.similar-property-details h6 a {
    color: var(--dark-green);
    font-weight: 600;
}

.similar-property-details h6 a:hover {
    color: var(--orange);
    text-decoration: underline !important;
}

.property-specs-similar {
    line-height: 1.4;
}

/* Payment Schedule Styling */
.payment-schedule .summary-item {
    margin-bottom: 0.5rem;
}

.payment-schedule .summary-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--light-green);
}

.payment-schedule .summary-label {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Contact Information Styling */
.contact-info .contact-details {
    font-size: 0.9rem;
}

.contact-info a {
    color: var(--dark-green);
    text-decoration: none;
}

.contact-info a:hover {
    color: var(--orange);
    text-decoration: underline;
}

/* Ensure Purchase Options are visible */
.action-buttons.dashboard-card {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
}

.property-details-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.property-details-row span {
    flex: 1;
    text-align: center;
    white-space: nowrap;
    font-size: 0.75rem;
}

.property-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.property-actions .btn-sm {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

.view-all-section {
    padding: 1rem;
    background-color: #f8f9fa;
}

.info-panel {
    background-color: var(--off-white);
    padding: 1.5rem;
    border-top: 3px solid var(--light-green);
}

.info-panel h4 {
    color: var(--dark-green);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.info-panel .benefits-list {
    list-style: none;
    padding: 0;
    margin-bottom: 1rem;
}

.info-panel .benefits-list li {
    padding: 0.3rem 0;
    font-size: 0.9rem;
    color: var(--dark-green);
}

.info-panel .benefits-list i {
    color: var(--light-green);
    margin-right: 0.5rem;
}

/* Map Popups */
.property-marker-popup .leaflet-popup-content {
    margin: 8px 12px;
    line-height: 1.4;
}

.property-popup {
    font-family: inherit;
}

.property-popup h6 {
    color: var(--dark-green);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.property-popup p {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.property-popup .btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .homepage-container {
        flex-direction: column;
        min-height: auto;
    }

    .map-section {
        width: 100%;
        height: 400px;
    }

    .listings-section {
        width: 100%;
    }

    .stats-panel {
        position: relative;
        bottom: auto;
        right: auto;
        margin: 1rem;
        justify-content: space-around;
    }

    .compact-search .search-row {
        flex-direction: column;
    }

    .compact-search .form-control {
        min-width: 100%;
        margin-bottom: 0.5rem;
    }

    .property-listing-card {
        flex-direction: column;
    }

    .property-image-thumb {
        width: 100%;
        height: 150px;
    }
}

/* Utility Classes */
.text-dark-green { color: var(--dark-green) !important; }
.text-light-green { color: var(--light-green) !important; }
.text-orange { color: var(--orange) !important; }
.bg-dark-green { background-color: var(--dark-green) !important; }
.bg-light-green { background-color: var(--light-green) !important; }
.bg-orange { background-color: var(--orange) !important; }
.bg-off-white { background-color: var(--off-white) !important; }

.shadow-custom {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1) !important;
}

.border-radius-custom {
    border-radius: 15px !important;
}

/* Enhanced Checkbox Styling for Better Visibility */
.form-check-input {
    width: 1.3em;
    height: 1.3em;
    margin-top: 0.1em;
    border: 2px solid #6c757d;
    background-color: white;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--light-green);
    border-color: var(--light-green);
    box-shadow: 0 0 0 0.2rem rgba(124, 166, 107, 0.25);
}

.form-check-input:focus {
    border-color: var(--light-green);
    box-shadow: 0 0 0 0.25rem rgba(124, 166, 107, 0.25);
}

.form-check-input:hover {
    border-color: var(--light-green);
    transform: scale(1.05);
}

.form-check-label {
    margin-left: 0.5rem;
    line-height: 1.4;
    cursor: pointer;
    font-weight: 500;
    color: var(--dark-green);
}

/* Make checkbox containers more prominent */
.form-check {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.form-check:hover {
    background-color: rgba(124, 166, 107, 0.05);
}

/* Special styling for required checkboxes (like terms agreement) */
.form-check input[type="checkbox"][required] {
    border: 2px solid var(--orange);
    border-radius: 4px;
    box-shadow: 0 0 0 0.1rem rgba(255, 169, 77, 0.15);
}

.form-check input[type="checkbox"][required]:checked {
    background-color: var(--orange);
    border-color: var(--orange);
    box-shadow: 0 0 0 0.25rem rgba(255, 169, 77, 0.25);
}

.form-check input[type="checkbox"][required]:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 0.25rem rgba(255, 169, 77, 0.25);
}

/* Fix for title insurance checkbox overlapping border */
.form-check {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

/* Special handling for checkboxes within bordered containers */
.border.rounded .form-check {
    padding: 0.25rem 0.5rem; /* Reduced vertical padding to prevent border overlap */
    margin-bottom: 0.5rem;
}

/* Ensure checkbox input has proper spacing from border */
.border.rounded .form-check-input {
    margin-top: 0.05em; /* Reduced top margin to prevent overlap */
    margin-right: 0.5rem;
}

/* Larger checkboxes for important forms */
.form-check.important-checkbox input[type="checkbox"] {
    width: 1.5em;
    height: 1.5em;
    border-width: 3px;
}

.form-check.important-checkbox .form-check-label {
    font-size: 1.1rem;
    font-weight: 600;
    margin-left: 0.7rem;
}

/* Deed Alert Card Styling */
.deed-alert-card {
    position: relative;
    overflow: hidden;
}

.deed-alert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 193, 7, 0.1), rgba(255, 169, 77, 0.1));
    pointer-events: none;
}

.deed-alert-card .stat-content {
    position: relative;
    z-index: 1;
}

.deed-alert-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.2);
    transition: all 0.3s ease;
}

.deed-alert-card .text-warning a {
    text-decoration: none;
    font-weight: 600;
}

.deed-alert-card .text-warning a:hover {
    text-decoration: underline;
}

/* Bundle Tags and Badges */
.bundle-tag {
    background-color: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 4px;
}

.bundle-badge {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 5;
}

.bundle-info-card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    border-left: 4px solid #28a745;
}

.status-badge.status-bundle {
    background-color: #28a745;
    color: white;
    border: 1px solid #28a745;
}

.status-badge.status-bundle:hover {
    background-color: #218838;
    border-color: #218838;
}

/* // Special case for payment schedule page - for proper display */
/* We need to embed the fonts directly into the CSS */
@font-face {
    font-family: 'Roboto Mono';
    src: url('/fonts/RobotoMono-Regular.woff2') format('woff2'),
         url('/fonts/RobotoMono-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Roboto Mono';
    src: url('/fonts/RobotoMono-Bold.woff2') format('woff2'),
         url('/fonts/RobotoMono-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

/* Enhanced Overpayment Calculator Styles */
.overpayment-impact {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border: none !important;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.overpayment-impact .card {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.overpayment-impact .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.overpayment-impact .metric-box {
    border: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
}

.overpayment-impact .metric-box:hover {
    background-color: #fff !important;
}

.overpayment-impact .comparison-details {
    font-size: 0.9rem;
}

.overpayment-impact .btn-group {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.overpayment-impact .btn-group .btn {
    padding: 10px 20px;
    font-weight: 600;
}

.overpayment-impact .payment-button-section .btn {
    box-shadow: 0 3px 15px rgba(255, 193, 7, 0.3);
    transition: all 0.3s ease;
}

.overpayment-impact .payment-button-section .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 20px rgba(255, 193, 7, 0.4);
}

.overpayment-impact .option-card-clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.overpayment-impact .option-card-clickable:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.overpayment-impact .option-card-clickable.selected {
    transform: scale(1.02);
    border-width: 3px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

/* Math breakdown modal styling */
.math-breakdown .step {
    position: relative;
}

.math-breakdown .calculation-box {
    border-left: 4px solid #dee2e6;
    transition: border-color 0.3s ease;
}

.math-breakdown .calculation-box:hover {
    border-left-color: #007bff;
}

.math-breakdown .step h6 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.math-breakdown .badge {
    font-size: 0.8rem;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.math-breakdown .step-by-step {
    position: relative;
}

.math-breakdown .step-by-step::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 30px;
    bottom: 30px;
    width: 2px;
    background: linear-gradient(to bottom, #28a745, #17a2b8);
    z-index: 0;
}

.math-breakdown .step {
    position: relative;
    z-index: 1;
}

/* Help button styling */
.card-header .btn-outline-light {
    border: 1px solid rgba(255,255,255,0.5);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.card-header .btn-outline-light:hover {
    background-color: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.8);
}

/* Modal responsive design */
@media (max-width: 768px) {
    .modal-xl {
        margin: 0.5rem;
    }

    .math-breakdown .step-by-step::before {
        display: none;
    }
}

/* Option cards styling */
.option-card-clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-card-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.option-card-clickable.selected {
    border-width: 2px;
    box-shadow: 0 0 10px rgba(0,123,255,0.3);
}

/* Payment Slider Styles */
.payment-slider-container {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 15px;
    border: 2px solid #007bff;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.15);
}

.payment-amount-display {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-radius: 20px;
    padding: 2rem;
    border: 3px solid #ffffff;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    color: white;
    text-align: center;
}

.payment-amount-display h3 {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-weight: bold;
    font-size: 2.5rem;
}

.payment-amount-display p {
    color: rgba(255,255,255,0.9) !important;
    font-size: 1.1rem;
    font-weight: 500;
}

.slider-wrapper {
    position: relative;
    padding: 1rem 15px;
    background: rgba(0, 123, 255, 0.05);
    border-radius: 10px;
    margin: 1rem 0;
}

.payment-slider {
    width: 100%;
    height: 12px;
    border-radius: 8px;
    background: linear-gradient(to right, #6c757d 0%, #ffc107 30%, #28a745 100%);
    outline: none;
    opacity: 0.9;
    transition: all 0.3s ease;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.payment-slider:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.payment-slider::-webkit-slider-thumb {
    appearance: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: 4px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.6);
}

.payment-slider::-moz-range-thumb {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: 4px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.6);
}

.slider-labels {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    padding: 0.5rem 0;
}

.slider-labels span {
    background: rgba(255,255,255,0.9);
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.slider-markers {
    position: relative;
    height: 40px;
    margin-top: 0.5rem;
}

/* Threshold marker styles removed for cleaner interface */

.impact-display .metric-box {
    transition: all 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.impact-display .metric-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.impact-display .alert {
    border-radius: 12px;
    border-width: 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Enhanced slider track for better visibility */
.payment-slider::-webkit-slider-track {
    background: linear-gradient(to right, #6c757d 0%, #ffc107 30%, #28a745 100%);
    height: 12px;
    border-radius: 8px;
}

.payment-slider::-moz-range-track {
    background: linear-gradient(to right, #6c757d 0%, #ffc107 30%, #28a745 100%);
    height: 12px;
    border-radius: 8px;
    border: none;
}

/* Print styles for payment schedule */
@media print {
    /* Hide interactive elements that aren't useful when printed */
    .payment-slider-container,
    .btn,
    .navbar,
    .footer,
    .alert,
    .tooltip,
    .modal,
    .dropdown {
        display: none !important;
    }
    
    /* Nuclear option - override everything with universal selector */
    *, *::before, *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Ensure payment schedule table displays properly */
    .amortization-table {
        overflow: visible !important;
        page-break-inside: avoid;
    }
    
    .amortization-table table {
        width: 100% !important;
        min-width: auto !important;
        font-size: 10px !important;
        border-collapse: collapse !important;
    }
    
    .amortization-table th {
        background-color: #2E7D3A !important;
        color: white !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        padding: 0.4rem !important;
        font-size: 9px !important;
        font-weight: bold !important;
    }
    
    .amortization-table td {
        padding: 0.3rem !important;
        font-size: 8px !important;
        border: 1px solid #ccc !important;
        text-align: right !important;
    }
    
    /* Payment schedule cards - make them print-friendly */
    .month-card {
        page-break-inside: avoid;
        margin-bottom: 0.2rem !important;
        padding: 0.3rem !important;
        border: 1px solid #ccc !important;
        background: white !important;
    }
    
    .month-card .badge {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Ensure contract summary table prints well */
    .contract-summary-table {
        page-break-inside: avoid;
        margin-bottom: 1rem !important;
    }
    
    .contract-summary-table table {
        width: 100% !important;
        border-collapse: collapse !important;
    }
    
    .contract-summary-table th,
    .contract-summary-table td {
        border: 1px solid #ccc !important;
        padding: 0.4rem !important;
        font-size: 10px !important;
    }
    
    /* Force colors to print */
    .bg-success {
        background-color: #28a745 !important;
        color: white !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .bg-warning {
        background-color: #ffc107 !important;
        color: black !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .bg-primary {
        background-color: #007bff !important;
        color: white !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* NUCLEAR PRINT OPTION - Force 7 columns with all: unset */
    .container, .container-fluid { 
        max-width: 100% !important; 
        width: 100% !important; 
    }

    /* make the wrapper a clean flex grid */
    #paymentSchedulePrint {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        margin: 0 !important;
    }

    /* flatten any nested rows that could break the math */
    #paymentSchedulePrint .row { 
        display: contents !important; 
    }

    /* HARD override: neutralize Bootstrap's col-* in this subtree */
    #paymentSchedulePrint .month-cell,
    #paymentSchedulePrint [class^="col-"],
    #paymentSchedulePrint [class*=" col-"],
    #paymentSchedulePrint .col {
        all: unset !important;               /* wipe inherited Bootstrap props */
        box-sizing: border-box !important;
        display: block !important;
        padding: 2px !important;
        width: calc(100% / 7) !important;
        max-width: calc(100% / 7) !important;
        flex: 0 0 calc(100% / 7) !important;
    }

    /* in case cards/cells had min-widths */
    #paymentSchedulePrint .month-cell * { 
        min-width: 0 !important; 
    }

    /* optional page setup */
    @page { 
        size: letter landscape; 
        margin: 8mm; 
    }
    
    /* Force all month cards to 7 columns regardless of class */
    .month-card {
        width: 14.285% !important;
        max-width: 14.285% !important;
        flex: 0 0 14.285% !important;
        float: left !important;
        display: block !important;
        box-sizing: border-box !important;
        margin: 0.1rem 0 !important;
        padding: 0.2rem !important;
        font-size: 9px !important;
    }
    
    .month-card .badge {
        font-size: 8px !important;
        padding: 0.2rem 0.3rem !important;
    }
    
    .month-card small {
        font-size: 7px !important;
    }
    
    /* Page title and headers */
    h1, h2, h3 {
        page-break-after: avoid;
        color: black !important;
    }
    
    /* Prevent orphaned content */
    p, div {
        orphans: 3;
        widows: 3;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .payment-amount-display {
        padding: 1.5rem;
    }

    .payment-amount-display h3 {
        font-size: 2rem;
    }

    .payment-slider {
        height: 10px;
    }

    .payment-slider::-webkit-slider-thumb {
        width: 30px;
        height: 30px;
    }

    .payment-slider::-moz-range-thumb {
        width: 30px;
        height: 30px;
    }

    .slider-labels {
        font-size: 0.8rem;
    }

    .threshold-marker {
        font-size: 0.7rem;
        padding: 0.2rem 0.3rem;
    }

    .payment-slider-container {
        padding: 1rem;
    }
}

/* ===== PDF VISUAL EDITOR OVERLAY STYLES ===== */
/* Critical z-index layering to fix overlay disappearing issue */

.pdf-container {
    position: relative;
    z-index: 1;
}

.overlay-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allow clicks through to PDF, overlays handle their own events */
    z-index: 9999 !important; /* Above PDF.js canvas */
}

.field-overlay {
    position: absolute;
    pointer-events: auto !important; /* Enable interaction */
    z-index: 1100 !important; /* Above overlay layer */
    border: 2px solid rgba(255, 0, 0, 0.7);
    background: rgba(255, 0, 0, 0.1);
    cursor: grab;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
}

.field-overlay:hover {
    border-color: #0080ff !important;
    box-shadow: 0 0 20px rgba(0, 128, 255, 0.8) !important;
    transform: scale(1.02) !important;
}

.field-overlay.selected {
    border-color: #0080ff !important;
    background: rgba(0, 128, 255, 0.2) !important;
    box-shadow: 0 0 16px rgba(0, 128, 255, 1.0) !important;
}

.selection-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Transparent layer for handles */
    z-index: 1500 !important; /* Above overlays */
}

.resize-handle {
    position: absolute;
    pointer-events: auto !important;
    z-index: 1600 !important; /* Highest - above everything */
    background: #0080ff;
    border: 2px solid #ffffff;
    border-radius: 2px;
    box-sizing: border-box;
    transition: all 0.15s ease;
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.resize-handle:hover {
    background: #0066cc !important;
    transform: scale(1.3) !important;
    box-shadow: 0 0 8px rgba(0, 128, 255, 0.8) !important;
    border-width: 3px !important;
}

/* Drag area and indicators */
.drag-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
    pointer-events: auto;
    z-index: 1200; /* Above field overlay, below handles */
    border: 0px solid transparent; /* Increase hit area */
}

.drag-area:active {
    cursor: grabbing !important;
}

.drag-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    pointer-events: none;
    z-index: 1201;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 14px;
}

.field-overlay:hover .drag-indicator {
    opacity: 1 !important;
}

/* Field labels */
.field-label {
    position: absolute;
    top: -22px;
    left: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1250;
    font-family: 'Inter', sans-serif;
}

/* Ensure PDF.js canvas doesn't interfere */
.pdf-page-canvas {
    z-index: 0 !important;
    position: relative;
}

/* =============================
   COMPREHENSIVE RESPONSIVE DESIGN
   Mobile-First Approach
   ============================= */

/* Extra Small Devices (Portrait Phones) - up to 575px */
@media (max-width: 575.98px) {
    .navbar {
        min-height: 120px;
        padding: 0.75rem 0;
    }
    
    .hero-section {
        padding: 2rem 0;
        text-align: center;
    }
    
    .search-section {
        padding: 1rem;
        margin-top: -1rem;
    }
    
    .search-filters {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .search-filters .form-group {
        min-width: 100%;
    }
    
    .property-image {
        height: 200px;
    }
    
    .property-details {
        padding: 1rem;
    }
    
    .property-specs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .spec-item {
        text-align: left;
        border-bottom: 1px solid #eee;
        padding-bottom: 0.5rem;
    }
    
    .spec-item:last-child {
        border-bottom: none;
    }
}

/* Small Devices (Landscape Phones) - 576px to 767px */
@media (min-width: 576px) and (max-width: 767.98px) {
    .navbar {
        min-height: 140px;
    }
    
    .search-filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .search-filters .form-group:last-child {
        grid-column: 1 / -1;
    }
    
    .property-specs {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .spec-item {
        flex: 1;
        min-width: calc(50% - 0.375rem);
    }
}

/* Medium Devices (Tablets) - 768px to 991px */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .search-filters {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .search-filters .form-group:nth-last-child(-n+2) {
        grid-column: span 1;
    }
    
    .property-image {
        height: 220px;
    }
}

/* Large Devices (Desktops) - 992px to 1199px */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    .property-image {
        height: 240px;
    }
}

/* Extra Large Devices (Large Desktops) - 1200px and up */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .hero-content h1 {
        font-size: 3.5rem;
    }
    
    .property-image {
        height: 280px;
    }
}