/* CSS Variables */
:root {
    --primary-color: #2d5a4a;
    --primary-light: #3d7a64;
    --primary-dark: #1d3a30;
    --secondary-color: #7eb5a6;
    --accent-color: #e8c4a0;
    --accent-warm: #f4a261;
    --text-color: #1a1a2e;
    --text-light: #555566;
    --text-muted: #8888a0;
    --background: #f8fafc;
    --background-alt: #eef2f0;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 8px 30px rgba(45, 90, 74, 0.15);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease-out;
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --border-radius-lg: 24px;
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 40px;
    --spacing-xl: 64px;
}

/* Reset & Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 500;
    line-height: 1.3;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Crisis Banner */
.crisis-banner {
    background: linear-gradient(90deg, var(--primary-dark) 0%, #2a4a40 100%);
    color: var(--white);
    padding: 12px 0;
    text-align: center;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.crisis-banner::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-warm);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.crisis-banner a {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.crisis-banner a:hover {
    background: rgba(232, 196, 160, 0.2);
    text-decoration: none;
}

/* Header */
.header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
}

.logo-icon {
    font-size: 28px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--primary-light) 100%);
    color: var(--white);
    padding: 120px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 1;
}

.hero-content {
    max-width: 850px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(36px, 6vw, 56px);
    margin-bottom: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.hero-subtitle {
    font-size: clamp(16px, 2.5vw, 20px);
    opacity: 0.95;
    margin-bottom: 48px;
    line-height: 1.8;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 36px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background-color: var(--white);
    color: var(--primary-color);
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
    background-color: var(--accent-color);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 196, 160, 0.4);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 24px;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Quick Help Section */
.quick-help {
    padding: var(--spacing-xl) 0;
    background-color: var(--white);
    position: relative;
}

.quick-help::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.quick-help h2 {
    text-align: center;
    font-size: clamp(28px, 4vw, 40px);
    margin-bottom: 56px;
    color: var(--primary-color);
    position: relative;
}

.quick-help h2::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: 2px;
}

.helpline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.helpline-card {
    background: linear-gradient(145deg, var(--white) 0%, var(--background) 100%);
    border-radius: var(--border-radius);
    padding: 32px 28px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.helpline-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.helpline-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-8px);
    border-color: var(--secondary-color);
}

.helpline-card:hover::before {
    transform: scaleX(1);
}

.helpline-icon {
    font-size: 52px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.helpline-card h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.helpline-card p {
    color: var(--text-light);
    margin-bottom: 15px;
}

.helpline-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.helpline-link {
    font-size: 14px;
    color: var(--text-muted);
}

.helpline-link:hover {
    color: var(--primary-color);
}

/* Support Sections */
.support-section {
    padding: 80px 0;
}

.support-section.alt-bg {
    background-color: var(--background-alt);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 50px;
}

.section-header h2 {
    font-size: clamp(28px, 4vw, 40px);
    color: var(--primary-color);
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: 2px;
}

.section-header p {
    color: var(--text-light);
    font-size: clamp(16px, 2vw, 18px);
    margin-top: 12px;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.resource-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid transparent;
}

.resource-card:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-8px) scale(1.01);
    border-color: var(--secondary-color);
}

.resource-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: var(--secondary-color);
    position: relative;
    overflow: hidden;
}

.resource-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(0,0,0,0.15), transparent);
    pointer-events: none;
}

.resource-card:hover .resource-image {
    filter: brightness(1.05);
}

.mental-health-img { background: linear-gradient(135deg, #4a7c59 0%, #7eb5a6 100%); }
.mhf-img { background: linear-gradient(135deg, #2d5a4a 0%, #5a9a8a 100%); }
.helpguide-img { background: linear-gradient(135deg, #3d7a64 0%, #a8d5c9 100%); }
.beyondblue-img { background: linear-gradient(135deg, #1a4d6e 0%, #4a8bb3 100%); }
.rethink-img { background: linear-gradient(135deg, #00a89c 0%, #4dc7c0 100%); }
.sane-img { background: linear-gradient(135deg, #6c2b91 0%, #9b5db8 100%); }
.cruse-img { background: linear-gradient(135deg, #6b4c8a 0%, #9a7ab8 100%); }
.marie-curie-img { background: linear-gradient(135deg, #d4a84b 0%, #e8c878 100%); }
.wyg-img { background: linear-gradient(135deg, #4a6b7c 0%, #7a9bac 100%); }
.samaritans-img { background: linear-gradient(135deg, #1a6b4a 0%, #4a9b7a 100%); }
.alzheimers-img { background: linear-gradient(135deg, #4a1a6b 0%, #7a4a9b 100%); }
.parkinsons-img { background: linear-gradient(135deg, #1a4a6b 0%, #4a7a9b 100%); }
.mnd-img { background: linear-gradient(135deg, #6b4a1a 0%, #9b7a4a 100%); }
.ms-img { background: linear-gradient(135deg, #d45500 0%, #ff8833 100%); }
.nice-img { background: linear-gradient(135deg, #0072c6 0%, #3399dd 100%); }
.nhs-mh-img { background: linear-gradient(135deg, #005eb8 0%, #0072ce 100%); }
.rcpsych-img { background: linear-gradient(135deg, #1e3a5f 0%, #3d6a9f 100%); }
.nhs-cks-img { background: linear-gradient(135deg, #00a499 0%, #3dc7bc 100%); }
/* Financial Support Section */
.mhma-img { background: linear-gradient(135deg, #5c4d9a 0%, #8b7bc7 100%); }
.turn2us-img { background: linear-gradient(135deg, #e85d04 0%, #fb8500 100%); }
.citizensadvice-img { background: linear-gradient(135deg, #004b87 0%, #0072bc 100%); }
.carersuk-img { background: linear-gradient(135deg, #00a8a8 0%, #4dd4d4 100%); }
.mind-money-img { background: linear-gradient(135deg, #0057b7 0%, #3d8ae5 100%); }
.mariecurie-money-img { background: linear-gradient(135deg, #ffc72c 0%, #ffe066 100%); }

.resource-content {
    padding: 25px;
}

.resource-content h3 {
    font-size: 22px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.resource-content p {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 15px;
}

.resource-features {
    list-style: none;
    margin-bottom: 20px;
}

.resource-features li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
    font-size: 14px;
    color: var(--text-light);
}

.resource-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.article-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 28px;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-6px);
    border-color: transparent;
}

.article-card:hover::before {
    opacity: 1;
}

.article-date {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.article-card h3 {
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-card p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.6;
}

.article-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

.feed-sources {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.feed-sources p {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.source-logos a {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--white);
    border-radius: 20px;
    font-size: 14px;
    margin: 5px;
    box-shadow: var(--shadow);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accordion */
.resources-accordion {
    max-width: 800px;
    margin: 0 auto;
}

.accordion-item {
    background-color: var(--white);
    border-radius: var(--border-radius-sm);
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    padding: 20px 25px;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    text-align: left;
    font-family: 'Playfair Display', Georgia, serif;
}

.accordion-icon {
    font-size: 24px;
    font-weight: 400;
    transition: var(--transition);
}

.accordion-item.active .accordion-icon {
    transform: rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

.resource-list {
    list-style: none;
    padding: 0 25px 25px;
}

.resource-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.resource-list li:last-child {
    border-bottom: none;
}

.resource-list a {
    font-size: 14px;
    padding: 5px 15px;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
}

.resource-list a:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Self-Care Section */
.self-care-section {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--white);
}

.self-care-section .section-header h2 {
    color: var(--white);
}

.self-care-section .section-header p {
    color: rgba(255, 255, 255, 0.9);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.tip-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius);
    padding: 36px 28px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tip-card:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.tip-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 18px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.tip-card:hover .tip-icon {
    transform: scale(1.1);
}

.tip-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
    font-weight: 500;
}

.tip-card p {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.6;
}

/* Footer */
.footer {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.footer-section p {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.7;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.footer-section ul a:hover {
    color: var(--accent-color);
}

.footer-quote {
    font-style: italic;
    font-size: 15px;
    line-height: 1.7;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    font-size: 13px;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow);
        gap: 0;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        padding: 10px 0;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .section-header h2 {
        font-size: 28px;
    }

    .quick-help h2 {
        font-size: 28px;
    }

    .helpline-grid {
        grid-template-columns: 1fr;
    }

    .resource-grid {
        grid-template-columns: 1fr;
    }

    .tips-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 60px 0;
    }

    .hero h1 {
        font-size: 28px;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
    }
}

/* Financial Support Section - Benefits & Grants */
.benefits-quick-ref {
    margin-top: 60px;
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.benefits-quick-ref h3 {
    text-align: center;
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 30px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.benefit-item {
    background: var(--background-alt);
    padding: 25px;
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--primary-color);
}

.benefit-item h4 {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.benefit-item p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.charity-grants {
    margin-top: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: var(--border-radius);
    padding: 40px;
    color: var(--white);
}

.charity-grants h3 {
    color: var(--white);
    font-size: 28px;
    margin-bottom: 15px;
    text-align: center;
}

.charity-grants > p {
    text-align: center;
    opacity: 0.95;
    margin-bottom: 30px;
    font-size: 16px;
}

.grants-list {
    display: grid;
    gap: 15px;
}

.grant-org {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px 25px;
    border-radius: var(--border-radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.grant-org strong {
    color: var(--accent-color);
}

.grant-org a {
    color: var(--white);
    text-decoration: underline;
    font-weight: 500;
}

.grant-org a:hover {
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .benefits-quick-ref,
    .charity-grants {
        padding: 25px;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .grant-org {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   ACCESSIBILITY & FOCUS STATES
   ============================================ */

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    z-index: 10000;
    transition: top 0.3s ease;
    font-weight: 600;
}

.skip-link:focus {
    top: 10px;
}

/* Focus visible styles */
*:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* High contrast mode enhancements */
@media (prefers-contrast: high) {
    :root {
        --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        --border-color: #333;
    }
    
    .resource-card,
    .helpline-card,
    .article-card {
        border-width: 2px;
    }
}

/* ============================================
   SMOOTH SCROLL ANCHORS
   ============================================ */

[id] {
    scroll-margin-top: 100px;
}

/* ============================================
   RECOMMENDATIONS PANEL & CLICK TRACKING
   ============================================ */

/* Floating recommendations button */
#recommendations-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(44, 122, 123, 0.4);
    z-index: 1000;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s ease;
}

#recommendations-toggle.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

#recommendations-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(44, 122, 123, 0.5);
}

#recommendations-toggle:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* Recommendations panel */
#recommendations-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 360px;
    max-height: 70vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#recommendations-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
}

.rec-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.rec-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.rec-close:hover {
    opacity: 1;
}

.rec-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.rec-intro {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.5;
}

.rec-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rec-item {
    display: block;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}

.rec-item:hover {
    background: #e8f5f5;
    border-color: var(--accent-color);
    transform: translateX(4px);
}

.rec-item-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.rec-item-desc {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
    margin-bottom: 6px;
}

.rec-item-category {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rec-footer {
    padding: 12px 16px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.rec-clear {
    width: 100%;
    padding: 10px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #666;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.rec-clear:hover {
    background: #fee;
    border-color: #e74c3c;
    color: #e74c3c;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--primary-color);
    color: white;
    padding: 14px 28px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1002;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsive adjustments for recommendations */
@media (max-width: 480px) {
    #recommendations-toggle {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    #recommendations-panel {
        right: 10px;
        left: 10px;
        bottom: 80px;
        width: auto;
        max-height: 60vh;
    }
}

/* ============================================
   SEARCH FUNCTIONALITY
   ============================================ */

.search-toggle {
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    color: var(--text-color);
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-toggle:hover {
    background: var(--background-alt);
    color: var(--primary-color);
}

/* Modal base styles */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 90%;
    max-height: 70vh;
    overflow: hidden;
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.25s ease;
}

.modal[aria-hidden="false"] .modal-content {
    transform: translateY(0) scale(1);
}

/* Search Modal */
.search-modal-content {
    max-width: 650px;
}

.search-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--background);
    border-radius: var(--border-radius);
    padding: 14px 18px;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary-color);
    background: var(--white);
}

.search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

#search-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 16px;
    color: var(--text-color);
    outline: none;
}

#search-input::placeholder {
    color: var(--text-muted);
}

.search-kbd {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: inherit;
}

.search-results {
    max-height: 50vh;
    overflow-y: auto;
    padding: 16px;
}

.search-placeholder {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-light);
}

.search-placeholder p {
    margin-bottom: 20px;
}

.search-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.search-tag {
    background: var(--background-alt);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.search-tag:hover {
    background: var(--primary-color);
    color: var(--white);
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background: var(--background-alt);
}

.search-result-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.search-result-info h4 {
    font-size: 15px;
    color: var(--text-color);
    margin-bottom: 4px;
    font-family: inherit;
}

.search-result-info p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.search-result-category {
    font-size: 11px;
    color: var(--primary-color);
    background: var(--background-alt);
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 6px;
    display: inline-block;
}

.search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.search-no-results span {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

/* ============================================
   FEEDBACK BUTTONS (Like/Dislike/Comment)
   ============================================ */

.resource-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.feedback-buttons {
    display: flex;
    gap: 6px;
}

.feedback-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
}

.feedback-btn:hover {
    background: var(--background-alt);
    border-color: var(--secondary-color);
}

.feedback-btn.active {
    border-color: var(--primary-color);
}

.feedback-btn.like-btn.active {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.feedback-btn.dislike-btn.active {
    background: #ffebee;
    border-color: #ef5350;
    color: #c62828;
}

.feedback-btn.comment-btn:hover,
.feedback-btn.comment-btn.has-comments {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1565c0;
}

.feedback-icon {
    font-size: 14px;
}

.feedback-count {
    font-weight: 600;
    min-width: 12px;
}

/* ============================================
   COMMENTS MODAL
   ============================================ */

.comments-modal-content {
    max-width: 550px;
    display: flex;
    flex-direction: column;
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--background);
}

.comments-header h3 {
    font-size: 18px;
    color: var(--primary-color);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-color);
}

.comments-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    background: var(--background);
    border-radius: var(--border-radius-sm);
    padding: 14px 16px;
    border-left: 3px solid var(--secondary-color);
}

.comment-text {
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 8px;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

.comment-helpful {
    display: flex;
    gap: 8px;
}

.comment-helpful button {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--transition);
}

.comment-helpful button:hover {
    background: var(--background-alt);
    color: var(--primary-color);
}

.no-comments {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

.no-comments span {
    font-size: 36px;
    display: block;
    margin-bottom: 10px;
}

/* Comment Form */
.comment-form {
    background: var(--background);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.comment-form textarea {
    width: 100%;
    border: none;
    background: var(--white);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    color: var(--text-color);
}

.comment-form textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.comment-form textarea::placeholder {
    color: var(--text-muted);
}

.comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.char-count {
    font-size: 12px;
    color: var(--text-muted);
}

.comment-form .btn {
    padding: 10px 20px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        max-height: 80vh;
    }
    
    .resource-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .feedback-buttons {
        justify-content: center;
    }
}
