:root {
    /* Colors - Premium Dark Theme */
    --color-bg: #0f172a;
    /* Slate 900 */
    --color-bg-alt: #1e293b;
    /* Slate 800 */
    --color-text: #f8fafc;
    /* Slate 50 */
    --color-text-muted: #94a3b8;
    /* Slate 400 */

    --color-primary: #38bdf8;
    /* Sky 400 */
    --color-secondary: #818cf8;
    /* Indigo 400 */
    --color-accent: #f472b6;
    /* Pink 400 */

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    /* Layout */
    --container-width: 1200px;
    --header-height: 80px;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    line-height: 1.1;
    font-weight: 700;
}

.text-gradient {
    background: linear-gradient(to right, var(--color-primary), var(--color-accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Layout Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-xl) 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-bg);
}

.btn-secondary {
    border: 1px solid var(--color-text-muted);
    color: var(--color-text);
}

/* Header */
.header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.nav {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
}

.header-shortcuts {
    display: none;
    gap: 0.4rem;
    margin-left: auto;
    margin-right: 0.65rem;
}

.header-shortcuts a {
    color: var(--color-text);
    font-size: 0.76rem;
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, 0.42);
    background: rgba(15, 23, 42, 0.65);
    padding: 0.34rem 0.58rem;
    border-radius: 999px;
    line-height: 1;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--color-text);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav a:not(.btn) {
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

.nav a:not(.btn):hover {
    color: var(--color-primary);
}

.lang-switch {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: -10px;
    /* Adjust spacing near button */
}

.lang-link {
    color: var(--color-text-muted);
    transition: color 0.3s;
}

.lang-link:hover {
    color: var(--color-primary);
}

.lang-active {
    color: var(--color-primary);
}

@media (max-width: 1024px) {
    .header .container {
        position: relative;
    }

    .header-shortcuts {
        display: inline-flex;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        left: var(--spacing-md);
        right: var(--spacing-md);
        z-index: 110;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
        padding: 1rem;
        border-radius: 14px;
        background: rgba(8, 13, 25, 0.96);
        border: 1px solid rgba(148, 163, 184, 0.26);
        box-shadow: 0 18px 35px -22px rgba(2, 6, 23, 0.95);
    }

    .header.nav-open .nav {
        display: flex;
    }

    .header.nav-open .nav-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .header.nav-open .nav-toggle span:nth-child(2) {
        opacity: 0;
    }

    .header.nav-open .nav-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav a:not(.btn) {
        width: 100%;
        font-size: 1rem;
    }

    .nav .btn {
        width: 100%;
        text-align: center;
        margin-top: 0.4rem;
    }

    .lang-switch {
        margin-right: 0;
        width: 100%;
        padding-top: 0.45rem;
        border-top: 1px solid rgba(148, 163, 184, 0.25);
    }
}

/* Hero */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--header-height);
    overflow: hidden;
    /* Background Image Implementation */
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.8)), url('hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
    /* Lower opacity to blend with image */
    mix-blend-mode: screen;
    /* Blend particles with image */
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
}

.hero-slogan {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: var(--spacing-md);
}

.hero-slogan-logo {
    width: clamp(120px, 16vw, 210px);
    height: auto;
    display: block;
    flex-shrink: 0;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    margin-bottom: 0;
    text-align: left;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-lg);
}

.hero-actions {
    display: flex;
    justify-content: center;
}

/* Footer */
.footer {
    padding: var(--spacing-lg) 0;
    border-top: 1px solid var(--color-bg-alt);
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-top: auto;
}

/* Section Components */
.bg-alt {
    background-color: var(--color-bg-alt);
}

.lead {
    font-size: 1.25rem;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    max-width: 800px;
}

.text-link {
    color: var(--color-primary);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.text-link:hover {
    text-decoration: underline;
}

/* About Grid */
.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

@media (max-width: 768px) {
    .hero-slogan {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-title {
        text-align: center;
    }

    .hero-slogan-logo {
        width: 132px;
    }

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

.stats-box {
    margin-top: var(--spacing-lg);
    display: inline-flex;
    flex-direction: column;
    border-left: 4px solid var(--color-accent);
    padding-left: var(--spacing-md);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    color: var(--color-text);
}

.stat-label {
    color: var(--color-text-muted);
    font-size: 1rem;
    margin-top: 4px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    padding: var(--spacing-lg);
    border-radius: 12px;
    margin-bottom: var(--spacing-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-card h3 {
    color: var(--color-secondary);
    margin-bottom: var(--spacing-sm);
}

/* Activities Grid */
.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--spacing-xl);
}

.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.activity-item {
    background: var(--color-bg);
    padding: var(--spacing-lg);
    border-radius: 16px;
    text-align: center;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-item:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
}

.activity-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
    display: inline-block;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.center-action {
    text-align: center;
}

/* Reports Page */
.page-header {
    padding: 160px 0 80px;
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.1), transparent),
        linear-gradient(to bottom, var(--color-bg-alt), var(--color-bg));
    text-align: center;
}

.page-header h1 {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, #fff 0%, var(--color-text-muted) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-header p {
    color: var(--color-text-muted);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2.5rem;
}

.report-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.report-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.report-card:hover {
    transform: translateY(-8px);
    border-color: rgba(56, 189, 248, 0.3);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.4);
}

.report-card:hover::before {
    opacity: 1;
}

.report-meta {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    font-weight: 800;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-meta::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Meta Category Colors */
.report-meta.recent {
    color: #10b981;
}

.report-meta.highlight {
    color: #f59e0b;
}

.report-meta.event {
    color: #8b5cf6;
}

.report-meta.social {
    color: #ec4899;
}

.report-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    line-height: 1.3;
}

.report-date {
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-family: var(--font-heading);
}

.report-card p {
    flex-grow: 1;
    margin-bottom: 2rem;
    line-height: 1.7;
    color: var(--color-text-muted);
}

.read-more {
    color: var(--color-text);
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.2s ease;
}

.read-more:hover {
    color: var(--color-primary);
    gap: 0.75rem;
}

.read-more::after {
    content: '→';
    font-size: 1.1rem;
}

/* =========================================
   MEMBER DIRECTORY STYLES
   ========================================= */

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.filter-bar {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 300px;
    padding: 1rem 1.5rem;
    background: var(--color-bg-alt);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--color-text);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

.sort-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.sort-select {
    padding: 0.75rem 1rem;
    background: var(--color-bg-alt);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--color-text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.sort-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Tag Filtering UI */
.active-tag-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 16px;
    flex-wrap: wrap;
}

.active-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cloud-section {
    margin-bottom: 3rem;
}

.cloud-title {
    font-size: 1.1rem;
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.active-tag-label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.member-tag.clickable {
    cursor: pointer;
    transition: var(--transition);
}

.member-tag.clickable:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
}

.member-tag.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.clear-filter-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 2px 5px;
    opacity: 0.7;
    transition: var(--transition);
}

.clear-filter-btn:hover {
    color: #ef4444;
    opacity: 1;
}

.member-card {
    background: var(--color-bg-alt);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: var(--spacing-lg);
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.member-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.member-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xs);
}

.member-name {
    font-size: 1.25rem;
    color: var(--color-text);
    margin: 0;
    font-family: var(--font-heading);
    flex: 1;
}

.seattle-status-badge {
    font-size: 0.65rem;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    margin-left: 10px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.seattle-status-badge.status-coming {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}


.member-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--spacing-sm);
}

.member-tag {
    font-size: 0.7rem;
    background: rgba(56, 189, 248, 0.1);
    color: var(--color-primary);
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.2s, color 0.2s;
}

.member-tag:hover {
    background: var(--color-primary);
    color: var(--color-bg);
}

.member-role {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: var(--spacing-sm);
}

.info-row {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
    line-height: 1.4;
    align-items: flex-start;
}

.info-row .icon {
    opacity: 0.7;
    font-size: 1.1rem;
}

.member-actions {
    margin-top: auto;
    padding-top: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.member-links {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.member-link {
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--color-text-muted);
    border: 1px solid var(--color-text-muted);
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.member-link:hover {
    color: var(--color-bg);
    background-color: var(--color-text-muted);
    border-color: var(--color-text-muted);
}

.action-icons {
    display: flex;
    align-items: center;
}

.icon-link {
    font-size: 1.2rem;
    margin-left: var(--spacing-sm);
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.icon-link:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Search Bar */
.filter-bar {
    margin-bottom: var(--spacing-xl);
    display: flex;
    justify-content: center;
}

.search-input {
    width: 100%;
    max-width: 600px;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    border: 1px solid var(--color-text-muted);
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text);
    font-size: 1rem;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}


/* Map Section */
.map-container {
    margin-bottom: var(--spacing-xl);
}

/* Leaflet Map Styles */
#map {
    height: 500px;
    width: 100%;
    border-radius: 16px;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Customizing Leaflet Popups for Dark Theme */
.leaflet-popup-content-wrapper {
    background: var(--color-bg-alt) !important;
    color: var(--color-text) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-family: var(--font-body);
}

.leaflet-popup-tip {
    background: var(--color-bg-alt) !important;
}

.member-popup-list {
    margin-top: 8px;
    font-size: 0.9rem;
}

.member-popup-item {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.member-popup-name {
    font-weight: 600;
    display: block;
}

.member-popup-role {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.popup-location-name {
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 4px;
    display: block;
    font-family: var(--font-heading);
}

.highlight-card {
    animation: highlight-pulse 2s ease-out;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4) !important;
}

@keyframes highlight-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(56, 189, 248, 0);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
    }
}

.member-popup-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

.member-popup-link:hover .member-popup-name {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    transition: var(--transition);
}

.modal-content {
    background-color: var(--color-bg-alt);
    margin: 5% auto;
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    width: 90%;
    max-width: 700px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.close-modal {
    color: var(--color-text-muted);
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--color-primary);
}

.modal-title {
    font-size: 1.5rem;
    font-family: var(--font-heading);
    margin-bottom: 2rem;
    color: var(--color-text);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}


.template-section {
    margin-top: 2rem;
}

.template-box {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    white-space: pre-wrap;
    font-size: 0.95rem;
    line-height: 1.6;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.copy-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

.address-text {
    display: block;
    margin-top: 2px;
    color: var(--color-text-muted);
    font-style: italic;
    font-size: 0.75rem;
    opacity: 0.8;
}

.logo-icon {
    height: 40px;
    width: auto;
    display: block;
}

.logo-wordmark {
    font-family: var(--font-heading);
    font-size: 1.06rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--color-text);
}

@media (max-width: 768px) {
    .logo-icon {
        height: 34px;
    }

    .logo-wordmark {
        font-size: 0.96rem;
    }
}

@media (max-width: 480px) {
    .logo-wordmark {
        display: none;
    }
}

/* =========================================
   KNOWLEDGE CHAT INTERFACE
   ========================================= */

.chat-section {
    padding-bottom: 4rem;
}

.chat-layout {
    display: flex;
    justify-content: center;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px;
}

.chat-header {
    background: rgba(255, 255, 255, 0.04);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--color-text);
}

.chat-header .status {
    font-size: 0.85rem;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-header .status::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #10b981;
}

.chat-messages {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.chat-message {
    display: flex;
    gap: 1rem;
    max-width: 85%;
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.bot-message .chat-avatar {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.user-message .chat-avatar {
    background: rgba(255, 255, 255, 0.1);
}

.chat-content {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem 1.25rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.6;
}

.bot-message .chat-content {
    border-top-left-radius: 4px;
}

.user-message .chat-content {
    background: var(--color-primary);
    color: var(--color-bg);
    border: none;
    border-top-right-radius: 4px;
}

/* Chat Input Area */
.chat-input-wrapper {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.chat-input {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 50px;
    color: var(--color-text);
    font-size: 1rem;
    transition: var(--transition);
}

.chat-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.08);
}

.chat-send-btn {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: var(--color-primary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat Results Card Styling */
.chat-results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}

.chat-result-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    transition: var(--transition);
}

.chat-result-card:hover {
    border-color: rgba(56, 189, 248, 0.5);
    transform: translateY(-2px);
}

.chat-result-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.chat-result-card h4 a {
    color: var(--color-primary);
    text-decoration: none;
}

.chat-result-card h4 a:hover {
    text-decoration: underline;
}

.chat-result-card p {
    margin: 0 0 0.25rem 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.chat-footer-note {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    margin: 0;
}

/* Interdisciplinary Banner UI */
.chat-interdisciplinary-banner {
    display: flex;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.2), rgba(56, 189, 248, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin: 0.5rem 0 1.5rem 0;
    align-items: center;
}

.banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.6));
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.matched-topic-badge {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: #c4b5fd;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: capitalize;
    font-weight: 600;
}

@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 200px);
        min-height: 400px;
        border-radius: 16px;
    }
    
    .chat-header {
        padding: 1rem;
    }

    .chat-messages {
        padding: 1rem;
        gap: 1rem;
    }

    .chat-message {
        max-width: 95%;
        gap: 0.75rem;
    }

    .chat-avatar {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .chat-content {
        padding: 0.85rem 1rem;
        font-size: 0.9rem;
    }

    .chat-input-wrapper {
        padding: 1rem;
        gap: 0.5rem;
    }

    .chat-input {
        padding: 0.85rem 1.25rem;
        font-size: 0.95rem;
    }

    .chat-send-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    .chat-interdisciplinary-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }
}

/* Email Copy Area (Inside Modal) */
.anti-spam-box {
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    background: rgba(239, 68, 68, 0.03) !important;
    padding: 1.25rem !important;
    border-radius: 12px !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    overflow: hidden !important;
    /* Critical for containment */
}

.modal-instruction {
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
    margin-bottom: 0.75rem !important;
    color: var(--color-text-muted);
}

.modal-instruction small {
    font-size: 0.82rem !important;
    display: block;
    margin-top: 8px;
    opacity: 0.8;
}

.email-copy-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0.75rem;
    width: 100%;
    box-sizing: border-box;
}

.email-triangle {
    color: #f59e0b;
    font-weight: 900;
}

.obfuscated-email {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    color: #38bdf8;
    word-break: break-all;
    overflow-wrap: anywhere;
    flex-grow: 1;
    min-width: 0;
    /* CRITICAL: allows flex child to shrink below its content size */
    font-size: 0.82rem;
    line-height: 1.4;
    font-weight: 500;
    box-sizing: border-box;
    display: block !important;
}

.copy-email-btn-refined {
    background: var(--color-primary);
    color: var(--color-bg);
    border: none;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
}

.copy-email-btn-refined:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.copy-email-btn-refined.copy-success {
    background: #22c55e;
}

.copy-icon {
    font-size: 1rem;
}

@media (max-width: 768px) {
    .email-copy-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .obfuscated-email {
        font-size: 0.8rem !important;
        margin-bottom: 0px !important;
    }

    .copy-email-btn-refined {
        justify-content: center;
        width: 100%;
        padding: 0.75rem;
    }
}

/* Aggressive Email Containment Fix */
.anti-spam-box {
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    background: rgba(239, 68, 68, 0.03) !important;
    padding: 1rem !important;
    border-radius: 12px !important;
    margin: 1.5rem 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    overflow: hidden !important;
}

.email-copy-container {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.obfuscated-email {
    flex: 1 1 200px !important;
    /* Allow growing and shrinking */
    min-width: 0 !important;
    max-width: 100% !important;
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(56, 189, 248, 0.2) !important;
    padding: 0.6rem 0.8rem !important;
    border-radius: 8px !important;
    font-family: 'JetBrains Mono', 'Courier New', monospace !important;
    color: #38bdf8 !important;
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
}

.copy-email-btn-refined {
    flex: 0 0 auto !important;
    background: var(--color-primary) !important;
    color: var(--color-bg) !important;
    padding: 0.5rem 0.8rem !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

@media (max-width: 480px) {
    .anti-spam-box {
        padding: 0.75rem !important;
    }

    .obfuscated-email {
        font-size: 0.75rem !important;
        padding: 0.5rem !important;
    }

    .email-copy-container {
        flex-direction: column !important;
        align-items: stretch !important;
    }
}

/* Final Forced Email Containment */
.anti-spam-box {
    border: 2px solid rgba(239, 68, 68, 0.6) !important;
    /* Force red area */
    background: rgba(239, 68, 68, 0.03) !important;
    padding: 1.25rem !important;
    border-radius: 12px !important;
    margin: 1.5rem 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    overflow: hidden !important;
    display: block !important;
}

.email-copy-container {
    display: block !important;
    /* Switch from flex to block on mobile for safety */
    width: 100% !important;
    box-sizing: border-box !important;
}

.obfuscated-email {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(56, 189, 248, 0.2) !important;
    padding: 0.75rem !important;
    border-radius: 8px !important;
    font-family: 'JetBrains Mono', 'Courier New', monospace !important;
    color: #38bdf8 !important;
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
    margin-bottom: 12px !important;
}

.copy-email-btn-refined {
    display: flex !important;
    width: 100% !important;
    /* Full width button on mobile */
    justify-content: center !important;
    background: var(--color-primary) !important;
    color: var(--color-bg) !important;
    padding: 0.75rem !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
}

@media (min-width: 769px) {
    .email-copy-container {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
    }

    .obfuscated-email {
        margin-bottom: 0 !important;
        flex: 1 !important;
    }

    .copy-email-btn-refined {
        width: auto !important;
    }
}

