<<<<<<< HEAD
/* --- Brand Colors --- */
:root {
    --bg-color: #F9FAFB;
    --panel-bg: #FFFFFF;
    --primaryTeal: #00A99D;
    --darkTeal: #007A70;
    --lightTealBackground: #E0F2F1;
    --darkGreyText: #374151;
    --mediumGrey: #6B7280;
    --lightGrey: #D1D5DB;
    --text-colour: #111827;
    --active-text: #FFFFFF;
}

/* --- Base & Typography --- */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Work Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--darkGreyText);
    margin: 0;
    padding: 0;
}

/* --- Accessibility --- */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--darkTeal);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-nav:focus {
    top: 6px;
}

/* --- Main App Layout --- */
.app-layout {
    display: flex;
    min-height: 100vh;
    padding: 1.5rem;
    gap: 1.5rem;
}

/* --- Controls Panel (Left Side) --- */
.controls-panel {
    width: 420px;
    flex-shrink: 0;
    background-color: var(--panel-bg);
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.panel-header {
    background-color: var(--darkTeal);
    padding: 1.25rem;
    text-align: center;
}

.header-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.header-logo img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.panel-body {
    padding: 1.25rem;
}

/* --- Page Title Styles --- */
.page-title {
    text-align: left;
    margin-bottom: 3rem;
    height: 95px;
}

.page-title h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-colour);
    margin: 0;
}

.page-title .highlight {
    color: var(--darkTeal); 
}

.page-title .subtitle {
    color: var(--text-colour);
}

#scrolling-category {
    transition: opacity 0.5s ease-in-out;
}

/* --- Filter Styles --- */
.filter-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-group {
    text-align: left;
}

.filter-heading {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--darkTeal);
    margin-bottom: 0.75rem;
}

/* --- Unified Button Styles --- */
.button-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    border: none;
    cursor: pointer;
    background-color: #f1f3f4;
    color: #3c4043;
    border-radius: 20px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    line-height: 1.3;
    text-align: center;
    min-height: 44px; /* Improved touch target */
}

.filter-button .lang-native {
    font-weight: 600;
    font-size: 0.9rem;
}

.filter-button .lang-main {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.9;
}

.filter-button.single-line {
    padding: 0.4rem 0.8rem;
}

.filter-button.single-line .lang-main {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 1;
}

.filter-button:not(.active):hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.filter-button:focus {
    outline: 2px solid var(--primaryTeal);
    outline-offset: 2px;
}

.filter-button.active {
    background-color: #00A99D;
}

.filter-button.active .lang-native,
.filter-button.active .lang-main {
    color: white;
    opacity: 1;
}

#community-filters.button-grid {
    gap: 0.4rem;
}

#community-filters .filter-button {
    padding: 0.3rem 0.7rem;
}

#community-filters .filter-button .lang-main {
    font-size: 0.7rem;
}

/* Clear all filters button */
.clear-filters-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--lightGrey);
}

.clear-filters-button {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--mediumGrey);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clear-filters-button:hover {
    background-color: var(--darkGreyText);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.clear-filters-button:focus {
    outline: 2px solid var(--primaryTeal);
    outline-offset: 2px;
}

.clear-filters-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* --- Main Panel (Right Side) --- */
.main-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

/* --- Map Container --- */
.map-container {
    height: 60%;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
}

/* --- Organisation List Container --- */
.list-container {
    height: 40%;
    background-color: var(--panel-bg);
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

.list-container h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--darkTeal);
    padding: 1rem 1.5rem;
    margin: 0;
    border-bottom: 1px solid var(--lightTealBackground);
    flex-shrink: 0;
}

#organisation-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.organisation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.organisation-item:last-child {
    border-bottom: none;
}

.item-details {
    flex-grow: 1;
}

.organisation-item h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.organisation-item p {
    margin: 0.25rem 0;
    font-size: 0.85rem;
    color: var(--mediumGrey);
}

.organisation-item .item-description {
    font-style: italic;
    margin-bottom: 0.75rem;
}

.item-qr-code {
    flex-shrink: 0;
    margin-left: 1rem;
}

.item-qr-code img {
    width: 80px;
    height: 80px;
}

/* --- Leaflet Popup Styling --- */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    width: 280px !important;
}

.leaflet-popup-content h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--darkTeal);
}

.leaflet-popup-content .popup-description {
    margin: 0 0 1rem 0;
    line-height: 1.5;
    font-size: 0.9rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.popup-details {
    margin-top: 1rem;
}

.popup-details p {
    margin: 0.25rem 0;
    font-size: 0.85rem;
}

.popup-details strong {
    color: var(--darkGreyText);
}

.popup-qr-code {
    margin-top: 1rem;
    text-align: center;
}

.popup-qr-code img {
    width: 120px;
    height: 120px;
}

/* --- Loading States --- */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--mediumGrey);
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--lightGrey);
    border-top: 2px solid var(--primaryTeal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

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

/* --- Mobile Responsive Design --- */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        height: auto;
        min-height: 100vh;
    }
    
    .controls-panel {
        width: 100%;
        order: 1;
        max-height: none;
    }
    
    .main-panel {
        order: 2;
        height: 70vh;
    }
    
    .map-container {
        height: 50%;
    }
    
    .list-container {
        height: 50%;
    }
    
    .page-title h1 {
        font-size: 1.5rem;
    }
    
    .page-title {
        height: auto;
        margin-bottom: 2rem;
    }
    
    .filter-button {
        min-height: 48px; /* Larger touch targets on mobile */
        padding: 0.8rem 1rem;
    }
    
    .filter-button .lang-native {
        font-size: 1rem;
    }
    
    .filter-button .lang-main {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .app-layout {
        padding: 0.5rem;
    }
    
    .panel-body {
        padding: 1rem;
    }
    
    .filter-button {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 120px;
    }
    
    #community-filters .filter-button {
        flex: 1 1 calc(100% - 0.2rem);
    }
    
    .organisation-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .item-qr-code {
        margin-left: 0;
        align-self: center;
    }
}

/* --- Tablet Responsive Design --- */
@media (min-width: 769px) and (max-width: 1024px) {
    .controls-panel {
        width: 350px;
    }
    
    .page-title h1 {
        font-size: 1.75rem;
    }
    
    .filter-button {
        padding: 0.5rem 0.8rem;
    }
