﻿:root {
    /* Dark Theme (Default) */
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #282828;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-primary: #564fe0;
    --accent-secondary: #4b44c9;
    --accent-tertiary: #332f9a;
    --error: #e74c3c;
    --success: #2ecc71;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f8f8f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f0f0;
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent-primary: #564fe0;
    --accent-secondary: #4b44c9;
    --accent-tertiary: #332f9a;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navigation Styles */
.navbar {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-tertiary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--accent-primary), #9f7aea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

    .nav-menu a {
        color: var(--text-secondary);
        text-decoration: none;
        font-weight: 500;
        transition: color 0.2s ease;
        cursor: pointer;
    }

        .nav-menu a:hover,
        .nav-menu a.nav-active {
            color: var(--accent-primary);
        }

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

    .theme-toggle:hover {
        background-color: var(--bg-tertiary);
    }

    .theme-toggle svg {
        width: 20px;
        height: 20px;
        transition: transform 0.3s ease;
    }

    .theme-toggle:hover svg {
        transform: rotate(30deg);
    }

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.5rem;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 60px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page {
    display: none;
}

    .page.active {
        display: block;
    }

/* Home Page Styles */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.logo {
    height: 150px;
    width: auto;
}

.gradient-text {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, var(--accent-primary), #9f7aea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Description Card */
.description-card {
    background-color: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin: 2rem auto;
    max-width: 800px;
    text-align: center;
    transition: background-color 0.3s ease;
}

    .description-card h2 {
        font-size: 1.8rem;
        font-weight: 600;
        margin-bottom: 1rem;
        color: var(--text-primary);
    }

    .description-card p {
        color: var(--text-secondary);
        font-size: 1.1rem;
        line-height: 1.7;
        margin-bottom: 1.5rem;
    }

/* Download */
.download-section {
    margin-top: 3rem;
}

    .download-section h2 {
        text-align: center;
        font-size: 2rem;
        font-weight: 600;
        margin-bottom: 2rem;
        color: var(--text-primary);
    }

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.download-card {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    padding: 2.5rem;
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: white;
}

    .download-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(86, 79, 224, 0.3);
    }

    .download-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
        pointer-events: none;
    }

.download-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.download-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.download-card p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.download-button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

    .download-button:hover {
        background: rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 255, 255, 0.5);
        transform: scale(1.05);
    }

    .download-button:active {
        transform: scale(0.98);
    }

/* Top Games Table Styles */
.topgames-data-table {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.topgames-table-header {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background-color: var(--accent-primary);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topgames-table-row {
    border-bottom: 1px solid var(--bg-tertiary);
}

    .topgames-table-row:last-child {
        border-bottom: none;
    }

.topgames-row-main {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    transition: background-color 0.2s ease;
    align-items: center;
    cursor: pointer;
    position: relative;
}

    .topgames-row-main:hover {
        background-color: var(--bg-tertiary);
    }

.topgames-title-column {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.topgames-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.topgames-score-column {
    text-align: right;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.topgames-score-value {
    font-size: 1.1rem;
}

.topgames-expand-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

    .topgames-expand-icon.expanded {
        transform: rotate(180deg);
    }

.topgames-details {
    padding: 0 1.5rem;
    background-color: var(--bg-tertiary);
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
}

    .topgames-details.expanded {
        max-height: 400px;
        opacity: 1;
        padding: 1rem 1.5rem;
    }

.topgames-details-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    font-size: 0.9rem;
    align-items: start;
}

.topgames-details-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

.topgames-details-middle {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.topgames-details-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.topgames-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.topgames-detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topgames-detail-value {
    color: var(--text-primary);
    word-break: break-all;
}

.topgames-boxart-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.topgames-game-title {
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.2;
    max-width: 120px;
    word-wrap: break-word;
}

.topgames-check-icon {
    background-color: var(--accent-primary);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: bold;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.topgames-detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.topgames-id-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    cursor: pointer;
}

.topgames-product-link {
    color: var(--accent-primary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

    .topgames-product-link:hover {
        color: var(--accent-secondary);
        text-decoration: underline;
    }

/* Mobile responsive styles */
@media (max-width: 768px) {
    .topgames-table-header {
        grid-template-columns: 1fr 100px;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .topgames-row-main {
        grid-template-columns: 1fr 100px;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .topgames-score-value {
        font-size: 1rem;
    }

    .topgames-title-text {
        font-size: 0.9rem;
    }

    .topgames-details {
        padding: 0 1rem;
    }

        .topgames-details.expanded {
            padding: 1rem;
            max-height: 500px;
        }

    .topgames-details-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .topgames-boxart-image {
        width: 100px;
        height: 100px;
    }

    .topgames-game-title {
        max-width: 100px;
        font-size: 0.85rem;
    }

    .topgames-check-icon {
        width: 14px;
        height: 14px;
        font-size: 9px;
    }
}
/* Search Page Styles */
.search-container {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    box-shadow: var(--box-shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.search-form {
  display: flex;
  gap: 10px;
  flex-direction: row;
  align-items: center;
}

.search-bar-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.search-filter-dropdown {
  flex-shrink: 0;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    border: 1px solid var(--bg-tertiary);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease, background-color 0.3s ease, color 0.3s ease;
}

    .search-input:focus {
        outline: none;
        border-color: var(--accent-tertiary);
        box-shadow: 0 0 0 2px rgba(86, 79, 224, 0.2);
    }

.search-button {
    padding: 12px 24px;
    border-radius: var(--border-radius);
    border: none;
    background-color: var(--accent-primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .search-button:hover {
        background-color: var(--accent-secondary);
    }

    .search-button:active {
        background-color: var(--accent-tertiary);
    }

    .search-button:disabled {
        background-color: #7a7a7a;
        cursor: not-allowed;
        opacity: 0.6;
    }

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.search-results-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.search-game-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.search-game-card {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.2s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    position: relative;
}

    .search-game-card:hover {
        transform: translateY(-5px);
    }

.search-game-image {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.search-no-image {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    flex-shrink: 0;
    border: 2px dashed rgba(160, 160, 160, 0.3);
}

.search-game-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.search-game-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.search-game-title-id {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-game-product-id {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    opacity: 0.8;
}

/* Game Pages Styles */
.results-container {
    margin-top: 2rem;
}

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

    .results-header h2 {
        font-size: 1.8rem;
        font-weight: 600;
    }

.results-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.game-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.game-card {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.2s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 420px;
    position: relative;
}

    .game-card:hover {
        transform: translateY(-5px);
    }

.game-image-container {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.no-image {
    width: 100%;
    height: 100%;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    border: 2px dashed rgba(160, 160, 160, 0.3);
}

.title-based-icon {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--accent-primary);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 10;
}

.game-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8) 20%, rgba(0,0,0,0.95));
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    color: white;
}

.game-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.game-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
}

.game-title-id {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-product-id {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.8);
    display: flex;
    justify-content: space-between;
    opacity: 0.9;
}

.product-id-link {
    color: #9f7aea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    font-size: 0.75rem;
}

    .product-id-link:hover {
        color: #b794f6;
    }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: var(--accent-tertiary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .badge:hover {
        background-color: var(--accent-primary);
    }

.show-more-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.show-more-button {
    padding: 12px 32px;
    border-radius: var(--border-radius);
    border: none;
    background-color: var(--accent-primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

    .show-more-button:hover {
        background-color: var(--accent-secondary);
    }

    .show-more-button:active {
        background-color: var(--accent-tertiary);
    }

    .show-more-button:disabled {
        background-color: #7a7a7a;
        cursor: not-allowed;
        opacity: 0.6;
    }

.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background-color: var(--success);
    color: white;
    padding: 10px 16px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

    .toast.show {
        opacity: 1;
        transform: translateY(0);
    }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-message {
    background-color: rgba(231, 76, 60, 0.2);
    color: var(--error);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    text-align: center;
}

.loading {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

footer {
    margin-top: 4rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--bg-tertiary);
}

    footer a {
        color: var(--accent-primary);
        text-decoration: none;
        font-weight: 600;
        transition: color 0.2s ease;
    }

        footer a:hover {
            color: var(--accent-secondary);
        }

.maintenance-banner {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 1rem 1.5rem;
    text-align: center;
    position: relative;
    font-weight: 500;
    font-size: 0.875rem;
    box-shadow: var(--box-shadow);
    z-index: 1001;
}

.maintenance-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.maintenance-banner .warning-icon {
    font-size: 1.25rem;
    animation: pulse 2s infinite;
}

.maintenance-banner .close-btn {
    position: absolute;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1.25rem;
}

    .maintenance-banner .close-btn:hover {
        background-color: rgba(255, 255, 255, 0.2);
        color: white;
    }

.maintenance-banner.hidden {
    display: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background-color: var(--bg-secondary);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        transition: left 0.3s ease;
        padding-top: 2rem;
        gap: 2rem;
    }

        .nav-menu.nav-menu-active {
            left: 0;
        }

    .mobile-menu-toggle {
        display: block;
    }

    .game-list {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }

    .maintenance-banner {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }

        .maintenance-banner .close-btn {
            right: 1rem;
        }

    .maintenance-banner-content {
        padding-right: 2.5rem;
    }

    .results-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .gradient-text {
        font-size: 2rem;
    }

    .logo {
        height: 120px;
    }

    .download-grid {
        grid-template-columns: 1fr;
    }

    .download-card {
        padding: 2rem;
    }

    .description-card {
        padding: 2rem;
    }

    .search-form {
        flex-direction: column;
    }

    .search-bar-row {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    width: 100%;
  }

    .search-button {
        width: 100%;
    }

    .search-game-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .search-game-card {
        flex-direction: row;
        text-align: left;
    }

    .search-game-image, .search-no-image {
        align-self: flex-start;
    }
}

.device-icons {
    display: flex;
    justify-content: flex-start;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.device-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.2s;
    filter: invert(1);
}

    .device-icon:hover {
        opacity: 1;
    }

[data-theme="light"] .device-icon {
    filter: none;
}

@media (max-width: 768px) {
    .device-icon {
        width: 20px;
        height: 20px;
    }
}

.search-type-select {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    border: 1px solid var(--bg-tertiary);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease, background-color 0.3s ease, color 0.3s ease;
}

.search-type-select:focus {
    outline: none;
    border-color: var(--accent-tertiary);
    box-shadow: 0 0 0 2px rgba(86, 79, 224, 0.2);
}

@media (max-width: 768px) {
    .search-type-select {
        width: 100%;
    }
}

/* Search Filter Styles */

.title-based-icon {
    z-index: 2;
    position: absolute;
}

.search-filter-menu {
    z-index: 1001 !important;
}
.search-filter-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    transition: background-color 0.2s ease, color 0.2s ease;
}

    .search-filter-btn:hover {
        background-color: var(--bg-tertiary);
        color: var(--accent-primary);
    }

.search-filter-btn svg {
  transform: rotate(90deg);
}

.search-filter-menu {
    border: 1px solid var(--bg-tertiary);
    background: var(--bg-secondary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border-radius: 8px;
    min-width: 220px;
    padding: 0.5rem 0;
    z-index: 10;
}

.search-filter-header {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--accent-primary);
  padding: 0.25rem 1rem 0.25rem 1rem;
  letter-spacing: 0.5px;
  margin-bottom: 0.1rem;
}

.search-filter-menu label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.97rem;
  color: var(--text-primary);
}

.search-filter-menu input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 16px;
  height: 16px;
  margin-right: 0.5rem;
}

.search-filter-menu button.active,
.search-filter-menu button:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.search-filter-menu button {
    background: none;
    color: var(--text-primary);
    width: 100%;
    border: none;
    padding: 0.5rem 1rem;
    text-align: left;
    transition: background 0.2s, color 0.2s;
}

.search-filter-checkbox-label {
  font-size: 0.89rem;
}

.search-filter-menu label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.97rem;
  color: var(--text-primary);
}

.search-filter-menu input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 16px;
  height: 16px;
  margin-right: 0.5rem;
}

.search-filter-menu button.active {
    background: var(--accent-primary);
    color: #fff;
}

[data-theme="light"] .search-filter-menu button.active {
    color: #fff;
}

.search-filter-menu button:hover:not(.active) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

@media (max-width: 600px) {
  .search-form {
    flex-direction: column;
    gap: 0.5rem;
  }
  .search-bar-row {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    width: 100%;
  }
  .search-filter-dropdown {
    width: auto;
    flex-shrink: 0;
  }
  .search-input {
    flex: 1;
    min-width: 0;
  }
  .search-button {
    width: 100%;
  }
}


/* Device Legend Styles */
:root {
    --device-filter: invert(1);
}

[data-theme="light"] {
    --device-filter: none;
}

.search-results-title-container {
    display: flex;
    align-items: center;
}

.device-legend-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.device-legend-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--accent-primary);
}

.device-legend-menu {
    border: 1px solid var(--bg-tertiary);
    background: var(--bg-secondary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border-radius: 8px;
    min-width: 200px;
    padding: 0.75rem;
    z-index: 1001;
}

.device-legend-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    text-align: center;
    letter-spacing: 0.5px;
}

.device-legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.device-legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0;
    transition: background-color 0.2s ease;
    border-radius: 4px;
}

.device-legend-item:hover {
    background-color: var(--bg-tertiary);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.device-legend-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: var(--device-filter);
    flex-shrink: 0;
}

.device-legend-item span {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .search-results-title-container {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .device-legend-dropdown {
        order: 0;
    }
    
    .device-legend-menu {
        left: auto;
        right: 0;
        transform: none;
        margin-top: 8px;
        min-width: 180px;
        max-width: calc(100vw - 2rem);
    }
    
    .device-legend-icon {
        width: 18px;
        height: 18px;
    }
    
    .device-legend-item span {
        font-size: 0.8rem;
    }
}