@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark mode colors */
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --text-primary: #bcbcbc;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
    --border-color: #333333;
    --border-color-light: #404040;
    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-hover: rgba(0, 0, 0, 0.6);
    --accent-blue: #0064D2;
    --accent-green: #4ade80;
}

body {
    font-family: 'Geist Mono', 'Courier New', monospace;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden; /* Prevent horizontal scrolling */
    width: 100%;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    background: var(--bg-secondary);
    overflow-x: hidden; /* Prevent horizontal overflow */
    width: 100%;
    transition: background-color 0.3s;
}

/* Home Page */
.home-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    text-align: center;
}

.home-title {
    font-size: 4em;
    font-weight: 700;
    color: #0064D2;
    margin: 0;
}

/* Main Header */
.main-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px var(--shadow);
    transition: background-color 0.3s, border-color 0.3s;
}

.header-content {
    max-width: 1600px;
    margin: auto;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    min-height: 44px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--accent-blue);
    margin: 0;
    white-space: nowrap;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    line-height: 1;
}

.search-box {
    display: flex;
    gap: 15px;
    flex: 1;
    max-width: 800px;
}

/* Pill-shaped container for search input */
.search-input-container {
    flex: 1;
    background: var(--bg-tertiary);
    border: none;
    outline: 2.5px solid white;
    outline-offset: -2.5px;
    border-radius: 50px;
    padding: 4px;
    transition: background-color 0.3s, outline-color 0.3s;
    height: 44px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

#searchInput {
    width: 100%;
    padding: 0 20px;
    font-family: 'Geist Mono', 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.2;
    background: transparent;
    color: #bcbcbc;
    border: none;
    border-radius: 50px;
    outline: none;
    transition: all 0.3s;
    height: 100%;
    box-sizing: border-box;
}

input {
    font-family: 'Geist Mono', 'Courier New', monospace;
}

#searchInput:focus {
    background: var(--bg-secondary);
}

#searchInput::placeholder {
    color: var(--text-tertiary);
}

button {
    font-family: 'Geist Mono', 'Courier New', monospace;
}

#searchButton {
    padding: 0 60px;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 600;
    background: #0064D2;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    height: 44px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

#searchButton:hover {
    background: #0052a3;
}

#searchButton:active {
    transform: scale(0.98);
}

#searchButton:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
}

/* Pill-shaped container for history button */
.history-button-container {
    background: transparent;
    border: none;
    border-radius: 50px;
    padding: 0;
    height: 44px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.history-btn {
    padding: 0 24px;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    height: 44px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0 16px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    pointer-events: auto;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

.theme-toggle-btn:hover {
    background: var(--border-color);
    transform: scale(1.05);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

.theme-icon {
    display: inline-block;
    transition: transform 0.3s;
    pointer-events: none; /* Allow clicks to pass through to button */
    user-select: none;
}

.history-btn:hover {
    background: var(--border-color);
    transform: scale(1.05);
}

.history-btn:active {
    transform: scale(0.98);
}

.loading {
    text-align: center;
    padding: 40px;
    color: #333;
}

.spinner {
    border: 4px solid #e5e5e5;
    border-top: 4px solid #0064D2;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #fff3cd;
    color: #856404;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    margin-bottom: 20px;
    text-align: center;
}

/* Dashboard Section */
.dashboard-section {
    margin-top: 20px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* Prevent horizontal overflow */
}

.dashboard-title {
    font-size: 1.8em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
    margin-bottom: 30px;
    min-width: 0; /* Prevent grid overflow */
    width: 100%;
}

/* Left Sidebar: Metric Cards */
.left-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    grid-row: 1 / 3;
}

.metric-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px var(--shadow);
    transition: background-color 0.3s, border-color 0.3s;
}

.metric-label {
    font-size: 0.85em;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 500;
}

.metric-value {
    font-size: 1.5em;
    font-weight: 700;
    color: #0064D2;
}

/* Top Row: Listings by Price with Info Cards */
.top-row {
    display: grid;
    grid-template-columns: 1fr minmax(200px, 280px);
    gap: 20px;
    grid-column: 2;
    grid-row: 1;
    align-items: start;
    min-width: 0; /* Prevent grid overflow */
    width: 100%;
}

.chart-panel.dot-plot {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0; /* Prevent overflow */
    /* Match info card height: padding (32px) + title (~27px) + square content (248px) = ~307px */
    height: 307px;
}

.chart-panel.dot-plot .chart-title {
    flex-shrink: 0;
    margin-bottom: 4px;
}

.chart-panel.dot-plot .chart-subtitle {
    flex-shrink: 0;
    margin-bottom: 16px;
}

.chart-panel.dot-plot .chart-placeholder {
    flex: 1;
    min-height: 0;
}

/* Main Content: Chart Panels (2x2 grid) */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    grid-column: 2;
    grid-row: 2;
    min-width: 0; /* Prevent grid overflow */
    width: 100%;
}

.chart-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px var(--shadow);
    min-width: 0; /* Prevent grid overflow */
    max-width: 100%; /* Prevent expansion beyond container */
    overflow: hidden; /* Prevent content from spilling */
    width: 100%;
    box-sizing: border-box;
    transition: background-color 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
}

.chart-panel.large {
    height: 400px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.chart-panel.large .chart-placeholder {
    flex: 1;
    min-height: 0;
    height: auto;
    max-height: none;
}

.chart-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    flex-shrink: 0;
}

.chart-subtitle {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 16px;
    flex-shrink: 0;
}

.chart-placeholder {
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-color-light);
    border-radius: 4px;
    padding: 10px;
    text-align: center;
    height: 320px;
    max-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0; /* Prevent overflow */
    max-width: 100%; /* Constrain to parent */
    overflow: hidden; /* Prevent content spill */
    width: 100%;
    box-sizing: border-box;
    transition: background-color 0.3s, border-color 0.3s;
}

/* Constrain canvas elements within chart placeholders */
.chart-placeholder canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box;
    object-fit: contain;
}

.placeholder-content {
    color: #999;
    font-size: 0.9em;
}

.info-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px var(--shadow);
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 280px;
    min-width: 0; /* Prevent overflow */
    /* Height: padding (32px) + title (~27px) + square content (248px) = 307px */
    height: 307px;
    transition: background-color 0.3s, border-color 0.3s;
}

.info-card-title {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    flex-shrink: 0;
}

.info-card-content {
    width: 100%;
    /* Square content: calculate based on available width (card width - padding) */
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* Ensure minimum size for readability */
    min-height: 200px;
    min-width: 0;
    max-width: 100%;
    max-height: 100%;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.info-card-content canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box;
    object-fit: contain;
}

/* Modal for Search History */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.modal-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.clear-history-btn,
.close-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.clear-history-btn svg,
.close-btn svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.clear-history-btn:hover {
    background: var(--bg-tertiary);
    color: #ff4444;
}

.close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    padding: 15px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    border-left: 4px solid #0064D2;
}

.history-item:hover {
    background: var(--border-color);
    transform: translateX(5px);
}

.history-item-text {
    font-weight: 500;
    color: var(--text-primary);
}

.history-item-date {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 5px;
}

.no-history {
    text-align: center;
    color: #999;
    padding: 40px;
}

.results-section {
    margin-top: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-section h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5em;
    font-weight: 600;
}

.download-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    background: #0064D2;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.3s;
}

.download-btn:hover {
    background: #0052a3;
}

#resultsTableContainer {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 575px; /* Shows approximately 7 rows (header + 7 data rows) */
    border-radius: 8px;
}

/* Custom scrollbar styling for table container */
#resultsTableContainer::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#resultsTableContainer::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

#resultsTableContainer::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

#resultsTableContainer::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

#resultsTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-tertiary);
    box-shadow: 0 1px 3px var(--shadow);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s, border-color 0.3s;
}

#resultsTable thead {
    background: #333333;
    color: var(--text-primary);
}

#resultsTable th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: -1px;
    z-index: 100;
    background: #333333 !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

#resultsTable tbody tr {
    background: #2a2a2a;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

#resultsTable tbody tr:nth-child(even) {
    background: #252525;
}

#resultsTable tbody tr:hover {
    background: var(--border-color);
}

#resultsTable tbody tr:last-child {
    border-bottom: none;
}

#resultsTable td {
    padding: 15px;
    font-size: 14px;
    color: var(--text-primary);
}

#resultsTable td:nth-child(1) {
    font-weight: 600;
    color: var(--accent-blue);
    text-align: center;
    width: 50px;
}

#resultsTable td:nth-child(2) {
    font-weight: 500;
    max-width: 400px;
    color: var(--text-primary);
}

#resultsTable td:nth-child(3) {
    font-weight: 600;
    color: var(--accent-blue);
    font-size: 16px;
}

#resultsTable td:nth-child(4) {
    color: var(--text-secondary);
    font-size: 13px;
}

#resultsTable td:nth-child(5) a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

#resultsTable td:nth-child(5) a:hover {
    color: #0052a3;
    text-decoration: underline;
}

.unselectable-text {
    /* Standard property (supported by most modern browsers) */
    user-select: none;
  
    /* Vendor prefixes for broader compatibility */
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none;   /* Safari, Chrome, Opera */
    -khtml-user-select: none;    /* Konqueror HTML */
    -moz-user-select: none;      /* Firefox */
    -ms-user-select: none;       /* Internet Explorer/Edge */
  }  

/* Medium screens: Adjust layout for fixed-width cards */
@media (max-width: 1200px) and (min-width: 901px) {
    .dashboard-layout {
        grid-template-columns: 180px 1fr;
        width: 100%;
    }

    .top-row {
        grid-template-columns: 1fr;
        gap: 20px;
        width: 100%;
    }

    .info-card {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .info-card-content {
        height: auto;
        aspect-ratio: 1;
    }

    .chart-panel.dot-plot {
        height: auto;
        min-height: 307px;
        width: 100%;
        max-width: 100%;
    }

    .main-content {
        width: 100%;
    }

    .chart-panel {
        width: 100%;
        max-width: 100%;
    }
}

/* Tablet screens: Further adjustments */
@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .left-sidebar {
        grid-row: auto;
        width: 100%;
    }

    .top-row {
        grid-column: 1;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .main-content {
        grid-column: 1;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .chart-panel {
        width: 100%;
        max-width: 100%;
    }

    .chart-placeholder {
        width: 100%;
        max-width: 100%;
    }
}

/* Small screens: Stack everything */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2em;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .logo {
        text-align: center;
        margin-bottom: 15px;
    }

    .home-title {
        font-size: 2.5em;
    }

    .search-box {
        flex-direction: column;
        max-width: 100%;
        gap: 10px;
    }

    .search-input-container,
    .search-button-container,
    .history-button-container {
        width: 100%;
    }

    #searchInput,
    #searchButton,
    .history-btn {
        width: 100%;
    }

    .dashboard-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        width: 100%;
    }

    .left-sidebar {
        grid-row: auto;
        order: 2;
        width: 100%;
    }

    .top-row {
        grid-column: 1;
        grid-row: auto;
        grid-template-columns: 1fr;
        order: 1;
        width: 100%;
    }

    .info-card {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 307px;
    }

    .info-card-content {
        height: auto;
        min-height: 248px;
        aspect-ratio: 1;
        width: 100%;
        max-width: 100%;
    }

    .chart-panel.dot-plot {
        height: auto;
        min-height: 307px;
        width: 100%;
        max-width: 100%;
    }

    .main-content {
        grid-column: 1;
        grid-row: auto;
        order: 3;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .chart-panel {
        width: 100%;
        max-width: 100%;
    }

    .chart-placeholder {
        width: 100%;
        max-width: 100%;
    }

    .chart-placeholder {
        min-height: 200px;
        padding: 30px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    #resultsTable {
        font-size: 12px;
    }

    #resultsTable th,
    #resultsTable td {
        padding: 10px 8px;
    }
}

/* Light Mode Styles */
body.light-mode {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9f9f9;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border-color: #e5e5e5;
    --border-color-light: #d5d5d5;
    --shadow: rgba(0, 0, 0, 0.05);
    --shadow-hover: rgba(0, 0, 0, 0.1);
    --accent-blue: #0064D2;
    --accent-green: #4ade80;
}

body.light-mode .theme-toggle-btn {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

body.light-mode .theme-toggle-btn:hover {
    background: var(--border-color);
}

body.light-mode .search-input-container {
    background: var(--bg-tertiary);
    outline-color: var(--text-primary);
}

body.light-mode #searchInput {
    background: transparent;
    color: var(--text-primary);
}

body.light-mode #searchInput::placeholder {
    color: var(--text-tertiary);
}

body.light-mode .history-button-container {
    background: transparent;
    border: none;
}

body.light-mode .history-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

body.light-mode .metric-card,
body.light-mode .chart-panel,
body.light-mode .info-card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.light-mode .chart-placeholder {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

body.light-mode .placeholder-content {
    color: var(--text-tertiary);
}

body.light-mode .dashboard-title {
    color: var(--text-primary);
}

body.light-mode .chart-title,
body.light-mode .info-card-title {
    color: var(--text-primary);
}

body.light-mode .chart-subtitle {
    color: var(--text-secondary);
}

body.light-mode .metric-label {
    color: var(--text-primary);
}

body.light-mode .home-title {
    color: var(--accent-blue);
}

body.light-mode #resultsTable {
    color: var(--text-primary);
}

body.light-mode #resultsTable thead {
    background: #d0d0d0;
    color: var(--text-primary);
}

body.light-mode #resultsTable th {
    background: #d0d0d0 !important;
    color: var(--text-primary);
    border-color: var(--border-color);
    position: sticky;
    top: -1px;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

body.light-mode #resultsTable tbody tr {
    background: #f5f5f5;
}

body.light-mode #resultsTable tbody tr:nth-child(even) {
    background: #f9f9f9;
}

body.light-mode #resultsTable td {
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.light-mode #resultsTable tr:hover {
    background: #e5e5e5;
}

body.light-mode #resultsTable td:nth-child(1),
body.light-mode #resultsTable td:nth-child(3) {
    color: var(--accent-blue);
}

body.light-mode #resultsTable td:nth-child(2) {
    color: var(--text-primary);
}

body.light-mode #resultsTable td:nth-child(4) {
    color: var(--text-secondary);
}

body.light-mode #resultsTable td:nth-child(5) a {
    color: var(--accent-blue);
}

body.light-mode #resultsTable td:nth-child(5) a:hover {
    color: var(--accent-blue);
    opacity: 0.8;
}

body.light-mode .modal-content {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.light-mode .modal-header h2 {
    color: var(--text-primary);
}

body.light-mode .clear-history-btn,
body.light-mode .close-btn {
    color: var(--text-primary);
}

body.light-mode .clear-history-btn:hover {
    color: #ff4444;
}

body.light-mode .close-btn:hover {
    color: var(--text-secondary);
}

body.light-mode .history-item {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
    border-left: 4px solid #0064D2;
}

body.light-mode .history-item:hover {
    background: var(--border-color);
}

body.light-mode .history-item-text {
    color: var(--text-primary);
}

body.light-mode .history-item-date {
    color: var(--text-secondary);
}