/* ========== CSS Variables ========== */
:root {
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Light theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #dbeafe;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --border-light: #1e293b;
    --accent-light: #1e3a5f;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
}

/* ========== Reset & Base ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* ========== Navigation ========== */
.top-nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.875rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 700;
}

.logo:hover { color: var(--accent-color); }

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

.nav-dropdown { position: relative; }

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-dropdown-toggle::after { content: '▾'; font-size: 0.7em; }

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    min-width: 200px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
}

.nav-dropdown-menu.show { display: block; }

.nav-dropdown-menu a {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
}

.nav-dropdown-menu a:last-child { border-bottom: none; }
.nav-dropdown-menu a:hover { background: var(--bg-hover); }

.provider-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.125rem;
    padding: 0.25rem;
}

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

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        border-top: 1px solid var(--border-color);
    }
    .nav-links.show { display: flex; }
    .nav-dropdown-menu { position: static; margin-top: 0.25rem; box-shadow: none; }
    .nav-container { position: relative; }
}

/* ========== Layout ========== */
.app {
    display: flex;
    min-height: 100vh;
}

/* ========== Sidebar ========== */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.clear-filters {
    font-size: 0.8rem;
    color: var(--accent-color);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.clear-filters:hover {
    background: var(--accent-light);
}

.sidebar-content {
    flex: 1;
    padding: 0.75rem;
    overflow-y: auto;
}

/* ========== Filter Accordion ========== */
.filter-group {
    margin-bottom: 0.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    font: inherit;
}

.filter-header:hover {
    background: var(--bg-hover);
}

.filter-header:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.filter-header:focus:not(:focus-visible) {
    outline: none;
}

.filter-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.filter-group.collapsed .filter-toggle {
    transform: rotate(-90deg);
}

.filter-group.collapsed .filter-body {
    display: none;
}

.filter-body {
    padding: 0.5rem 1rem 1rem;
    border-top: 1px solid var(--border-light);
}

/* ========== Checkbox List ========== */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.checkbox-list.collapsed {
    max-height: 160px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0;
}

.checkbox-item input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.checkbox-item label {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.checkbox-item.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.checkbox-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
}

.show-more-btn {
    font-size: 0.75rem;
    color: var(--accent-color);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0;
    margin-top: 0.5rem;
}

/* ========== Range Slider ========== */
.range-filter {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.range-input-label {
    font-size: 0.625rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.range-input {
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.15s;
}

.range-input:hover {
    border-color: var(--text-muted);
}

.range-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.range-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.range-separator {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 1.125rem;
}

/* Dual Range Slider */
.dual-range-slider {
    position: relative;
    height: 32px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.dual-range-track {
    position: absolute;
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    cursor: pointer;
}

/* Larger clickable area for track */
.dual-range-track::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    bottom: -12px;
    cursor: pointer;
}

.dual-range-fill {
    position: absolute;
    height: 6px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-hover));
    border-radius: 3px;
    transition: left 0.1s, right 0.1s;
    pointer-events: none;
}

.dual-range-slider input[type="range"] {
    position: absolute;
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    z-index: 2;
}

.dual-range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    pointer-events: all;
    border: 3px solid var(--bg-card);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.15s, box-shadow 0.15s;
}

.dual-range-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.dual-range-slider input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.15);
}

.dual-range-slider input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    pointer-events: all;
    border: 3px solid var(--bg-card);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.15s, box-shadow 0.15s;
}

.dual-range-slider input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.range-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.range-preset {
    font-size: 0.6875rem;
    padding: 0.3rem 0.625rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.range-preset:hover,
.range-preset.active {
    background: var(--accent-light);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* ========== Main Content ========== */
.main {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: calc(100vw - 280px);
    overflow-x: hidden;
}

/* ========== Header ========== */
.header {
    padding: 1.25rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo span {
    color: var(--accent-color);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

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

.header-bottom {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ========== Search Box ========== */
.search-box {
    flex: 1;
    position: relative;
}

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

.search-input {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: border-color 0.15s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

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

/* ========== View Toggle ========== */
.view-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.view-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.view-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* ========== Sort Dropdown ========== */
.sort-dropdown {
    position: relative;
}

.sort-select {
    padding: 0.625rem 2rem 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.8125rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.sort-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* ========== Stats Bar ========== */
.stats-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.stats-value {
    font-weight: 600;
    color: var(--text-primary);
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-left: auto;
}

.active-filter {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--accent-color);
}

.active-filter button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
}

.active-filter button:hover {
    opacity: 1;
}

/* ========== Content Area ========== */
.content {
    flex: 1;
    padding: 1.5rem;
}

/* ========== Table View ========== */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.plans-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.plans-table th {
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

/* Specific column widths for better space management */
.plans-table th:nth-child(1) { width: 8%; }  /* Provider */
.plans-table th:nth-child(2) { width: 10%; } /* Plan */
.plans-table th:nth-child(3) { width: 5%; }  /* OS */
.plans-table th:nth-child(4) { width: 5%; }  /* CPU */
.plans-table th:nth-child(5) { width: 6%; }  /* RAM */
.plans-table th:nth-child(6) { width: 7%; }  /* Storage */
.plans-table th:nth-child(7) { width: 7%; }  /* Bandwidth */
.plans-table th:nth-child(8) { width: 10%; } /* Features */
.plans-table th:nth-child(9) { width: 8%; }  /* Price */
.plans-table th:nth-child(10) { width: 6%; } /* $/GB */
.plans-table th:nth-child(11) { width: 6%; } /* $/Core */
.plans-table th:nth-child(12) { width: 7%; } /* Billing */
.plans-table th:nth-child(13) { width: 6%; } /* Info */
.plans-table th:nth-child(14) { width: 9%; } /* Visit */

.plans-table th:hover {
    color: var(--text-primary);
}

.plans-table th.sorted {
    color: var(--accent-color);
}

.sort-icon {
    display: inline-block;
    margin-left: 0.25rem;
    opacity: 0.5;
}

.plans-table th.sorted .sort-icon {
    opacity: 1;
}

.plans-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
}

.plans-table tbody tr:hover {
    background: var(--bg-hover);
}

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

.provider-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.provider-logo {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    overflow: hidden;
}

.provider-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.provider-logo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
}

.plan-name {
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

.plan-tier {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.category-badge.cloud-vps { background: #dbeafe; color: #1e40af; }
.category-badge.cpu-optimized { background: #fef3c7; color: #92400e; }
.category-badge.memory-optimized { background: #d1fae5; color: #065f46; }
.category-badge.storage-vps { background: #ede9fe; color: #5b21b6; }

[data-theme="dark"] .category-badge.cloud-vps { background: #1e3a5f; color: #60a5fa; }
[data-theme="dark"] .category-badge.cpu-optimized { background: #422006; color: #fbbf24; }
[data-theme="dark"] .category-badge.memory-optimized { background: #064e3b; color: #34d399; }
[data-theme="dark"] .category-badge.storage-vps { background: #2e1065; color: #a78bfa; }

.os-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

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

/* Feature badges */
.features-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    max-width: 150px;
}

.feature-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.35rem;
    border-radius: var(--radius-sm);
    font-size: 0.6rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    opacity: 0.5;
}

.feature-badge.active {
    background: #d1fae5;
    color: #065f46;
    opacity: 1;
}

[data-theme="dark"] .feature-badge.active {
    background: #064e3b;
    color: #34d399;
}

/* Payment badge */
.payment-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.625rem;
    font-weight: 500;
    background: #e0e7ff;
    color: #3730a3;
}

[data-theme="dark"] .payment-badge {
    background: #312e81;
    color: #a5b4fc;
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.spec-value {
    font-weight: 500;
    color: var(--text-primary);
}

.spec-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.spec-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.price-cell {
    text-align: left;
}

.price-monthly {
    font-size: 1rem;
    font-weight: 600;
    color: var(--success-color);
}

.price-yearly {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.value-cell {
    text-align: left;
}

.value-metric {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.4rem 0.65rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

/* Compact buttons in table */
.plans-table .btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

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

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

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

.btn-info {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.4rem 0.65rem;
    border: 1px solid #bfdbfe;
    font-weight: 500;
}

[data-theme="dark"] .btn-info {
    background: #1e3a8a;
    color: #93c5fd;
    border-color: #1e40af;
}

/* Compact version in tables */
.plans-table .btn-info {
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
}

.btn-info:hover {
    background: #3b82f6;
    color: white;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .btn-info:hover {
    background: #3b82f6;
    color: white;
    border-color: #60a5fa;
}

.btn-info svg {
    flex-shrink: 0;
}

.info-cell, .visit-cell {
    text-align: left;
}

/* ========== Card View ========== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.2s;
}

.plan-card:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-provider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-provider-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    overflow: hidden;
}

.card-provider-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-provider-name {
    font-weight: 600;
    color: var(--text-primary);
}

.card-plan-name {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.card-price {
    text-align: right;
}

.card-price-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success-color);
}

.card-price-period {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-badges {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.card-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.card-spec {
    display: flex;
    flex-direction: column;
}

.card-spec-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.card-spec-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-actions .btn {
    flex: 1;
}

/* ========== Loading & Empty States ========== */
.loading-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

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

.empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-text {
    color: var(--text-secondary);
}

/* ========== Pagination ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
}

.page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
}

.page-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.page-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

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

.page-info {
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
    opacity: 0.7;
}

/* ========== Mobile Filter Toggle Button ========== */
.mobile-filter-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.mobile-filter-toggle:hover {
    background: var(--accent-hover);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Mobile close button for sidebar */
.sidebar-close {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    z-index: 10;
}

.sidebar-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1100; /* Above the nav */
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        z-index: 1099; /* Just below sidebar */
    }

    .main {
        margin-left: 0;
        max-width: 100vw;
    }

    .mobile-filter-toggle {
        display: flex;
    }

    .sidebar-close {
        display: flex;
    }

    .header-bottom {
        flex-wrap: wrap;
    }

    .search-box {
        flex: 1;
        min-width: 200px;
    }

    /* Table horizontal scroll on tablet */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .plans-table {
        min-width: 900px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .header-top {
        margin-bottom: 0.75rem;
    }

    .header-bottom {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .search-box {
        order: 1;
        width: 100%;
    }

    .view-toggle {
        order: 2;
        width: 100%;
        justify-content: center;
    }

    .view-btn {
        flex: 1;
        justify-content: center;
    }

    .sort-dropdown {
        order: 3;
        width: 100%;
    }

    .sort-select {
        width: 100%;
    }

    .mobile-filter-toggle {
        order: 4;
        width: 100%;
        justify-content: center;
    }

    .stats-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .active-filters {
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .content {
        padding: 1rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .plan-card {
        padding: 1rem;
    }

    .card-specs {
        gap: 0.5rem;
        padding: 0.75rem;
    }

    /* Pagination on mobile */
    .pagination {
        padding: 1rem;
        flex-wrap: wrap;
    }

    .page-btn {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    /* Footer on mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .seo-content {
        padding: 2rem 1rem;
    }

    .seo-section h2 {
        font-size: 1.25rem;
    }

    .seo-features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .logo span {
        font-size: 1rem;
    }

    .logo img {
        width: 28px;
        height: 28px;
    }

    .header {
        padding: 0.75rem;
    }

    .content {
        padding: 0.75rem;
    }

    .card-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .card-price {
        text-align: left;
    }

    .card-specs {
        grid-template-columns: 1fr 1fr;
    }

    .card-actions {
        flex-direction: column;
    }

    .card-actions .btn {
        width: 100%;
    }

    .pagination {
        gap: 0.25rem;
    }

    .page-info {
        width: 100%;
        text-align: center;
        order: -1;
        margin-bottom: 0.5rem;
    }

    /* Hide some page buttons on very small screens */
    .page-btn:not(.active):not(:first-child):not(:last-child):not(:nth-child(2)):not(:nth-last-child(2)) {
        display: none;
    }

    .stats-bar {
        font-size: 0.75rem;
    }

    .active-filter {
        font-size: 0.6875rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Hide elements based on view */
.view-table .cards-grid { display: none; }
.view-cards .table-container { display: none; }

.hidden { display: none !important; }

/* ========== SEO Content ========== */
.seo-content {
    background: var(--bg-secondary);
    padding: 3rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.seo-container {
    max-width: 1200px;
    margin: 0 auto;
}

.seo-section {
    margin-bottom: 2.5rem;
}

.seo-section:last-child { margin-bottom: 0; }

.seo-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.seo-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.seo-list {
    list-style: none;
    padding: 0;
}

.seo-list li {
    color: var(--text-secondary);
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.seo-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.seo-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.seo-feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.seo-feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.seo-feature-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========== Footer ========== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 1.5rem 1.5rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-section p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

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

.footer-stats strong {
    color: var(--accent-color);
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}
