:root {
    /* Dark Theme (Default) */
    --bg-base: #09090b;
    --bg-card: #18181b;
    --bg-hover: #27272a;
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --primary: #3b82f6; /* Modern Blue */
    --primary-hover: #2563eb;
    --border: #27272a;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --shadow-glass: 0 4px 30px rgba(0, 0, 0, 0.5);
    --border-glass: rgba(255, 255, 255, 0.05);
}

.light-theme {
    --bg-base: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --border: #e2e8f0;
    --shadow-glass: 0 4px 30px rgba(0, 0, 0, 0.05);
    --border-glass: rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1536px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    background-color: var(--bg-base);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.logo {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.logo-highlight {
    color: var(--primary);
}

.logo-sub {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    font-weight: 600;
}

.nav {
    display: none;
}
@media (min-width: 768px) {
    .nav {
        display: flex;
        gap: 1rem;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
    background-color: var(--bg-hover);
}

#theme-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    transition: all 0.2s;
}
#theme-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
}

/* Hero / Breadcrumb */
.hero-section {
    padding: 1.5rem 0 1rem 0;
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.05), transparent);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.breadcrumb .crumb {
    cursor: pointer;
    transition: color 0.2s;
}
.breadcrumb .crumb:hover {
    color: var(--text-main);
}

#page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

#page-subtitle {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* Data Panel */
.data-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    flex-wrap: wrap;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-container input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background-color: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.entries-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Custom Select Dropdown */
.custom-select {
    position: relative;
    user-select: none;
}

.select-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    color: var(--text-main);
    cursor: pointer;
    min-width: 70px;
}

.select-selected:hover {
    border-color: var(--text-muted);
}

.select-items {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 99;
    min-width: 100px;
    overflow: hidden;
}

.select-items div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    cursor: pointer;
    transition: background-color 0.2s;
}

.select-items div:hover {
    background-color: var(--bg-hover);
}

.check-icon {
    color: var(--primary);
}

.select-wrapper select option {
    background-color: var(--bg-card);
    color: var(--text-main);
}

.select-arrow {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
}

/* Content */
.content-container {
    padding: 2rem 1.5rem;
    flex: 1;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .grid-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

.letter-header {
    grid-column: 1 / -1;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

.letter-header:first-child {
    margin-top: 1rem;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
}

.pagination-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
}

.card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Table */
.table-container {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    background-color: rgba(255, 255, 255, 0.02);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr {
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}

.page-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--bg-hover);
}

.btn-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.current-page {
    background-color: var(--primary);
    color: #fff;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Top Loading Bar */
.top-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: transparent;
    z-index: 9999;
    overflow: hidden;
}

.top-loading-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background-color: var(--primary);
    box-shadow: 0 0 10px var(--primary), 0 0 5px var(--primary);
    animation: topLoadingAnim 1.5s infinite ease-in-out;
    border-radius: 3px;
}

@keyframes topLoadingAnim {
    0% { transform: translateX(-100%); width: 10%; }
    50% { width: 40%; }
    100% { transform: translateX(350%); width: 10%; }
}

.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 4rem 0;
}

.spinner {
    margin: 0 auto;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo .logo-text {
    font-size: 1rem;
    color: var(--text-muted);
}

.footer-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Theme Button */
#theme-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background-color 0.2s;
}

#theme-btn:hover {
    color: var(--text-main);
    background-color: var(--bg-hover);
}

/* ==================
   NEW COMPONENTS
   ================== */

/* Dropdown Menu */
.dropdown { position: relative; }
.dropdown:hover .dropdown-menu {
    display: block !important;
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    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);
    min-width: 150px;
    z-index: 100;
    padding: 0.5rem 0;
}
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    width: 100%;
    height: 0.5rem;
    background: transparent;
}
.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.dropdown-item:hover {
    background: var(--bg-hover);
}

/* Landing Page */
.landing-hero {
    max-width: 800px;
    margin: 4rem auto 2rem;
    text-align: center;
}
.landing-hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.05em;
}
.landing-hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    line-height: 1.6;
}
.landing-search-box {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    max-width: 600px;
    margin: 0 auto 1.5rem;
}
.landing-search-box input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
}
.landing-privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4rem;
}
.landing-networks {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}
.landing-networks p:first-child {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}
.landing-features {
    max-width: 1000px;
    margin: 4rem auto;
    padding-top: 4rem;
    border-top: 1px solid var(--border);
}
.landing-features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 12px;
}
.feature-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* BIN Checker Page */
.checker-hero {
    margin: 2rem 0 3rem;
}
.checker-hero h1 {
    font-size: 2.5rem;
    margin: 1rem 0 0.5rem;
}
.checker-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 12px;
    max-width: 600px;
    margin-bottom: 2rem;
}
.checker-box label {
    display: block;
    font-weight: 600;
    margin-bottom: 1rem;
}
.checker-input-group {
    display: flex;
    gap: 0.5rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 1rem;
}
.checker-input-group input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.5rem;
    color: var(--text-main);
    outline: none;
}
.checker-privacy-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Search Filters Grid */
.search-filters-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}
.btn-outline:hover {
    background: var(--bg-hover);
}

/* Custom Select & Horizontal Filter Grid */
.filter-grid {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 140px;
}
.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}
.filter-group input, .filter-group select, .custom-select {
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.75rem;
    border-radius: 6px;
    outline: none;
    width: 100%;
}
.filter-actions {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    flex: 0 0 auto;
}
.filter-actions .btn {
    padding: 0.75rem 1.5rem;
    height: 44px; /* Match input height */
}

/* Button variants */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}
.btn-outline:hover {
    background: var(--bg-hover);
}

/* Custom Select UI */
.custom-select {
    position: relative;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}
.select-selected {
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.75rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.select-selected::after {
    content: "";
    border: solid var(--text-muted);
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    margin-left: 10px;
    margin-bottom: 2px;
}
.select-items {
    position: absolute;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99;
    border-radius: 6px;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}
.select-items.hidden {
    display: none !important;
}
.select-search {
    padding: 0;
    border-bottom: 1px solid var(--border);
    display: block !important;
    position: relative;
    background: transparent;
}
.select-search .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    width: 16px;
    height: 16px;
}
.custom-select .select-search input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    border-radius: 0;
}
.select-items .select-options {
    overflow-y: auto;
    max-height: 250px;
    display: block;
    padding: 0.25rem;
}
.select-items .select-options::-webkit-scrollbar {
    width: 6px;
}
.select-items .select-options::-webkit-scrollbar-track {
    background: transparent;
}
.select-items .select-options::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 4px;
}
.select-items .select-options::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}
.select-items .select-options div {
    padding: 0.5rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: block;
    transition: background-color 0.15s ease;
}
.select-items .select-options div:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.nav-link:focus, .btn:focus { outline: none; }
.nav-link:focus-visible, .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

