/*
CVE Page Specific Styles
Author: Your Name
Date: 2024-07-29
*/

/* 1. Root Variables and General Setup
--------------------------------------------------------------------------------
*/
:root {
    --bg-main: #111216;
    /* 主背景色 */
    --bg-sidebar: #1E1F26;
    /* 侧边栏背景 */
    --bg-card-blue: linear-gradient(135deg, #1F3A59 0%, #111A24 100%);
    --bg-card-purple: linear-gradient(135deg, #4A2D5E 0%, #1E1224 100%);
    --bg-card-red: linear-gradient(135deg, #5E2D2D 0%, #241212 100%);
    --bg-card-yellow: linear-gradient(135deg, #5E5B2D 0%, #242312 100%);
    --border-color: #3A3C4A;
    --text-primary: #E0E1E6;
    /* 主要文字颜色 */
    --text-secondary: #8a9093;
    /*链接颜色*/
    --link-color: #047c3a;
    /* 次要文字颜色 */
    --text-title: #FFFFFF;
    --accent-yellow: #E8D637;
    --accent-orange: #E88B37;
    --accent-red: #E84737;
    --font-family-main: 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

.cve-page {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-family-main);
}

/* 2. Page Layout
--------------------------------------------------------------------------------
*/

.page-container {
    display: block;
    overflow: visible;
    /* This is the correct fix */
}

.page-layout {
    display: flex;
    min-height: calc(100vh - 80px);
    /* Assuming header is 80px */
}







.main-content {
    flex-grow: 1;
    padding-top: calc(var(--header-height) + 24px);
}




/* 3. Components
--------------------------------------------------------------------------------
*/

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header .header-content {
    display: flex;
    align-items: baseline;
    gap: 16px;
}

.page-title {
    font-size: 28px;
    color: var(--text-title);
}

.page-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}

/* Filters Section */
/* Remove sidebar styling */
.page-sidebar {
    background: none;
    border: none;
    padding: 0;
    width: auto;
    position: static;
    /* Let dropdowns break out */
}

.filters-section {
    margin-bottom: 1.5rem;
}

.filters-container {
    display: flex;
    justify-content: space-between;
    /* Push children to either side */
    align-items: center;
}

.filter-group-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    /* Space between the two dropdowns */
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* Space between label and control */
}

.filter-label {
    color: var(--text-secondary);
    white-space: nowrap;
    /* Prevent label from wrapping */
}

.filter-label {
    color: var(--text-secondary);
}

.subscribe-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.subscribe-btn:hover {
    background-color: #2A2D35;
    color: var(--text-primary);
    border-color: #4A4D55;
}

/* Search Group Styles */
.search-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input-wrapper {
    position: relative;
}

.search-input {
    background-color: #2A2D35;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 8px 40px 8px 16px;
    /* Make space for the icon */
    width: 250px;
    /* Adjust width as needed */
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-yellow);
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
}

/* 4. CVE Grid and Cards
--------------------------------------------------------------------------------
*/
.cve-grid-section {
    padding-top: 16px;
}

.cve-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.cve-card {
    border-radius: 12px;
    padding: 24px;
    border: 1px solid transparent;
    transition: transform 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    /* Make columns stretch to full height */
}

.cve-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Card Backgrounds */
.cve-card.color-blue {
    background: var(--bg-card-blue);
}

.cve-card.color-purple {
    background: var(--bg-card-purple);
}

.cve-card.color-red {
    background: var(--bg-card-red);
}

.cve-card.color-yellow {
    background: var(--bg-card-yellow);
}

/* Card Content */
.card-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Pushes action to the bottom */
    flex-grow: 1;
    /* Allows the left side to take up available space */
}

.card-info {
    margin-bottom: 16px;
    /* Space between info and button */
}

.card-title {
    font-size: 18px;
    color: var(--text-title);
    margin-bottom: 8px;
}

.card-meta {
    font-size: 14px;
    color: var(--text-secondary);
}

.card-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 24px;
    /* Space between text and image */
}

.card-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    background-color: transparent;
    /* Ensure SVG has no background */
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 32px;
}

.load-more-btn {
    background-color: #2A2D35;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Custom Select Dropdown */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 240px;
    /* Adjust width as needed */
}



.custom-select-trigger {
    background-color: #2A2D35;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-select.open .custom-select-trigger {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.arrow {
    width: 10px;
    height: 10px;
    border-left: 2px solid var(--text-secondary);
    border-bottom: 2px solid var(--text-secondary);
    transform: rotate(-45deg);
    transition: transform 0.3s ease;
}

.custom-select.open .arrow {
    transform: rotate(135deg);
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #2A2D35;
    border: 1px solid var(--border-color);
    border-top: none;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    /* Hidden by default */
}

.custom-select.open .custom-options {
    display: block;
}

.custom-option {
    display: block;
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    font-size: 14px;
}

.custom-option:hover {
    background-color: #3a3d45;
}

.custom-option.selected {
    background-color: #1F3A59;
    font-weight: bold;
}


/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 32px;
}

.pagination-container button {
    background-color: #2A2D35;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    margin: 0 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

.pagination-container button:hover {
    background-color: #3a3d45;
    border-color: var(--accent-yellow);
}

.pagination-container button.active {
    background-color: var(--accent-yellow);
    color: #111216;
    border-color: var(--accent-yellow);
    font-weight: bold;
}

.pagination-container button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}