/* ChouetteVeille v4 - Apple/Jony Ive Design */

:root {
    --bg: #FFFFFF;
    --text: #1D1D1F;
    --text-secondary: #86868B;
    --border: #D2D2D7;
    --critique: #FF3B30;
    --importante: #FF9500;
    --accent: #007AFF;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --bg: #000000;
    --text: #F5F5F7;
    --text-secondary: #86868B;
    --border: #424245;
    --shadow: 0 2px 8px rgba(255, 255, 255, 0.04);
    --shadow-hover: 0 4px 16px rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

/* Header */
.topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    align-items: center;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.owl {
    font-size: 32px;
}

.title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.tagline {
    font-size: 13px;
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    max-width: 500px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.live-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--border);
}

/* Filters */
.filters {
    display: flex;
    gap: 16px;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--border);
}

.filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
}

.section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.section-title.critique {
    color: var(--critique);
}

.section-title.importante {
    color: var(--importante);
}

/* Cards */
.cards-grid {
    display: grid;
    gap: 24px;
}

.card {
    background: var(--bg);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.card[data-severity="CRITIQUE"] {
    border-left-color: var(--critique);
}

.card[data-severity="IMPORTANTE"] {
    border-left-color: var(--importante);
}

.cve-id {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.product {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.summary {
    font-size: 19px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.badges {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.badge.critique {
    background: rgba(255, 59, 48, 0.1);
    color: var(--critique);
}

.badge.importante {
    background: rgba(255, 149, 0, 0.1);
    color: var(--importante);
}

.tags {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tags span {
    padding: 4px 12px;
    border-radius: 16px;
    background: #F5F5F7;
    color: var(--text-secondary);
    font-size: 13px;
}

.timestamp {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg);
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--border);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--text-secondary);
    color: white;
}

.modal-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-product {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-summary {
    font-size: 19px;
    line-height: 1.6;
    margin-bottom: 32px;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 24px;
}

.modal-section h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 12px;
}

.cvss-score {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 12px;
}

.cvss-list {
    font-size: 13px;
    color: var(--text-secondary);
    display: grid;
    gap: 6px;
}

.refs a {
    display: block;
    color: var(--accent);
    font-size: 14px;
    text-decoration: none;
    margin-bottom: 8px;
}

.refs a:hover {
    text-decoration: underline;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--border);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
}

@media (max-width: 900px) {
    .topbar {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 24px;
    }

    .modal-grid {
        grid-template-columns: 1fr;
    }
}