:root {
    --bg-color: #010101;
    --text-primary: #ededed;
    --text-secondary: #6e6e6e;
    --accent: #ffffff;
    --card-bg: rgba(20, 20, 20, 0.4);
    --card-hover: rgba(30, 30, 30, 0.6);
    --border-color: rgba(255, 255, 255, 0.06);
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

body.light-mode {
    --bg-color: #f5f5f5;
    --text-primary: #1a1a1a;
    --text-secondary: #6e6e6e;
    --accent: #4a7cff;
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-hover: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .background-mesh {
    background: var(--bg-color);
    opacity: 1;
}

body.light-mode .hero-stage {
    background: var(--bg-color);
    opacity: 1;
}

body.light-mode .hero-stage {
    background: var(--bg-color);
}

body.light-mode .result-item.selected {
    background: rgba(74, 124, 255, 0.08);
    border-color: rgba(74, 124, 255, 0.3);
    box-shadow: 0 0 0 1px rgba(74, 124, 255, 0.15),
                0 0 20px rgba(74, 124, 255, 0.1),
                0 6px 20px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-mode .result-item.selected::before {
    background: linear-gradient(to bottom, rgba(74, 124, 255, 0.6), rgba(179, 230, 255, 0.4));
    box-shadow: 0 0 12px rgba(74, 124, 255, 0.3);
}

body.light-mode .search-bar-container input {
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .search-bar-container input:focus {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(74, 124, 255, 0.3);
    box-shadow: 0 0 0 2px rgba(74, 124, 255, 0.1), 
                0 4px 20px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.light-mode .logo-text {
    color: #1a1a1a;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

body.light-mode .result-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

body.light-mode .result-url {
    color: #666;
    opacity: 0.8;
}

body.light-mode .result-desc {
    color: #555;
}

body.light-mode .result-title {
    color: var(--text-primary);
}

body.light-mode .result-title:hover {
    color: var(--accent);
}

body.light-mode .browser-mockup {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .browser-header {
    background: #f8f8f8;
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .code-sidebar {
    background: rgba(250, 250, 250, 0.8);
    border-right-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .summary-img-placeholder {
    background-color: #e0e0e0;
}

body.light-mode .summary-text {
    color: #333;
}

body.light-mode .skeleton-text {
    background: #e0e0e0;
}

body.light-mode .placeholder-message {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.5);
}

body.light-mode .modal-card {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

body.light-mode .modal-close {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .modal-close:hover {
    background: rgba(0, 0, 0, 0.08);
}

body.light-mode .modal-form input,
body.light-mode .modal-form textarea {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .modal-form input:focus,
body.light-mode .modal-form textarea:focus {
    border-color: rgba(74, 124, 255, 0.3);
    background: rgba(255, 255, 255, 0.95);
}

body.light-mode .mini-player-badge {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .mini-toggle-btn {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .mini-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

body.light-mode .add-site-btn,
body.light-mode .theme-toggle-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

body.light-mode .add-site-btn:hover,
body.light-mode .theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

body.light-mode .search-header.active {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .code-controls .chip.active,
body.light-mode .code-controls .chip:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-mode .repo-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

body.light-mode .repo-item.active {
    background: rgba(74, 124, 255, 0.08);
    border-color: rgba(74, 124, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.light-mode .code-detail {
    background: radial-gradient(circle at top right, rgba(74, 124, 255, 0.05), transparent 40%);
}

body.light-mode .music-item {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .music-item:hover {
    background: rgba(255, 255, 255, 0.8);
}

body.light-mode .music-item.playing {
    border-color: rgba(74, 124, 255, 0.3);
    background: rgba(74, 124, 255, 0.08);
}

body.light-mode .pagination-wrapper {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .summary-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .player-toggle-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .player-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

body.light-mode .file-tree-panel {
    background: rgba(250, 250, 250, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .markdown-body {
    color: #24292e;
}

body.light-mode .markdown-body h1 {
    color: #1a1a1a;
    border-bottom-color: #e1e4e8;
}

body.light-mode .markdown-body h2 {
    color: #1a1a1a;
    border-bottom-color: #e1e4e8;
}

body.light-mode .markdown-body a {
    color: #0366d6;
}

body.light-mode .markdown-body code {
    background: rgba(27, 31, 35, 0.1);
    color: #e83e8c;
}

body.light-mode .markdown-body pre {
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
}

body.light-mode .markdown-body pre code {
    color: #24292e;
}

body.light-mode .code-preview-panel {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .empty-icon-circle {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Search icon and placeholder */
body.light-mode .search-icon {
    color: #666;
}

body.light-mode .search-bar-container input::placeholder {
    color: #999;
}

body.light-mode .search-bar-container input:focus::placeholder {
    color: #bbb;
}

/* Search button */
body.light-mode .search-button {
    color: #666;
}

body.light-mode .search-button:hover {
    color: #1a1a1a;
    background: rgba(0, 0, 0, 0.05);
}

/* Music player container */
body.light-mode .music-player-container {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode #audioPlayer {
    background: rgba(240, 240, 240, 0.8);
}

body.light-mode #audioPlayer::-webkit-media-controls-panel {
    background-color: rgba(240, 240, 240, 0.95);
}

body.light-mode #audioPlayer::-webkit-media-controls-play-button,
body.light-mode #audioPlayer::-webkit-media-controls-volume-slider,
body.light-mode #audioPlayer::-webkit-media-controls-timeline {
    filter: none;
}

/* Music action button */
body.light-mode .music-action-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .music-action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Browser mockup elements */
body.light-mode .dots span {
    background: #ccc;
}

body.light-mode .address-bar {
    color: #666;
}

body.light-mode .preview-content-area {
    background: #f5f5f5;
}

/* Pagination */
body.light-mode .pagination-wrapper {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .page-number:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .page-number.active {
    background: #1a1a1a;
    color: #ffffff;
}

/* Code sidebar */
body.light-mode .code-sidebar {
    background: rgba(250, 250, 250, 0.9);
    border-right-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .code-detail {
    background: radial-gradient(circle at top right, rgba(74, 124, 255, 0.05), transparent 40%);
}

/* Repo badge */
body.light-mode .repo-badge {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
}

/* Action buttons */
body.light-mode .action-btn {
    background: #1a1a1a;
    color: #ffffff;
}

body.light-mode .action-btn.secondary {
    background: transparent;
    border-color: rgba(0, 0, 0, 0.2);
    color: #1a1a1a;
}

body.light-mode .action-btn.secondary:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* File items */
body.light-mode .file-item {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .file-item:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Code controls chip (non-active) */
body.light-mode .code-controls .chip {
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
}

/* Summary card */
body.light-mode .summary-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Modal form labels */
body.light-mode .modal-form label {
    color: #333;
}

/* Modal subtitle */
body.light-mode .modal-subtitle {
    color: #666;
}

/* Preview loader */
body.light-mode .preview-loader {
    background: #f5f5f5;
}

body.light-mode .loader-header,
body.light-mode .loader-hero,
body.light-mode .loader-text {
    background: #e0e0e0;
}

body.light-mode .loader-header::after,
body.light-mode .loader-hero::after,
body.light-mode .loader-text::after {
    background: linear-gradient(90deg,
            transparent 0%,
            hsla(0, 0%, 80%, 0.4) 50%,
            transparent 100%);
}

/* Browser mockup background */
body.light-mode .browser-mockup {
    background: #ffffff;
}

body.light-mode .browser-header {
    background: #f8f8f8;
}

/* Repo stats row border */
body.light-mode .repo-stats-row {
    border-top-color: rgba(0, 0, 0, 0.1);
}

/* Form feedback colors (keep same for visibility) */
body.light-mode .form-feedback.error {
    color: #d32f2f;
}

body.light-mode .form-feedback.success {
    color: #2e7d32;
}

/* Music thumb background */
body.light-mode .music-thumb {
    background: #e0e0e0;
}

/* File item folder icon */
body.light-mode .file-item.folder i {
    color: #f57c00;
}

/* Empty state code */
body.light-mode .empty-state-code {
    color: var(--text-secondary);
}

/* Code search header */
body.light-mode .code-search-header {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

/* Result description color fix */
body.light-mode .result-desc {
    color: #555;
}

/* Summary images */
body.light-mode .summary-images {
    border-color: rgba(0, 0, 0, 0.1);
}

/* Music layout */
body.light-mode .music-layout {
    background: transparent;
}

/* Code detail background */
body.light-mode .code-detail {
    background: radial-gradient(circle at top right, rgba(74, 124, 255, 0.03), transparent 40%);
}

/* Repo name and meta */
body.light-mode .repo-name {
    color: var(--text-primary);
}

body.light-mode .repo-meta {
    color: var(--text-secondary);
}

/* Detail grid */
body.light-mode .detail-grid {
    border-color: rgba(0, 0, 0, 0.1);
}

/* Empty state */
body.light-mode .empty-state-code h3 {
    color: var(--text-primary);
}

body.light-mode .empty-state-code p {
    color: var(--text-secondary);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    overflow-y: overlay;
    /* Attempt overlay scrollbar */
}

/* Prevent scrollbar flicker during page load */
body.loading {
    overflow-y: hidden !important;
}

/* Hide Scrollbars globally */
body {
    scrollbar-width: none;
}

body::-webkit-scrollbar {
    display: none;
}

/* Subtle Ambient Background */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    background: var(--bg-color);
    opacity: 0.8;
}

.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 4rem;
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Header & Nav - Removed top-nav styles as connection button is removed */

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.search-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.7s cubic-bezier(0.19, 1, 0.22, 1);
    min-height: 100vh;
    height: 100vh;
    width: 100%;
    position: relative;
    z-index: 5;
    padding: 0;
}

.search-header.active {
    height: auto;
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr minmax(420px, 680px) 1fr;
    grid-template-rows: auto auto;
    align-items: start;
    padding: 1.5rem 0 1rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    position: relative;
}

/* Tabs */
.search-tabs {
    grid-column: 2;
    /* Center in grid */
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.5s ease 0.2s;
    /* Delayed appearance */
    pointer-events: none;
    height: 0;
}

.search-header.active .search-tabs {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    height: auto;
    position: relative;
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    padding: 0;
    margin-top: 1rem;
    justify-self: center;
}

.tabs-left {
    display: flex;
    gap: 2rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--text-primary);
    transition: width 0.3s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--text-primary);
}

.tab-btn.active::after {
    width: 100%;
}

.mini-player-badge {
    display: none;
    align-items: center;
    gap: 0.6rem;
    position: static;
    margin-left: auto;
    padding: 0.5rem 0.8rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    height: 48px;
}

.mini-toggle-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 999px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.mini-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Code View New Layout */
.code-split-view {
    display: flex;
    width: 100%;
    min-height: 100%;
    border-top: 1px solid var(--border-color);
    overflow: visible;
    /* Ensure split view stays within container */
}

/* Sidebar */
.code-sidebar {
    width: 300px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: rgba(10, 10, 10, 0.3);
    max-height: calc(100vh - 200px); /* Limit height to enable scrolling */
}

.code-search-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.code-controls {
    display: flex;
    gap: 0.5rem;
}

.code-controls .chip {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-main);
}

.code-controls .chip.active,
.code-controls .chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.code-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.8rem;
    direction: rtl; /* Scrollbar on the left */
    min-height: 0; /* Important for flex child to allow scrolling */
}

/* Reset direction for content inside code-list to keep text readable */
.code-list > * {
    direction: ltr; /* Text content reads left-to-right */
}

/* Ensure placeholder message also respects direction */
.code-list .placeholder-message {
    direction: ltr;
}

/* Repo Items in Sidebar */
.repo-item {
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 0.4rem;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.01);
}

.repo-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.repo-item.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.repo-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.repo-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.repo-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Detail View */
.code-detail {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2.5rem;
    position: relative;
    background: radial-gradient(circle at top right, rgba(30, 30, 30, 0.2), transparent 40%);
    min-height: 400px;
}

.empty-state-code {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-align: center;
}

.empty-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.empty-icon-circle i {
    font-size: 1.8rem;
    opacity: 0.7;
    color: var(--text-primary);
}

/* Detail Content Grid */
.repo-detail-header {
    margin-bottom: 2.5rem;
    animation: fadeIn 0.4s ease;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.repo-title-large {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.repo-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-weight: 400;
}

.repo-actions {
    display: flex;
    gap: 0.8rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--text-primary);
    color: var(--bg-color);
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: transform 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.action-btn.secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.repo-desc-large {
    color: var(--text-secondary);
    max-width: 700px;
    line-height: 1.6;
    font-size: 1.05rem;
}

.repo-stats-row {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.stat-pill i {
    color: var(--text-secondary);
}

.detail-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* File Tree */
.file-tree-panel {
    background: rgba(10, 10, 10, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.panel-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-list {
    padding: 0.5rem 0;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: monospace;
}

.file-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    padding-left: 1.2rem;
}

.file-item i {
    opacity: 0.7;
    font-size: 1rem;
}

.file-item.folder i {
    color: #ffd700;
    /* Goldish for folder */
}

/* Readme / Code Preview */
.code-preview-panel {
    background: rgba(10, 10, 10, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    min-height: 500px;
}

.markdown-body {
    padding: 2.5rem;
    color: #c9d1d9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

.markdown-body h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #fff;
    border-bottom: 1px solid #30363d;
    padding-bottom: 0.5rem;
    font-weight: 600;
}

.markdown-body h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #fff;
    border-bottom: 1px solid #21262d;
    padding-bottom: 0.3rem;
    font-weight: 600;
}

.markdown-body p {
    margin-bottom: 1rem;
}

.markdown-body a {
    color: #58a6ff;
    text-decoration: none;
}

.markdown-body code {
    background: rgba(110, 118, 129, 0.4);
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
    font-size: 0.85em;
}

.markdown-body pre {
    background: #161b22;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid #30363d;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    color: #c9d1d9;
    font-size: 0.9rem;
}

.markdown-body ul {
    padding-left: 2rem;
    margin-bottom: 1rem;
}

.markdown-body li {
    margin-bottom: 0.25rem;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.mini-player-badge img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
}

.mini-player-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 200px;
}

.mini-player-text #miniBadgeTitle {
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-text #miniBadgeArtist {
    color: var(--text-secondary);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-toggle-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.mini-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Logo */
.logo-area {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 200;
    transition: all 0.5s ease;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.logo-img {
    height: 40px;
    width: auto;
    display: block;
    object-fit: contain;
}

.theme-toggle-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    z-index: 200;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px) scale(1.05);
}

.theme-toggle-btn i {
    font-size: 1.2rem;
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-icon-light {
    opacity: 0;
    transform: rotate(90deg);
}

.theme-icon-dark {
    opacity: 1;
    transform: rotate(0deg);
}

body.light-mode .theme-icon-light {
    opacity: 1;
    transform: rotate(0deg);
}

body.light-mode .theme-icon-dark {
    opacity: 0;
    transform: rotate(-90deg);
}

.add-site-btn {
    position: fixed;
    top: 2rem;
    right: 6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 0.65rem 1.4rem;
    font-family: var(--font-main);
    font-size: 0.9rem;
    cursor: pointer;
    z-index: 200;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.add-site-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.add-site-btn i {
    font-size: 1rem;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 500;
    letter-spacing: -0.5px;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    transition: all 0.5s ease;
}

.search-header.active .logo-area {
    position: fixed;
    top: 2rem;
    left: 2rem;
    transform: none;
    justify-self: start;
    align-self: start;
}

.search-header.active .theme-toggle-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
}

.search-header.active .add-site-btn {
    position: fixed;
    top: 2rem;
    right: 6rem;
}

.search-header.active .logo-text {
    font-size: 1.8rem;
    opacity: 1;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* Search Input */
.search-bar-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(78vw, 720px);
    min-width: 360px;
    transition: all 0.5s ease;
    z-index: 100;
    pointer-events: auto;
    display: flex;
    align-items: center;
}

.search-header.active .search-bar-container {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    top: auto;
    left: auto;
    transform: none;
    max-width: 700px;
    width: 100%;
    justify-self: center;
    align-self: start;
    margin: 0 auto;
}

.search-bar-container input {
    width: 100%;
    padding: 0.95rem 1rem 0.95rem 3rem;
    padding-right: 3.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(25, 25, 25, 0.85);
    color: #ffffff;
    font-size: 1rem;
    font-family: var(--font-main);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    outline: none;
    text-align: left;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
    position: relative;
    z-index: 101;
}

.search-button {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    z-index: 102;
}

.search-button:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.search-button:active {
    transform: translateY(-50%) scale(0.95);
}

.search-bar-container input::placeholder {
    color: #404040;
}

.search-bar-container input:focus {
    background: rgba(10, 10, 10, 0.98);
    border-color: rgba(255, 255, 255, 0.4);
    outline: none;
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15), 
                0 4px 20px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

.search-bar-container input:focus::placeholder {
    color: #666;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #404040;
    font-size: 1rem;
    z-index: 103;
    pointer-events: none;
}

/* Hero 3D Animation Container */
.hero-stage {
    width: 100%;
    height: 100vh;
    max-height: none;
    position: fixed;
    top: 0;
    left: 0;
    transform: none;
    border-radius: 0;
    border: none;
    background: var(--bg-color);
    overflow: hidden;
    box-shadow: none;
    transition: opacity 0.6s ease;
    display: block;
    padding: 0;
    z-index: 0;
    margin: 0;
}

.hero-canvas-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.hero-canvas-container canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none;
}

.search-header.active .hero-stage {
    opacity: 0.3;
    pointer-events: none;
    position: fixed;
    z-index: -1;
}

/* Ensure Search Input and other elements are above canvas */
.logo-area {
    z-index: 200;
}

/* Results Area */
.content-wrapper {
    display: flex;
    flex-direction: column;
    /* Stack views */
    flex: 1;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none;
    padding-bottom: 1rem;
    height: 0;
    /* Important for flex child to not overflow parent */
    min-height: 0;
}

.search-header.active~.content-wrapper {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    height: auto;
    min-height: auto;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Maps View */
#mapContainer {
    width: 100%;
    height: 100%;
    min-height: 620px;
    border-radius: 18px;
    z-index: 1;
    overflow: hidden;
    background: rgba(20, 20, 20, 0.4);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

#mapsView {
    width: 100%;
    min-height: 75vh;
    padding: 2rem 0 3rem;
}

/* Leaflet map styling */
.leaflet-container {
    background: rgba(20, 20, 20, 0.4);
    font-family: var(--font-main);
}

.leaflet-control-zoom a {
    background-color: rgba(20, 20, 20, 0.9);
    color: var(--text-primary);
    border-color: var(--border-color);
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 18px;
    transition: all 0.3s ease;
}

.leaflet-control-zoom a:hover {
    background-color: rgba(40, 40, 40, 0.9);
    color: var(--text-primary);
}

.leaflet-popup-content-wrapper {
    background: rgba(20, 20, 20, 0.98) !important;
    color: #ededed !important;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

.leaflet-popup-content {
    color: #ededed !important;
    font-family: var(--font-main);
    margin: 12px 16px;
    line-height: 1.5;
}

.leaflet-popup-content b {
    color: #ffffff !important;
    font-weight: 600;
}

.leaflet-popup-content small {
    color: #b0b0b0 !important;
}

.leaflet-popup-content a {
    color: #b0b0b0 !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.leaflet-popup-content a:hover {
    color: #ffffff !important;
}

.leaflet-popup-tip {
    background: rgba(20, 20, 20, 0.98) !important;
}

.leaflet-control-attribution {
    background: rgba(20, 20, 20, 0.7);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
}

.leaflet-control-attribution a {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.leaflet-control-attribution a:hover {
    color: var(--text-primary);
}

/* Marker popup styling */
.leaflet-popup-close-button {
    color: #b0b0b0 !important;
    font-size: 20px;
    padding: 4px 8px;
    transition: color 0.3s ease;
    opacity: 0.8;
}

.leaflet-popup-close-button:hover {
    color: #ffffff !important;
    opacity: 1;
}

/* Music View */
.music-layout {
    width: 100%;
    height: 100%;
    overflow-y: visible;
    display: flex;
    justify-content: center;
    gap: 2rem;
    /* Spacing between list and player */
}

.music-list {
    flex: 1;
    /* Take remaining space */
    max-width: 600px;
    height: auto;
    overflow-y: visible;
    padding-right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    /* No scrollbar needed - page scrolls instead */
}

.music-header-message {
    padding: 1rem 0 0.5rem 0;
    margin-bottom: 0.5rem;
}

.music-header-message p {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-secondary);
    font-style: italic;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Music Player Sidebar */
.music-player-container {
    width: 400px;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#ytPlayer {
    width: 100%;
    height: 80px;
    /* Audio player height - minimal for audio-only playback */
    border-radius: 8px;
    display: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    opacity: 0.3;
    /* Make video semi-transparent when used as audio fallback */
    pointer-events: none;
    /* Prevent direct interaction - use our controls instead */
    position: relative;
    z-index: 1;
}

/* Hide video content but keep audio playing */
#ytPlayer.active {
    display: block;
    /* Video is hidden visually but audio plays */
}

/* In light mode, make it even more transparent */
body.light-mode #ytPlayer {
    opacity: 0.2;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#ytPlayer.active {
    display: block;
}

#audioPlayer {
    width: 100%;
    border-radius: 8px;
    margin-top: 1rem;
    background: rgba(20, 20, 20, 0.6);
}

#audioPlayer::-webkit-media-controls-panel {
    background-color: rgba(20, 20, 20, 0.9);
}

#audioPlayer::-webkit-media-controls-play-button,
#audioPlayer::-webkit-media-controls-volume-slider,
#audioPlayer::-webkit-media-controls-timeline {
    filter: invert(1);
}

.player-toggle-btn {
    display: none;
    width: 100%;
    padding: 0.65rem;
    margin-bottom: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 500;
    transition: all 0.2s ease;
}

.player-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.placeholder-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    gap: 1rem;
}

.placeholder-player i {
    font-size: 3rem;
    opacity: 0.5;
}

.music-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    background: rgba(20, 20, 20, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.music-item:hover {
    background: rgba(40, 40, 40, 0.6);
    transform: translateX(5px);
}

.music-item.playing {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.music-thumb-container {
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-thumb {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    object-fit: cover;
    background: #000;
    display: block;
}

.music-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.music-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.music-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.music-title {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.2rem;
}

.music-meta {
    color: var(--text-secondary);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.music-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Views Management */
.results-layout,
.view-section {
    display: none;
    flex: 0 0 auto;
    width: 100%;
    min-height: auto;
    height: auto;
    overflow-y: visible;
}

.results-layout.active-view,
.view-section.active-view {
    display: flex;
    animation: fadeIn 0.4s ease forwards;
}

/* Summary View Styles */
.summary-container {
    width: 100%;
    min-height: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    padding-top: 2rem;
    overflow-y: visible;
}

.summary-content {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.summary-content h2 {
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-primary);
}

.summary-card {
    background: rgba(20, 20, 20, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    gap: 2rem;
}

.summary-images {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 300px;
}

.summary-img-placeholder {
    width: 100%;
    height: 200px;
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
}

.summary-img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.summary-text {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ccc;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skeleton-text {
    width: 100%;
    height: 15px;
    background: #1a1a1a;
    border-radius: 4px;
}

/* Web View Layout (Original Split) */
.results-layout {
    gap: 6rem;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 4rem;
    flex-direction: row;
    /* Stretch columns to the same height so empty-state messages can center properly */
    align-items: stretch;
}

.results-layout > .results-header {
    display: none; /* Hidden by default, will be shown via JS */
}

/* Container for header + results list */
.results-layout > .results-list-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* Give more room to the preview pane */
    max-width: 38%;
}

.results-layout > .results-list-container > .results-header {
    width: 100%;
    padding: 1rem 1.2rem 0.5rem;
    margin-bottom: 0.5rem;
}

/* Placeholder Views */
.placeholder-message {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.01);
}

.placeholder-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.results-header {
    width: 100%;
    padding: 1rem 1.2rem 0.5rem;
    margin-bottom: 0.5rem;
}

.results-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    font-family: var(--font-main);
}

.results-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    overflow-y: visible;
    /* No scroll needed since we limit to 5 results */
    padding-right: 1rem;
}

.result-item {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    position: relative;
}

.result-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.result-item.selected {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(74, 124, 255, 0.4);
    box-shadow: 0 0 0 1px rgba(74, 124, 255, 0.2),
                0 0 20px rgba(74, 124, 255, 0.15),
                0 6px 20px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.result-item.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, rgba(74, 124, 255, 0.8), rgba(179, 230, 255, 0.5));
    border-radius: 3px 0 0 3px;
    box-shadow: 0 0 12px rgba(74, 124, 255, 0.4);
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* CVSS badge (more visible + score-based color) */
.cvss-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.cvss-label {
    font-size: 0.7rem;
    opacity: 0.9;
}

.cvss-score {
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.cvss-badge.cvss-critical {
    border-color: rgba(255, 68, 68, 0.55);
    background: rgba(255, 68, 68, 0.12);
    color: #ff4444;
}

.cvss-badge.cvss-high {
    border-color: rgba(255, 136, 0, 0.55);
    background: rgba(255, 136, 0, 0.12);
    color: #ff8800;
}

.cvss-badge.cvss-medium {
    border-color: rgba(255, 170, 0, 0.55);
    background: rgba(255, 170, 0, 0.12);
    color: #ffaa00;
}

.cvss-badge.cvss-low {
    border-color: rgba(136, 204, 0, 0.55);
    background: rgba(136, 204, 0, 0.12);
    color: #88cc00;
}

.cvss-badge.cvss-none,
.cvss-badge.cvss-na {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

.country-flag {
    width: 16px;
    opacity: 0.7;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 0.3rem;
}

.result-url {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    font-family: monospace;
    opacity: 0.7;
    word-break: break-all;
}

.result-desc {
    color: #888;
    font-size: 0.9rem;
    line-height: 1.5;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    display: -webkit-box;
    overflow: hidden;
}

/* Preview Pane */
.preview-pane {
    /* Bigger preview area */
    flex: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
    height: 100%;
}

.browser-mockup {
    width: 100%;
    height: 100%;
    /* Make preview taller on desktop */
    max-height: 72vh;
    background: #0a0a0a;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    overflow: hidden;
}

.browser-mockup.active {
    opacity: 1;
    transform: translateX(0);
}

.browser-header {
    height: 40px;
    background: #0f0f0f;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
}

.dots {
    display: flex;
    gap: 6px;
}

.dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #222;
}

.address-bar {
    background: transparent;
    color: #444;
    font-size: 0.75rem;
    flex: 1;
    text-align: left;
    margin-left: 1rem;
    font-family: monospace;
}

.preview-content-area {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
}

/* Pagination */
.pagination-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 1rem 0 0.5rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease 0.3s;
    margin-top: 1rem;
}

.search-header.active~.pagination-container {
    opacity: 1;
    transform: translateY(0);
}

.pagination-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: rgba(20, 20, 20, 0.6);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.page-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.page-btn:hover {
    color: var(--text-primary);
}

.page-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-number {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-main);
}

.page-number:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.page-number.active {
    background: #fff;
    color: #000;
    font-weight: 600;
}

.page-dots {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

/* Loader - Premium Skeleton Shimmer */
.preview-loader {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #0f0f0f;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
}

/* Skeleton Elements */
.loader-header,
.loader-hero,
.loader-text {
    background: #1a1a1a;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.loader-header {
    width: 30%;
    height: 20px;
    margin-bottom: 2rem;
}

.loader-hero {
    width: 100%;
    height: 150px;
    border-radius: 8px;
}

.loader-text {
    width: 100%;
    height: 12px;
}

.loader-text:nth-child(4) {
    width: 80%;
}

.loader-text:nth-child(5) {
    width: 90%;
}

.loader-text:nth-child(6) {
    width: 60%;
}

/* Shimmer Effect */
.loader-header::after,
.loader-hero::after,
.loader-text::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            hsla(0, 0%, 20%, 0.4) 50%,
            transparent 100%);
    transform: translateX(-100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 500;
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}

.modal-card {
    width: min(90vw, 1200px);
    max-width: 1200px;
    max-height: 90vh;
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 2rem;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
    animation: fadeIn 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

.modal-card h2 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
    margin-right: -0.5rem;
}

/* Custom scrollbar for modal form */
.modal-form::-webkit-scrollbar {
    width: 8px;
}

.modal-form::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.modal-form::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.modal-form::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-form label {
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.modal-form input,
.modal-form textarea {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-main);
    resize: vertical;
}

.modal-form textarea {
    min-height: 400px;
    max-height: 600px;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    resize: vertical;
}

.modal-form input:focus,
.modal-form textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.8);
}

.modal-submit {
    border: none;
    border-radius: 12px;
    padding: 0.95rem 1rem;
    background: var(--text-primary);
    color: var(--bg-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-shrink: 0;
    margin-top: auto;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
}

.modal-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-submit:hover:not(:disabled) {
    transform: translateY(-1px);
}

.modal-submit .loading-text {
    display: none;
    align-items: center;
    gap: 0.4rem;
}

.modal-submit.loading .default-text {
    display: none;
}

.modal-submit.loading .loading-text {
    display: inline-flex;
}

.form-feedback {
    min-height: 1.25rem;
    font-size: 0.85rem;
}

.form-feedback.error {
    color: #ff6b6b;
}

.form-feedback.success {
    color: #3dd598;
}
