/* Satun Health Link - Design System */

:root {
    /* --- Palette --- */

    /* Primary: Navy Blue - Trust, Govt, Professional */
    --color-primary: #1e3a8a;
    --color-primary-light: #334155;

    /* Accent: MOPH Green - Health, Growth, Active */
    --color-accent: #059669;
    --color-accent-hover: #047857;
    --color-accent-light-bg: rgba(5, 150, 105, 0.05);

    /* Status Colors */
    --color-status-success: #10b981;
    --color-status-warning: #f97316;
    --color-status-info: #3b82f6;

    /* Backgrounds */
    --color-bg-body: #f8fafc;
    --color-bg-card: #ffffff;
    --color-bg-input: #f1f5f9;

    /* Text */
    --color-text-heading: #0f172a;
    /* Slate 900 */
    --color-text-body: #334155;
    /* Slate 700 */
    --color-text-muted: #94a3b8;
    /* Slate 400 */
    --color-text-light: #ffffff;

    /* Borders & Lines */
    --color-border: #e2e8f0;

    /* --- Typography --- */
    --font-heading: 'Kanit', sans-serif;
    --font-body: 'Sarabun', sans-serif;

    --text-h1: 2.5rem;
    --text-h2: 1.5rem;
    --text-h3: 1.25rem;
    --text-body: 1rem;
    /* 16px */
    --text-sm: 0.875rem;
    /* 14px */
    --text-xs: 0.75rem;
    /* 12px */

    /* --- Spacing & Layout --- */
    --header-height: 80px;
    --bottom-nav-height: 70px;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 3rem;

    --container-width: 1280px;
    --container-padding: 24px;
    /* Reduced from 1440px for better readability */


    /* --- Effects --- */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --radius-sm: 8px;
    --radius-md: 20px;
    --radius-pill: 50px;

    /* Transitions */
    --ease-out: cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- Global Reset & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-heading);
    /* Default to Kanit for UI feel */
    background-color: var(--color-bg-body);
    /* Subtle Grain/Dot Pattern */
    background-image: radial-gradient(var(--color-border) 1px, transparent 1px);
    background-size: 32px 32px;

    color: var(--color-text-body);
    line-height: 1.6;
    font-size: 15px;
    padding-bottom: var(--bottom-nav-height);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.8);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-text-heading);
    font-weight: 600;
    letter-spacing: -0.01em;
    /* Tighter heading tracking */
}

p,
span,
div {
    font-family: var(--font-body);
}

/* --- Utilities --- */
.text-primary {
    color: var(--color-primary) !important;
}

.text-accent {
    color: var(--color-accent) !important;
}

.text-muted {
    color: var(--color-text-muted) !important;
}

.bg-white {
    background-color: white !important;
}

/* --- Components --- */

/* 1. Buttons (General) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-heading);
    font-weight: 500;
    transition: all 0.3s var(--ease-out);
    cursor: pointer;
    border: none;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent) 0%, #047857 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-primary:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4);
}

.btn-primary:hover:after {
    opacity: 1;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
}

/* 2. Filter Bar (Panel Card) */
.filter-panel {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    /* Soft shadow */
    padding: 24px;
    margin-top: 1.5rem;
    /* Space from tabs */
    border: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Section Separation */
.content-separator {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-border), transparent);
    margin: 4rem 0 2rem;
    position: relative;
    width: 100%;
}

.content-separator::after {
    content: '\f103';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-bg-body);
    padding: 0 1.5rem;
    color: var(--color-text-muted);
    font-size: 1.2rem;
}


/* Row 1: Search */
.filter-row-search {
    width: 100%;
}

.search-group.full-width {
    width: 100%;
    display: flex;
    align-items: center;
    position: relative;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    /* Pill input */
    padding: 0 16px;
    height: 50px;
    transition: all 0.2s;
}

.search-group.full-width:focus-within {
    border-color: var(--color-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.1);
}

.search-icon-left {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    margin-right: 12px;
}

.search-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    height: 100%;
    font-size: 1rem;
    color: var(--color-text-body);
    font-family: var(--font-body);
    outline: none;
}

.search-clear-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.search-clear-btn:hover {
    color: var(--color-status-warning);
}


/* Row 2: Controls (Sort & Reset) */
.filter-row-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1.5rem;
}

.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-label {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.sort-dropdown {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-family: var(--font-body);
    color: var(--color-text-body);
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    background-color: white;
}

.sort-dropdown:hover {
    border-color: var(--color-primary);
}

/* Reset Button (Redesigned) */
.reset-tags-btn {
    background: #fef2f2;
    /* Red 50 */
    color: #ef4444;
    /* Red 500 */
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.reset-tags-btn:hover {
    background: #fee2e2;
    transform: translateY(-1px);
}

/* Row 3: Tags */
.filter-row-tags {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tags-header-label {
    font-size: 0.95rem;
    color: var(--color-text-heading);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tags-header-label i {
    color: var(--color-primary);
}



/* Category Tabs (Pill Style) */
.filter-tabs {
    display: flex;
    gap: 8px;
    padding-bottom: 4px;
    /* Space for focus rings/shadows */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Hide scrollbar for cleaner look */
}

.filter-tabs::-webkit-scrollbar {
    display: none;
}

.filter-tab {
    padding: 0.6rem 1.4rem;
    border-radius: 99px;
    /* Pill shape */
    background: #f1f5f9;
    /* Light slate bg */
    color: var(--color-text-body);
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-heading);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.filter-tab:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.filter-tab.active {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
    border-color: transparent;
}

/* Active Indicator (Dot) */
.filter-tab.active::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    margin-left: 4px;
    opacity: 0.8;
}

/* 2. Filter Bar (Specific) */
/* 3. Tags (Chips) */
.filter-tags {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Increased vertical spacing */
    margin-top: 1rem;
}

#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader-content {
    text-align: center;
    max-width: 500px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loader-logo-container {
    margin-bottom: 20px;
    animation: loaderPulse 2s infinite ease-in-out;
}

.loader-logo {
    width: 80px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 2, 0, 0.1));
}

@keyframes loaderPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
        filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
    }
}


.loading-text {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    color: var(--color-primary);
    font-weight: 500;
}

.loading-quote {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--color-text-muted);
    font-style: italic;
    line-height: 1.6;
    animation: fadeIn 0.8s ease-out;
}

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

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

.tags-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    /* Wrap on desktop */
    gap: 8px;
    /* Gap between chips */
    max-height: 160px;
    overflow-y: auto;
    padding-bottom: 5px;
}

/* Mobile Scroll for Tags */
@media (max-width: 768px) {
    .tags-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        max-height: none;
    }
}

.tag-chip {
    padding: 0 14px;
    /* Horizontal padding 14px */
    height: 34px;
    /* Fixed height 34px */
    border-radius: 99px;
    /* Pill radius */
    background: #fff;
    border: 1px solid #e2e8f0;
    /* Light gray border */
    font-size: 0.9rem;
    color: var(--color-text-body);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-heading);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    /* Space between icon and text */
    user-select: none;
    flex-shrink: 0;
    /* Prevent shrinking on mobile */
}

/* Default Tag Icon */
.tag-chip::before {
    content: '\f02b';
    /* FontAwesome tag icon code */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #cbd5e1;
    font-size: 0.8em;
    transition: color 0.2s;
}

.tag-chip:hover {
    border-color: var(--color-primary);
    background: #f8fafc;
}

.tag-chip:hover::before {
    color: var(--color-primary);
}

/* Active State */
.tag-chip.active {
    background: #eff6ff;
    /* Light Blue 50 */
    border-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(30, 58, 138, 0.05);
}

.tag-chip.active::before {
    content: '\f00c';
    /* Checkmark icon */
    color: var(--color-primary);
}



.reset-tags-btn {
    background: none;
    border: none;
    color: var(--color-status-warning);
    /* Orange/Red */
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-body);
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.reset-tags-btn:hover {
    background: #fff1f2;
    color: #e11d48;
}

/* 3. Search Input & Sort */
.search-container {
    flex: 1;
}

.search-group {
    display: flex;
    align-items: center;
    background: var(--color-bg-body);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 0.3rem 0.5rem 0.3rem 1.2rem;
    width: 100%;
    transition: all 0.2s;
}

.search-group:focus-within {
    background: #fff;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-light-bg);
}

.search-icon-left {
    color: var(--color-text-muted);
    margin-right: 0.5rem;
}

.search-input {
    border: none;
    background: transparent;
    padding: 0.6rem 0;
    font-size: 0.95rem;
    width: 100%;
    color: var(--color-text-heading);
    font-family: var(--font-heading);
    flex-grow: 1;
}

.search-input:focus {
    outline: none;
}

.search-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-clear-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
}

.search-clear-btn:hover {
    color: #e11d48;
    background: #fff1f2;
}

.btn-search-trigger {
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.2s;
}

.btn-search-trigger:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

/* Sort Specifics */
.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.sort-dropdown {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--color-bg-body);
    border: 1px solid var(--color-border);
    padding: 0.6rem 2.5rem 0.6rem 1.2rem;
    border-radius: 20px;
    font-family: var(--font-heading);
    color: var(--color-text-body);
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23334155' 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 1rem center;
    background-size: 1em;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sort-dropdown:hover,
.sort-dropdown:focus {
    border-color: var(--color-primary);
    background-color: #fff;
}

/* 4. Link Cards */
/* 4. Link Cards (Refined) */
/* 4. Link Cards (Refined) */
.link-item {
    background: rgba(255, 255, 255, 0.95);
    /* Whiter background */
    backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    padding: 2.2rem 1.8rem;
    /* Increased Padding */
    /* More vertical padding */
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    /* Very subtle shadow base */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: var(--color-text-body);
    display: flex;
    flex-direction: column;
    min-height: 260px;
    /* Increased Height */
    /* Taller card */
    justify-content: space-between;
    font-family: var(--font-body);
    gap: 1.5rem;
    /* Increased Gap */
    position: relative;
    overflow: hidden;
}

/* Category Color Coding (Top Border Accent) */
.link-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--cat-color, var(--color-border));
    /* Dynamic color from inline variable */
    transition: height 0.2s;
}



.link-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: transparent;
    z-index: 10;
}

.link-item.opening {
    transform: scale(0.96) translateY(0);
    opacity: 0.85;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}


.link-item:hover::before {
    height: 6px;
    /* Thicker on hover */
}

/* Top Row: Title */
.card-top {
    margin-bottom: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-logo-inline {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 5px;
    opacity: 0.9;
    background: #f8fafc;
    padding: 2px;
}

.card-top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}


.card-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    /* Larger */
    font-weight: 700;
    /* Bold */
    color: var(--color-text-heading);
    line-height: 1.3;
    margin: 0;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* 2 lines max */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 3.4em;
    /* Reserve space for 2 lines */
}

.badge-new {
    display: inline-block;
    padding: 2px 6px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    border-radius: 4px;
    font-weight: 500;
    vertical-align: middle;
    margin-left: 4px;
    animation: fadePulse 2s infinite;
}

@keyframes fadePulse {
    0% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.8;
    }
}

.btn-copy-link {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.btn-copy-link:hover {
    background: #f1f5f9;
    color: var(--color-primary);
    transform: scale(1.1);
}

.btn-favorite.active {
    color: #f59e0b;
    /* Amber/Gold */
}

.btn-favorite.active i {
    font-weight: 900;
    /* Solid star */
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.link-item:hover .card-title {
    color: var(--color-primary);
    /* Use Primary Blue on hover */
}

/* Mid Row: Tags (Badges) */
.card-mid {
    flex-grow: 1;
    /* Pushes bottom row down */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-badge {
    font-size: 0.7rem;
    /* Smaller */
    padding: 3px 10px;
    border-radius: 12px;
    background: #f8fafc;
    /* Very light */
    color: var(--color-text-muted);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.link-item:hover .tag-badge {
    background: white;
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Bot Row: Stats */
.card-bot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.8rem;
    /* Smaller stats */
    color: #64748b;
    /* Darker gray for better contrast (was #94a3b8) */
}

/* Link Grid Layout */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-item i {
    opacity: 0.7;
}

/* 5. Section Headers (Refined) */
.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--color-text-heading);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-subtitle {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin: 4px 0 0 0;
    font-weight: 400;
}

.header-divider {
    height: 1px;
    background: linear-gradient(to right, #cbd5e1 0%, rgba(226, 232, 240, 0) 100%);
    width: 100%;
    margin-bottom: 1.5rem;
}

/* --- Global Container Utility --- */
.container,
.nav-container,
.filter-container,
.main-content,
.footer-container {
    width: 100%;
    max-width: var(--container-width);
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
    margin: 0 auto;
}

/* 6. Hero */
.hero-section {
    text-align: center;
    padding: 6rem var(--container-padding) 3rem;
    background:
        radial-gradient(circle at 15% 50%, rgba(30, 58, 138, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(5, 150, 105, 0.08), transparent 25%);
    position: relative;
    /* Max-width handled by global utility */
}

.hero-logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 1.5rem;
    background: transparent;
    border: none;
    box-shadow: none;
}

.hero-title {
    font-size: 2.5rem;
    /* Larger */
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.8rem;
    letter-spacing: -0.02em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

/* 7. Footer */
.main-footer {
    border-top: 1px solid var(--color-border);
    padding: 3rem 1rem 6rem;
    background: white;
    text-align: center;
    color: var(--color-text-muted);
    font-family: var(--font-body);
}

/* Responsive */
/* 7. Navbar */
.main-navbar {
    position: sticky;
    top: 0;
    z-index: 2000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    padding: 0.8rem 0;
    box-shadow: var(--shadow-sm);
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-header-add {
    background: linear-gradient(135deg, var(--color-accent) 0%, #047857 100%);
    color: white;
    padding: 8px 18px;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
    transition: all 0.3s;
}

.btn-header-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.3);
}

.btn-header-report {
    background: #f1f5f9;
    color: var(--color-text-body);
    padding: 8px 18px;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.btn-header-report:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

@media (max-width: 992px) {
    .nav-actions {
        display: none;
    }
}


.nav-container {
    /* Layout handled by global .container utility */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 1.1rem;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--color-text-body);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-accent);
}

/* 8. Hero Instructions */
.hero-instructions {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.6);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    color: var(--color-text-body);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.instruction-item i {
    font-size: 1rem;
}

/* 9. Footer Stats */
.footer-stats-bar {
    background: #f8fafc;
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.mini-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    /* Ensure this variable is dark enough, or override: #475569 */
}

.mini-stat span {
    font-weight: 600;
    color: var(--color-text-heading);
}

.mini-stat-divider {
    width: 1px;
    height: 16px;
    background: var(--color-border);
}

/* Responsive */
@media (max-width: 992px) {

    /* Navbar Adjustment */
    .nav-links {
        display: none;
        /* Hide for now on mobile or add hamburger later if needed, user didn't specify mobile nav explicitly but simple scroll links might crowd */
    }

    /* Better Vertical Spacing on Mobile */
    .filter-row-top {
        gap: 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .filter-pills {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 8px;
        /* More scroll space */
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        mask-image: linear-gradient(to right, black 85%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
    }

    .search-container {
        order: 2;
        margin-top: 0.5rem;
    }

    .sort-wrapper {
        order: 3;
        margin-top: 0.5rem;
    }

    .filter-row-bottom {
        padding-top: 0.8rem;
    }

    .hero-instructions {
        gap: 0.8rem;
    }

    .instruction-item {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    /* Mobile: 1 Column Grid & Better Spacing */
    .link-grid {
        grid-template-columns: 1fr;
        /* Force 1 column on mobile */
        gap: 1.5rem;
    }

    .link-item {
        min-height: auto;
        /* Allow flexible height */
        padding: 1.5rem;
    }

    /* Improve Touch Targets on Mobile */
    .filter-pill,
    .tag-chip,
    .btn {
        min-height: 44px;
        /* Minimum touch target */
        display: inline-flex;
        align-items: center;
    }
}

/* =========================================
   7. New Dark Footer (Professional)
   ========================================= */
.footer-dark {
    background: #0f172a;
    color: #94a3b8;
    padding: 80px 0 40px;
    margin-top: auto;
    font-family: var(--font-body);
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-dark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.footer-dark .footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

/* Left Col: Contact */
.footer-brand h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #60a5fa, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-info-item i {
    margin-top: 4px;
}

/* Right Col: Stats */
.footer-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-box {
    background: rgba(30, 41, 59, 0.5);
    /* Slate 800/50 */
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s;
}

.stat-box:hover {
    transform: translateY(-2px);
    background: rgba(30, 41, 59, 0.8);
}

.stat-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.icon-online {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.icon-week {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.icon-month {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.icon-year {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.stat-info span.label {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
}

.stat-info span.value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(51, 65, 85, 0.5);
    margin-top: 3rem;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
}

/* Provide Feedback Button in Footer */
.btn-footer-report {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 50px;
    margin-top: 1.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-footer-report:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-dark .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}


/* =========================================
   8. Report Modal (Popup)
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s;
}

.modal-overlay.show .modal-card {
    transform: scale(1);
}

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

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-heading);
    margin: 0;
}

.btn-close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-text-heading);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-submit-report {
    width: 100%;
    padding: 0.8rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

.btn-submit-report:hover {
    background: var(--color-primary-dark);
}

.btn-submit-report:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* Success Animation Step */
.success-message {
    text-align: center;
    padding: 2rem 0;
}

.success-icon {
    font-size: 3rem;
    color: #22c55e;
    margin-bottom: 1rem;
}