/* Scrollbar for History Container */
.history-container::-webkit-scrollbar {
    width: 10px;
}

.history-container {
    scrollbar-width: thin;
    scrollbar-color: #717171 transparent;
}

.history-container::-webkit-scrollbar-track {
    background: transparent;
}

.history-container::-webkit-scrollbar-thumb {
    background: #717171;
    border-radius: 5px;
    border: 2px solid #0f0f0f;
    /* Match bg to create padding look */
}

.history-container::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* History Menu Dropdown */
.history-menu-dropdown {
    position: absolute;
    top: 40px;
    right: 10px;
    background: #282828;
    border-radius: 4px;
    width: 260px;
    box-shadow: 0 4px 32px 0 rgba(0, 0, 0, 0.5);
    z-index: 999;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
}

.history-menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
    height: 36px;
    color: #f1f1f1;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.history-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.history-menu-icon {
    width: 24px;
    text-align: center;
    color: #aaa;
    font-size: 16px;
}

/* History Header Layout */
.history-search-container {
    padding-bottom: 24px;
    display: flex;
    justify-content: center;
}

.history-search-bar {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 600px;
    height: 40px;
    background: transparent;
    border: none;
    padding: 0;
    overflow: visible;
}

/* Remove parent focus logic, move to wrapper */
.history-search-bar:focus-within {
    border: none;
    box-shadow: none;
}

.history-search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-search);
    border: 1px solid var(--border-search);
    border-radius: 40px 0 0 40px;
    padding-left: 16px;
    position: relative;
    /* For z-index overlapping */
}

.history-search-input-wrapper:focus-within {
    border-color: #1c62b9;
    /* Blue border */
    /* Only on the input part */
    z-index: 2;
    /* Bring above button border if needed */
    margin-left: 0;
}

.history-search-bar input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-family: "Roboto", Arial, sans-serif;
    /* Explicitly set font */
    font-weight: 400;
    /* Regular weight, but color makes it bold */
    font-size: 16px;
    line-height: 24px;
    padding: 0 4px;
    /* Slight breathing room */
}

.history-search-bar input::placeholder {
    color: var(--text-muted);
}

.history-search-btn {
    width: 64px;
    background: var(--bg-search-btn);
    border: 1px solid var(--border-search);
    border-radius: 0 40px 40px 0;
    margin-left: -1px;
    /* Overlap borders */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s;
    padding: 0;
    z-index: 1;
    border-left: 1px solid var(--border-search);
}

.history-search-btn:hover {
    background: var(--hover-overlay);
    /* Or just use specific hover color */
    color: var(--text-main);
}

.history-page-header-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.history-page-title {
    font-size: 36px;
    font-weight: 700;
}

.history-filters {
    display: flex;
    gap: 8px;
}

.history-chip {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.history-chip:hover {
    background: rgba(255, 255, 255, 0.2);
}

.history-chip.active {
    background: var(--bg-chip-active);
    color: var(--text-chip-active);
}

/* History Card Styling */
.history-card {
    display: flex;
    gap: 16px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.1s;
    position: relative;
    margin-bottom: 8px;
    width: 100%;
    /* Force full width */
    box-sizing: border-box;
    align-items: flex-start;
}

.history-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .history-card:hover {
    background: #e5e5e5;
}

/* History Meta Data */
.history-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    /* Take remaining space */
    min-width: 0;
    margin-top: 4px;
}

.history-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-main);
    line-height: 26px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 2px;
}

.history-channel {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.history-desc {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}