:root {
    /* JUMAPA Pantone Colors */
    --burgundy: #691B31;
    /* Pantone 7421 C (Primary Text/Headers) */
    --red-brand: #A02142;
    /* Pantone 7420 C (Primary Buttons/Accents) */
    --gold: #BC955B;
    /* Pantone 465 C (Secondary Accent) */
    --beige: #DDC9A3;
    /* Pantone 468 C (Subtle Backgrounds) */
    --gray-dark: #6F7271;
    /* Pantone 424 C (Body Text) */
    --gray-med: #98989A;
    /* Pantone Cool Gray 7 C */

    --primary: var(--burgundy);
    --secondary: var(--red-brand);
    --accent: var(--gold);

    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 8px 32px 0 rgba(70, 70, 70, 0.1);

    /* Legacy / Compatibility */
    --light: #f8f9fa;
    --dark: var(--gray-dark);
    --white: #ffffff;
    --card-shadow: var(--shadow);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    font-family: 'Outfit', sans-serif;
    /* Soft beige/white gradient background */
    background: linear-gradient(135deg, #fdfbf7 0%, #e8e0d5 100%);
    color: var(--gray-dark);
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Shapes */
.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
}

.shape-1 {
    top: -100px;
    left: -100px;
    width: 500px;
    height: 500px;
    background: rgba(0, 180, 216, 0.3);
}

.shape-2 {
    bottom: -100px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: rgba(144, 224, 239, 0.3);
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

.logo-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--primary);
    background: white;
    padding: 15px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.main-logo {
    max-width: 250px;
    height: auto;
    margin-bottom: 10px;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 5px 0;
    color: var(--burgundy);
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -1px;
}

.subtitle {
    font-weight: 300;
    color: var(--gray-med);
    margin-bottom: 30px;
    font-size: 1.2rem;
}

/* Search */
.search-section {
    margin-bottom: 40px;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.search-bar-container {
    display: flex;
    align-items: center;
    background: white;
    padding: 15px 30px;
    border-radius: 50px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-bar-container:focus-within {
    border-color: var(--gold);
    box-shadow: 0 4px 20px rgba(188, 149, 91, 0.2);
    transform: translateY(-2px);
}

.search-icon {
    font-size: 1.2rem;
    color: var(--gray-med);
    margin-right: 15px;
}

input {
    border: none;
    outline: none;
    font-size: 1.1rem;
    width: 100%;
    background: transparent;
    color: var(--burgundy);
    font-weight: 500;
}

input::placeholder {
    color: #bbb;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 10px;
    padding-bottom: 50px;
}

/* Cards */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.colony-card {
    padding: 25px;
    text-align: left;
    transition: all 0.3s ease;
    cursor: pointer;
    border-top: 5px solid transparent;
    position: relative;
    overflow: hidden;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
}

.colony-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(105, 27, 49, 0.15);
    border-top-color: var(--red-brand);
}

.colony-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.card-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
}

.badge {
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.zone-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(188, 149, 91, 0.15);
    /* Gold tint */
    color: var(--burgundy);
    margin-bottom: 10px;
}

.colony-name {
    font-size: 1.4rem;
    color: var(--dark);
    margin-bottom: 20px;
    line-height: 1.2;
    min-height: 3.4rem;
    /* Ensure alignment */
}

/* Price Highlight */
.price-highlight {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 15px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 119, 182, 0.3);
}

.total-label {
    font-size: 0.8rem;
    opacity: 0.9;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.total-amount {
    font-size: 2rem;
    font-weight: 700;
}

/* Details */
.details-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

.detail-item {
    background: rgba(255, 255, 255, 0.5);
    padding: 8px 10px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
}

.detail-item span:first-child {
    color: #666;
    margin-bottom: 2px;
    font-size: 0.75rem;
}

.detail-item span:last-child {
    color: var(--dark);
    font-weight: 600;
}

.detail-item i {
    color: var(--primary);
    margin-right: 5px;
}

.documents-section {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: #888;
}

.empty-state i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 1.2rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.colony-card {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Responsive */
/* Responsive Design */
@media (max-width: 900px) {
    .main-container {
        padding: 20px;
    }

    h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 600px) {

    /* Header adjustments */
    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .logo-icon {
        font-size: 2rem;
        padding: 12px;
    }

    /* Search bar */
    .search-section {
        padding: 0;
    }

    .search-bar-container {
        padding: 10px 20px;
    }

    input {
        font-size: 1rem;
    }

    /* Grid layout - One column */
    .results-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Cards */
    .colony-card {
        padding: 20px;
    }

    .colony-name {
        font-size: 1.25rem;
        min-height: auto;
    }

    /* Modal adjustments */
    .modal-content {
        width: 95%;
        max-height: 85vh;
        /* slightly less tall on mobile */
        border-radius: 15px;
    }

    .modal-header {
        padding: 15px;
    }

    .modal-header h2 {
        font-size: 1.4rem;
    }

    .modal-body {
        /* Ensure scrolling works well on touch */
        -webkit-overflow-scrolling: touch;
    }

    .modal-details {
        padding: 15px;
    }

    .modal-map-container {
        height: 180px;
        /* shorter map but enough to be usable */
    }

    .close-modal {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .detail-item {
        font-size: 0.8rem;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(105, 27, 49, 0.3);
    /* Burgundy tint */
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    display: flex;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

.modal-content.active {
    transform: scale(1);
}

.modal-header {
    background: linear-gradient(135deg, #eee 0%, #f9f9f9 100%);
    /* Clean header */
    padding: 25px;
    position: relative;
    border-bottom: 1px solid #ddd;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--burgundy);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: var(--red-brand);
    color: white;
    transform: rotate(90deg);
}

.badge-modal {
    background: rgba(188, 149, 91, 0.2);
    color: var(--burgundy);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 5px;
}

.modal-header h2 {
    margin: 5px 0 0 0;
    color: var(--burgundy);
    font-size: 2rem;
    line-height: 1.1;
}

.modal-body {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.modal-map-container {
    width: 100%;
    /* Fixed height to prevent collapse or overflow interactions */
    height: 250px;
    background: #eee;
    border-bottom: 5px solid var(--accent);
    position: relative;
    flex-shrink: 0;
    /* Prevent shrinking in flex container */
    overflow: hidden;
    /* Ensure iframe does not bleed out */
}

/* Ensure iframe fits perfectly */
.modal-map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.modal-details {
    padding: 25px;
    flex: 1;
    /* Allow details to take remaining space */
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
    font-size: 1rem;
}

.docs-list {
    list-style: none;
    padding: 0;
    margin: 5px 0 0 0;
}

.docs-list li {
    padding: 5px 0;
    display: flex;
    align-items: flex-start;
}

.docs-list li i {
    color: var(--accent);
    margin-right: 10px;
    margin-top: 4px;
}

/* Compact list on cards */
.card-docs li {
    padding: 2px 0;
    font-size: 0.9rem;
    line-height: 1.3;
}

.card-docs li i {
    font-size: 0.8rem;
    margin-top: 3px;
    color: #888;
}

.price-row:last-of-type {
    border-bottom: none;
}

.main-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid var(--light);
    margin-bottom: 10px;
}

.modal-info-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #555;
}

.modal-info-box p {
    margin-bottom: 8px;
}

.modal-info-box p:last-child {
    margin-bottom: 0;
}