/* Trust Connect Intel - Modern & Clean */
:root {
    color-scheme: light dark;
    --primary: #4f1c70;
    --primary-light: #6b2d8f;
    --accent: #f28284;
    --accent-light: #f89ea0;
    --bg-gradient-light: linear-gradient(135deg, #faf8fc 0%, #f5f3f8 50%, #f8f7fb 100%);
    --bg-gradient-dark: linear-gradient(135deg, #1a1625 0%, #1e1a2e 50%, #1a1625 100%);
    --bg-light: #f8f9fa;
    --bg-dark: #1a1625;
    --text-light: #2d2d2d;
    --text-muted: #6b7280;
    --text-dark: #f8f2ff;
    --border-light: rgba(0, 0, 0, 0.1);
    --border-dark: rgba(255, 255, 255, 0.12);
    --transition-fast: 0.15s ease;
    --transition-medium: 0.25s ease;
    --transition-theme: 0.4s ease;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 6px 16px rgba(79, 28, 112, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 999px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    background: var(--bg-gradient-light);
    min-height: 100%;
}

html.dark-mode {
    background: var(--bg-gradient-dark);
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-gradient-light);
    color: var(--text-light);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    font-size: 15px;
    position: relative;
    transition: background var(--transition-theme), color var(--transition-theme);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(242, 130, 132, 0.08), transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(79, 28, 112, 0.08), transparent 50%);
    pointer-events: none;
    z-index: -1;
    transition: background var(--transition-theme);
}

body.theme-loading {
    visibility: hidden;
}

/* Header */
header {
    background: #fff;
    border-bottom: 1px solid var(--border-light);
    padding: 0.65rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-theme), border-color var(--transition-theme), box-shadow var(--transition-theme);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
}

.logo-container img {
    height: 42px;
    max-width: 210px;
    object-fit: contain;
}

#toggleTheme {
    background: #fff;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.9rem;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

#toggleTheme:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

#toggleTheme:active {
    transform: translateY(0);
}

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

/* Hoofdinhoud */
main {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 1.25rem 2.5rem;
}

h1 {
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    margin: 0 0 0.5rem;
    text-align: center;
    color: var(--primary);
    font-weight: 700;
    transition: color var(--transition-theme);
}

.subtext {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 auto 1.25rem;
    max-width: 650px;
    line-height: 1.55;
    transition: color var(--transition-theme);
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-theme), border-color var(--transition-theme), box-shadow var(--transition-theme);
}

.filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn.active {
    background: var(--accent);
    box-shadow: 0 4px 12px rgba(242, 130, 132, 0.3);
}

.btn.active:hover {
    background: var(--accent-light);
    box-shadow: 0 6px 16px rgba(242, 130, 132, 0.35);
}

/* Alle categorie buttons standaard paars, actief = roze */
.btn.CVE,
.btn.Zero-Day,
.btn.Informatief {
    background: var(--primary);
}

.btn.CVE:hover,
.btn.Zero-Day:hover,
.btn.Informatief:hover {
    background: var(--primary-light);
}

.btn.CVE.active,
.btn.Zero-Day.active,
.btn.Informatief.active {
    background: var(--accent);
    box-shadow: 0 4px 12px rgba(242, 130, 132, 0.3);
}

.btn.CVE.active:hover,
.btn.Zero-Day.active:hover,
.btn.Informatief.active:hover {
    background: var(--accent-light);
}

.meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.right-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Search */
.search-form-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-form-inline input[type="text"] {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: #f9fafb;
    color: var(--text-light);
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    max-width: 200px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-theme), color var(--transition-theme);
}

.search-form-inline input[type="text"]::placeholder {
    color: #9ca3af;
}

.search-form-inline input[type="text"]:focus {
    border-color: var(--primary);
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 28, 112, 0.1);
}

.btn-search {
    padding: 0.5rem 0.85rem;
}

/* Filter Groups */
.filter-groups {
    display: flex;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.filter-group {
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 0.75rem 1rem;
    flex: 1;
    min-width: 200px;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-theme), border-color var(--transition-theme), box-shadow var(--transition-theme);
}

.filter-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    transition: color var(--transition-theme);
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-light);
    background: #f9fafb;
    color: var(--text-light);
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-theme), color var(--transition-theme);
}

.chip:hover {
    background: rgba(79, 28, 112, 0.08);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(242, 130, 132, 0.25);
}

.chip.active:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
}

/* Feed Cards */
.feed-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-medium), box-shadow var(--transition-medium), border-color var(--transition-medium), background var(--transition-theme);
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.card-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #f3f4f6;
}

.card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.category {
    align-self: flex-start;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #fff;
}

.category.CVE { background: #dc2626; }
.category.Zero-Day { background: #be185d; }
.category.Informatief { background: var(--primary); }

.card-title {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    font-weight: 600;
    color: var(--text-light);
    transition: color var(--transition-theme);
}

.summary {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    transition: color var(--transition-theme);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: #f9fafb;
    border-top: 1px solid var(--border-light);
    transition: background var(--transition-theme), border-color var(--transition-theme), color var(--transition-theme);
}

.source {
    line-height: 1.35;
}

.pubdate {
    display: block;
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 0.15rem;
}

.open-indicator {
    font-weight: 600;
    color: var(--accent);
    font-size: 0.8rem;
    transition: color var(--transition-fast);
}

.card:hover .open-indicator {
    color: var(--primary);
}

/* Pagination */
.pagination {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
}

.pagination-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.page-btn {
    background: #fff;
    border: 1px solid var(--border-light);
    color: var(--text-light);
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-theme), color var(--transition-theme);
}

.page-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.page-btn.disabled {
    color: #9ca3af;
    pointer-events: none;
    opacity: 0.5;
    box-shadow: none;
}

.page-numbers {
    display: flex;
    gap: 0.35rem;
}

.page-number {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--border-light);
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-theme), color var(--transition-theme);
}

.page-number:hover {
    background: rgba(79, 28, 112, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

.page-number.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(242, 130, 132, 0.25);
}

.page-ellipsis {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0 0.3rem;
}

/* No Results */
.no-results {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 3rem;
}

/* Footer */
footer {
    background: #fff;
    border-top: 1px solid var(--border-light);
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: background var(--transition-theme), border-color var(--transition-theme), color var(--transition-theme), box-shadow var(--transition-theme);
}

.footer-version {
    font-size: 0.65rem;
    color: #9ca3af;
    margin-top: 0.2rem;
}

/* Links */
a {
    color: inherit;
}

a:hover {
    text-decoration: none;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    header {
        padding: 0.5rem 0.75rem;
    }

    .logo-container img {
        height: 36px;
        max-width: 180px;
    }

    #toggleTheme {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
    }

    main {
        padding: 1rem 0.75rem 1.5rem;
    }

    h1 {
        font-size: 1.1rem;
        margin-bottom: 0.35rem;
    }

    .subtext {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }

    .controls {
        padding: 0.75rem;
        gap: 0.6rem;
    }

    .btn {
        padding: 0.45rem 0.8rem;
        font-size: 0.78rem;
    }

    .meta {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .right-controls {
        width: 100%;
    }

    .search-form-inline {
        width: 100%;
    }

    .search-form-inline input[type="text"] {
        flex: 1;
        max-width: none;
    }

    .filter-groups {
        flex-direction: column;
        gap: 0.6rem;
    }

    .filter-group {
        min-width: 0;
        padding: 0.65rem 0.75rem;
    }

    .feed-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .card-img {
        height: 140px;
    }

    .card-content {
        padding: 0.85rem;
    }

    .card-title {
        font-size: 0.9rem;
    }

    .card-footer {
        padding: 0.55rem 0.85rem;
    }

    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }

    footer {
        padding: 0.6rem;
    }
}

@media (max-width: 480px) {
    .logo-container img {
        height: 32px;
        max-width: 160px;
    }

    h1 {
        font-size: 1rem;
    }

    .filters {
        gap: 0.35rem;
    }

    .btn {
        padding: 0.4rem 0.65rem;
        font-size: 0.75rem;
    }

    .card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
}

/* ========================================
   DARK MODE
   ======================================== */
.dark-mode {
    background: var(--bg-gradient-dark);
    color: var(--text-dark);
}

.dark-mode::before {
    background:
        radial-gradient(circle at 10% 20%, rgba(242, 130, 132, 0.12), transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(79, 28, 112, 0.15), transparent 50%);
}

.dark-mode h1 {
    color: #fff;
}

.dark-mode header,
.dark-mode footer {
    background: #1e1a2e;
    border-color: var(--border-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dark-mode .subtext,
.dark-mode .timestamp,
.dark-mode .filter-label,
.dark-mode .pagination-meta {
    color: rgba(255, 255, 255, 0.65);
}

.dark-mode .controls,
.dark-mode .filter-group,
.dark-mode .card {
    background: #252136;
    border-color: var(--border-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.dark-mode .card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(242, 130, 132, 0.15);
}

.dark-mode .card-footer {
    background: #1e1a2e;
    border-color: var(--border-dark);
}

.dark-mode .card-img {
    background: #1e1a2e;
}

.dark-mode .card-title {
    color: #fff;
}

.dark-mode .summary,
.dark-mode .source {
    color: rgba(255, 255, 255, 0.65);
}

.dark-mode .pubdate {
    color: rgba(255, 255, 255, 0.45);
}

.dark-mode .open-indicator {
    color: var(--accent);
}

.dark-mode .card:hover .open-indicator {
    color: var(--accent-light);
}

.dark-mode .search-form-inline input[type="text"] {
    background: #1e1a2e;
    border-color: var(--border-dark);
    color: #fff;
}

.dark-mode .search-form-inline input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.dark-mode .search-form-inline input[type="text"]:focus {
    border-color: var(--accent);
    background: #2a2540;
    box-shadow: 0 0 0 3px rgba(242, 130, 132, 0.15);
}

.dark-mode .chip {
    background: #1e1a2e;
    border-color: var(--border-dark);
    color: rgba(255, 255, 255, 0.8);
}

.dark-mode .chip:hover {
    background: rgba(242, 130, 132, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

.dark-mode .chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1628;
}

.dark-mode .chip.active:hover {
    background: var(--accent-light);
}

.dark-mode .page-btn,
.dark-mode .page-number {
    background: #252136;
    border-color: var(--border-dark);
    color: rgba(255, 255, 255, 0.8);
}

.dark-mode .page-btn:hover,
.dark-mode .page-number:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1628;
}

.dark-mode .page-number.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1628;
}

.dark-mode .page-btn.disabled {
    color: rgba(255, 255, 255, 0.3);
}

.dark-mode #toggleTheme {
    background: #252136;
    border-color: var(--border-dark);
    color: rgba(255, 255, 255, 0.7);
}

.dark-mode #toggleTheme:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1628;
}

/* Dark mode: alle buttons standaard paars, actief = roze */
.dark-mode .btn {
    background: var(--primary);
    color: #fff;
}

.dark-mode .btn:hover {
    background: var(--primary-light);
    box-shadow: 0 6px 16px rgba(79, 28, 112, 0.3);
}

.dark-mode .btn.active {
    background: var(--accent);
    color: #1a1628;
    box-shadow: 0 4px 12px rgba(242, 130, 132, 0.35);
}

.dark-mode .btn.active:hover {
    background: var(--accent-light);
}

.dark-mode .btn.CVE,
.dark-mode .btn.Zero-Day,
.dark-mode .btn.Informatief {
    background: var(--primary);
    color: #fff;
}

.dark-mode .btn.CVE:hover,
.dark-mode .btn.Zero-Day:hover,
.dark-mode .btn.Informatief:hover {
    background: var(--primary-light);
}

.dark-mode .btn.CVE.active,
.dark-mode .btn.Zero-Day.active,
.dark-mode .btn.Informatief.active {
    background: var(--accent);
    color: #1a1628;
}

.dark-mode .category.Informatief {
    background: #7c3aed;
}

.dark-mode .footer-version {
    color: rgba(255, 255, 255, 0.35);
}

.dark-mode .no-results {
    color: rgba(255, 255, 255, 0.6);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
