/*
 * Share & Repair Network - Custom Stylesheet
 * Built on Bootstrap 5.3
 * UPDATED: Fixed 90% scale for denser layout
 */

/* ================================
   Base Overrides & Custom Variables
   ================================ */

:root {
    --srn-primary: #4d5a4d;
    --srn-secondary: #1e3a8a;
    --srn-success: #388e3c;
    --srn-danger: #d84315;
    --srn-warning: #ff9800;
    --srn-info: #1976d2;
    --srn-light: #f8f9fa;
    --srn-dark: #333;
    --srn-gradient-green: linear-gradient(135deg, #97bc62 0%, #2c5f2d 100%);
    --srn-gradient-blue: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    --srn-gradient-orange: linear-gradient(135deg, #d84315 0%, #ff6f42 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Apply global 90% scaling */
html {
    font-size: 14.4px; /* 16px * 0.9 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--srn-dark);
    background: var(--srn-light);
}

/* ================================
   Header & Navigation
   ================================ */

header {
    background: var(--srn-light);
    color: black;
    padding: 0.9rem 0; /* 1rem * 0.9 */
    border-bottom: 1px solid #aaa;
}

.header-content {
    max-width: 1080px; /* 1200px * 0.9 */
    margin: 0 auto;
    padding: 0 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.35rem; /* 1.5rem * 0.9 */
    font-weight: bold;
}

.logo a {
    color: black;
    text-decoration: none;
}

nav a {
    color: black;
    text-decoration: none;
    margin-left: 1.8rem; /* 2rem * 0.9 */
}

nav a:hover {
    text-decoration: underline;
}

nav .dropdown-item a {
    margin-left: 2px;
}

/* POC Banner */
.poc {
    text-align: center;
    font-size: small;
    padding-bottom: 13.5px; /* 15px * 0.9 */
    border-bottom: 2px solid white;
    margin-bottom: 9px; /* 10px * 0.9 */
}

.poc a:visited,
.poc a {
    color: #fff;
}

/* Page Info Banner */
.page-info {
    padding: 9px; /* 10px * 0.9 */
    background-color: #efefef;
    border: 3px solid #aaa;
    font-size: 16.2px; /* 18px * 0.9 */
    color: #000;
}

/* ================================
   Breadcrumb
   ================================ */

.breadcrumb {
    max-width: 1080px;
    margin: 0.9rem auto;
    padding: 0 0.9rem;
    color: #666;
    font-size: 0.81rem; /* 0.9rem * 0.9 */
}

.breadcrumb a {
    color: var(--srn-primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ================================
   Container & Layout
   ================================ */

.container {
    max-width: 1080px;
    margin: 0 auto;
}

.layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.8rem; /* 2rem * 0.9 */
}

/* ================================
   Buttons
   ================================ */

.btn {
    display: inline-block;
    padding: 0.675rem 1.35rem; /* 0.75rem * 0.9, 1.5rem * 0.9 */
    background: var(--srn-secondary);
    color: var(--srn-light);
    text-decoration: none;
    border-radius: 5.4px; /* 6px * 0.9 */
    font-weight: 600;
    text-align: center;
    transition: transform 0.2s;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #d4dcf3;
    text-decoration: none;
}

.btn-primary {
    background: var(--srn-secondary);
    color: white;
}

.btn-primary:hover {
    background: #1e40af;
    color: white;
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--srn-secondary);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.btn-xs {
    padding: 2.7px 9px; /* 3px * 0.9, 10px * 0.9 */
    font-size: 0.72rem; /* 0.8rem * 0.9 */
}

.btn-outline-primary {
    background: white;
    border: 1px solid var(--srn-secondary);
    color: var(--srn-secondary);
}

.btn-outline-primary:hover {
    background: var(--srn-secondary);
    border: 1px solid var(--srn-secondary);
    color: white;
}

.cta-btn {
    display: inline-block;
    padding: 0.675rem 1.8rem; /* 0.75rem * 0.9, 2rem * 0.9 */
    background: white;
    color: var(--srn-secondary);
    text-decoration: none;
    border-radius: 5.4px;
    font-weight: 600;
    margin-top: 0.9rem;
    transition: transform 0.2s;
}

.cta-btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem; /* 0.5rem * 0.9 */
    padding: 0.45rem 0.9rem;
    background: var(--srn-secondary);
    color: white;
    text-decoration: none;
    border-radius: 5.4px;
    font-weight: 500;
    transition: background 0.2s;
}

.download-btn:hover {
    background: #1e40af;
    text-decoration: none;
}

/* ================================
   Badges
   ================================ */

.badge {
    display: inline-block;
    padding: 0.36rem 0.9rem; /* 0.4rem * 0.9, 1rem * 0.9 */
    background: rgba(255,255,255,0.2);
    border-radius: 18px; /* 20px * 0.9 */
    font-size: 0.72rem; /* 0.8rem * 0.9 */
    font-weight: normal;
    backdrop-filter: blur(10px);
}

.badge-category {
    background: #e8f5e9;
    color: var(--srn-success);
    padding: 0.45rem 0.9rem;
    font-weight: 500;
    margin-right: 0.225rem; /* 0.25rem * 0.9 */
}

.badge-type {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 0.45rem 0.9rem;
    font-size: 0.72rem;
    font-weight: 500;
}

.badge-group {
    background: #e3f2fd;
    color: var(--srn-info);
}

.badge-org {
    background: #f3e5f5;
    color: #7b1fa2;
}

.category-badge {
    padding: 0.45rem 0.9rem;
    background: #e8f5e9;
    color: var(--srn-success);
    border-radius: 18px;
    font-size: 0.81rem; /* 0.9rem * 0.9 */
    font-weight: 500;
}

/* ================================
   Content Boxes
   ================================ */

.content-box {
    background: white;
    padding: 1.8rem; /* 2rem * 0.9 */
    border-radius: 7.2px; /* 8px * 0.9 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.8rem;
}

.content-box h2 {
    color: var(--srn-success);
    margin-bottom: 0.9rem;
    font-size: 1.35rem; /* 1.5rem * 0.9 */
}

.content-box p {
    line-height: 1.8;
    color: #666;
    margin-bottom: 0.9rem;
}

/* ================================
   Info Grid
   ================================ */

.info-grid {
    display: grid;
    gap: 0.9rem;
}

.info-item {
    display: flex;
    align-items: start;
    gap: 0.675rem; /* 0.75rem * 0.9 */
}

.info-icon {
    font-size: 1.17rem; /* 1.3rem * 0.9 */
    margin-top: 0.18rem; /* 0.2rem * 0.9 */
}

.info-content {
    flex: 1;
    color: #666;
}

.info-content strong {
    display: block;
    margin-bottom: 0.225rem; /* 0.25rem * 0.9 */
    color: var(--srn-dark);
}

/* ================================
   Social Links
   ================================ */

.social-links {
    display: flex;
    gap: 0.9rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem;
    background: var(--srn-light);
    border-radius: 5.4px;
    text-decoration: none;
    color: var(--srn-dark);
    transition: background 0.2s;
}

.social-link:hover {
    background: #e9ecef;
    text-decoration: none;
}

/* ================================
   Cards
   ================================ */

.card {
    background: white;
    border-radius: 7.2px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-body {
    padding: 1.35rem; /* 1.5rem * 0.9 */
}

.card-title {
    font-size: 1.17rem; /* 1.3rem * 0.9 */
    margin-bottom: 0.45rem;
    color: var(--srn-primary);
}

.card-text {
    color: #666;
    line-height: 1.6;
}

/* ================================
   Org Header
   ================================ */

.org-header {
    background: var(--srn-gradient-green);
    color: white;
    padding: 2.7rem 0; /* 3rem * 0.9 */
    margin-bottom: 1.8rem;
}

.org-header-content {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 0.9rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.8rem;
    align-items: center;
}

.org-logo {
    width: 90px; /* 100px * 0.9 */
    height: 90px;
    border-radius: 7.2px;
    object-fit: cover;
    background: white;
    padding: 4.5px; /* 5px * 0.9 */
}

.org-info h1 {
    font-size: 2.25rem; /* 2.5rem * 0.9 */
    margin-bottom: 0.45rem;
}

.org-actions {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

/* ================================
   Group Header
   ================================ */

.group-header {
    background: var(--srn-gradient-blue);
    color: white;
    padding: 2.7rem 0;
    margin-bottom: 1.8rem;
}

.group-header-content {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 0.9rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.8rem;
    align-items: center;
}

.group-logo {
    width: 90px;
    height: 90px;
    border-radius: 7.2px;
    object-fit: cover;
    background: white;
    padding: 4.5px;
}

.group-info h1 {
    font-size: 2.25rem;
    margin-bottom: 0.45rem;
}

/* ================================
   Group Navigation
   ================================ */

.group-nav {
    background: white;
    border-bottom: 1px solid #ddd;
    margin-bottom: 1.8rem;
}

.group-nav-content {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 0.9rem;
    display: flex;
    gap: 1.8rem;
}

.group-nav a {
    padding: 0.9rem 0;
    color: var(--srn-dark);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: border-color 0.2s;
}

.group-nav a:hover,
.group-nav a.active {
    border-bottom-color: var(--srn-secondary);
}

/* ================================
   Stats
   ================================ */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* 200px * 0.9 */
    gap: 0.9rem;
    margin-bottom: 1.8rem;
}

.stat-card {
    background: white;
    padding: 1.35rem;
    border-radius: 7.2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: bold;
    color: var(--srn-primary);
    margin-bottom: 0.45rem;
}

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

/* ================================
   Members Section
   ================================ */

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

.members-header h2 {
    font-size: 1.62rem; /* 1.8rem * 0.9 */
    color: var(--srn-secondary);
}

.member-filters {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.45rem 0.9rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.81rem;
}

.filter-btn:hover {
    background: var(--srn-light);
}

.filter-btn.active {
    background: var(--srn-secondary);
    color: white;
    border-color: var(--srn-secondary);
}

.members-grid {
    display: grid;
    gap: 0.9rem;
}

.member-card {
    background: white;
    padding: 1.35rem;
    border-radius: 7.2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 0.9rem;
    align-items: start;
}

.member-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.member-logo {
    width: 54px; /* 60px * 0.9 */
    height: 54px;
    border-radius: 5.4px;
    object-fit: cover;
    background: #f0f0f0;
    flex-shrink: 0;
}

.member-info {
    flex: 1;
}

.member-info h3 {
    font-size: 1.08rem; /* 1.2rem * 0.9 */
    margin-bottom: 0.45rem;
    color: var(--srn-primary);
}

.member-meta {
    display: flex;
    gap: 0.9rem;
    margin-bottom: 0.45rem;
    flex-wrap: wrap;
}

.member-location,
.member-type {
    color: #666;
    font-size: 0.81rem;
}

/* ================================
   Resources Section
   ================================ */

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); /* 300px * 0.9 */
    gap: 1.35rem;
}

.resource-card {
    background: white;
    border-radius: 7.2px;
    padding: 1.35rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
}

.resource-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.9rem;
}

.resource-icon {
    font-size: 1.62rem;
    color: var(--srn-secondary);
}

.resource-category {
    background: #e3f2fd;
    color: var(--srn-info);
    padding: 0.27rem 0.54rem; /* 0.3rem * 0.9, 0.6rem * 0.9 */
    border-radius: 9px; /* 10px * 0.9 */
    font-size: 0.63rem; /* 0.7rem * 0.9 */
    font-weight: 500;
}

.resource-title {
    font-size: 1.08rem;
    margin-bottom: 0.45rem;
    color: var(--srn-dark);
}

.resource-type {
    color: #666;
    font-size: 0.72rem;
    margin-bottom: 0.45rem;
}

.resource-description {
    color: #666;
    font-size: 0.81rem;
    line-height: 1.5;
    margin-bottom: 0.9rem;
}

.resource-stats {
    color: #999;
    font-size: 0.72rem;
    margin-bottom: 0.9rem;
}

/* ================================
   Hero Section
   ================================ */

.hero {
    background: var(--srn-gradient-green);
    color: white;
    padding: 3.6rem 0; /* 4rem * 0.9 */
    text-align: center;
}

.hero h1 {
    font-size: 2.7rem; /* 3rem * 0.9 */
    margin-bottom: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.hero p {
    font-size: 1.08rem;
    margin-bottom: 1.8rem;
    opacity: 0.95;
}

/* ================================
   Page Header
   ================================ */

.page-header {
    background: var(--srn-gradient-blue);
    color: white;
    padding: 2.7rem 0;
    margin-bottom: 1.8rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.45rem;
}

.page-header p {
    font-size: 1.08rem;
    opacity: 0.95;
}

.cta-box {
    background: var(--srn-gradient-blue);
    color: white;
    padding: 1.8rem;
    border-radius: 7.2px;
    text-align: center;
    margin-top: 2.7rem;
}

.cta-box h3 {
    color: white;
    margin-bottom: 0.9rem;
}

/* ================================
   Section
   ================================ */

.section {
    margin-bottom: 2.7rem;
}

.section h2 {
    font-size: 1.8rem; /* 2rem * 0.9 */
    margin-bottom: 1.35rem;
    color: var(--srn-secondary);
}

.section p {
    line-height: 1.8;
    color: #666;
    margin-bottom: 0.9rem;
}

/* ================================
   Content
   ================================ */

.content {
    background: white;
    padding: 2.7rem;
    border-radius: 7.2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    line-height: 1.8;
}

.content h2 {
    color: var(--srn-secondary);
    font-size: 1.62rem;
    margin: 1.8rem 0 0.9rem;
}

.content h3 {
    color: var(--srn-secondary);
    font-size: 1.17rem;
    margin: 1.35rem 0 0.675rem;
}

.content p {
    margin-bottom: 0.9rem;
    color: #555;
}

.content ul,
.content ol {
    margin-left: 1.8rem;
    margin-bottom: 0.9rem;
    color: #555;
}

.content li {
    margin-bottom: 0.45rem;
}

/* ================================
   Cards (Home Page)
   ================================ */

.list-view {
    display: grid;
    gap: 1.35rem;
}

.list-view .card {
    background: white;
    border-radius: 3.6px; /* 4px * 0.9 */
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex !important;
    flex-direction: row !important;
    gap: 1.35rem;
    transition: box-shadow 0.2s;
    border: none;
}

.list-view .card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.list-view .card-image {
    width: 36px; /* 40px * 0.9 */
    height: 36px;
    border-radius: 3.6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}

.list-view .card-content {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 1.17rem;
    margin-bottom: 0.45rem;
    color: var(--srn-primary);
}

.card-meta {
    display: flex;
    gap: 0.9rem;
    margin-bottom: 0.45rem;
    flex-wrap: wrap;
}

.card-location {
    color: #666;
    font-size: 0.81rem;
}

.card-description {
    color: #666;
    line-height: 1.5;
    margin-top: 0.45rem;
}

/* ================================
   Search & Filters (Home Page)
   ================================ */

.country-select {
    font-weight: bold;
    font-family: inherit;
    /*color: white;*/
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    padding: 0.25rem 2.5rem 0.25rem 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5rem;
}

.country-select:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.country-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.35);
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.country-select option {
    color: #333;
    background: white;
    font-size: 1rem;
    padding: 0.5rem;
}

.search-bar {
    background: white;
    padding: 1.35rem;
    border-radius: 7.2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 1.8rem;
}

.search-input {
    width: 100%;
    padding: 0.675rem;
    border: 1px solid #ddd;
    border-radius: 3.6px;
    font-size: 1rem;
}

.search-box {
    flex: 1;
    min-width: 270px; /* 300px * 0.9 */
}

.view-toggle {
    margin-left: auto;
    display: flex;
    gap: 0.45rem;
}

.view-btn {
    padding: 0.45rem 0.9rem;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 3.6px;
}

.view-btn.active {
    background: var(--srn-primary);
    color: white;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem;
    color: #666;
}

/* ================================
   Map View
   ================================ */

#map {
    height: 495px; /* 550px * 0.9 */
    border-radius: 3.6px;
}

/* ================================
   Event Schedule (Repair Cafes)
   ================================ */

.event-schedule {
    background: var(--srn-light);
    padding: 1.35rem;
    border-radius: 7.2px;
    margin-top: 0.9rem;
}

.event-schedule h3 {
    color: var(--srn-danger);
    margin-bottom: 0.9rem;
}

.event-item {
    padding: 0.9rem;
    background: white;
    border-radius: 5.4px;
    margin-bottom: 0.675rem;
}

.event-item:last-child {
    margin-bottom: 0;
}

.event-date {
    font-weight: 600;
    color: var(--srn-danger);
    margin-bottom: 0.225rem;
}

.event-time {
    color: #666;
    font-size: 0.81rem;
}

/* ================================
   Responsive Design
   ================================ */

@media (max-width: 968px) {
    .org-header-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .org-actions {
        flex-direction: row;
    }

    .layout {
        grid-template-columns: 1fr;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-text h1 {
        font-size: 1.8rem; /* 2rem * 0.9 */
    }

    .group-nav-content {
        overflow-x: auto;
    }

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

@media (max-width: 768px) {
    .hero h1,
    .page-header h1 {
        font-size: 1.8rem;
    }

    .hero h1 {
        flex-direction: column;
        gap: 0.675rem;
    }

    nav a {
        margin-left: 0.9rem;
    }

    .list-view .card {
        flex-direction: column !important;
    }

    .list-view .card-image {
        width: 100%;
        height: 180px; /* 200px * 0.9 */
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .view-toggle {
        margin-left: 0;
        width: 100%;
    }

    .resource-grid {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 1.35rem;
    }
}

/* ================================
   Tag Filter Section
   ================================ */

.tag-filter-section {
    padding: 0.9rem;
    background-color: #f8f9fa;
    border-radius: 0.45rem;
    margin-bottom: 0.9rem;
}

.tag-filter-btn {
    padding: 0.45rem 0.9rem;
    font-size: 0.81rem;
    transition: all 0.2s ease-in-out;
    border: 1px solid #ddd;
    background: white;
    color: var(--srn-dark);
    border-radius: 3.6px;
    cursor: pointer;
}

.tag-filter-btn.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.tag-filter-btn:hover:not(.active) {
    background-color: #e9ecef;
}
