/* ==================== CSS Variables ==================== */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-hover: #1D4ED8;
    --secondary: #10B981;
    --background: #FFFFFF;
    --surface: #F9FAFB;
    --surface-dark: #F3F4F6;
    --text: #111827;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    --hover: #F3F4F6;
    --shadow: rgba(0, 0, 0, 0.1);
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
}

[data-theme="dark"] {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --primary-hover: #2563EB;
    --secondary: #34D399;
    --background: #0F172A;
    --surface: #1E293B;
    --surface-dark: #334155;
    --text: #F1F5F9;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --border: #334155;
    --hover: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* ==================== Container ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==================== Header ==================== */
.header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px var(--shadow);
}

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

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

.logo i {
    font-size: 26px;
}

.logo-text {
    font-size: 22px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    font-size: 15px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

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

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

.mobile-menu {
    display: none;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px;
}

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

.mobile-menu .nav-link {
    display: block;
    padding: 12px;
}

/* ==================== Main Content ==================== */
.main-content {
    padding: 32px 0 64px;
    min-height: calc(100vh - 200px);
}

.results-summary {
    margin-bottom: 32px;
}

.results-summary h1 {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--text);
}

.results-summary p {
    color: var(--text-secondary);
    font-size: 16px;
}

.results-summary span {
    font-weight: 600;
    color: var(--primary);
}

.content-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 32px;
    align-items: start;
}

/* ==================== Filters Sidebar ==================== */
.filters-sidebar {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    position: sticky;
    top: 90px;
    border: 1px solid var(--border);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.filters-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.btn-text:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
    font-size: 14px;
}

.filter-label i {
    color: var(--primary);
    font-size: 16px;
}

/* Search Input */
.search-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 36px 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    color: var(--text);
    font-size: 14px;
    transition: border 0.2s;
}

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

.clear-search {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.clear-search:hover {
    background: var(--hover);
}

/* Range Slider */
.filter-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.filter-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.filter-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: color 0.2s;
}

.checkbox-label:hover {
    color: var(--primary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.feature-filter {
    cursor: pointer;
}

/* ==================== Table Section ==================== */
.table-section {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.mobile-filters-toggle {
    display: none;
    width: 100%;
    padding: 12px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
}

.mobile-filters-toggle i {
    margin-right: 8px;
}

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.vpn-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.vpn-table thead {
    background: var(--surface-dark);
    position: sticky;
    top: 0;
    z-index: 10;
}

.vpn-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vpn-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.vpn-table th.sortable:hover {
    background: var(--hover);
}

.vpn-table th i {
    margin-left: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.vpn-table th.sorted-asc i,
.vpn-table th.sorted-desc i {
    color: var(--primary);
}

.vpn-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

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

.vpn-table td {
    padding: 16px 12px;
    vertical-align: middle;
}

/* VPN Name Column */
.vpn-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: color 0.2s;
}

.vpn-name:hover {
    color: var(--primary-dark);
}

.vpn-name i {
    font-size: 18px;
}

.vpn-name span {
    white-space: nowrap;
}

/* Score Badges */
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 40px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
}

.score-badge i {
    font-size: 11px;
}

.score-badge.score-high {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.score-badge.score-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #D97706;
}

.score-badge.score-low {
    background: rgba(239, 68, 68, 0.15);
    color: #DC2626;
}

/* Check/Cross Icons */
.check-icon {
    color: var(--success);
    font-size: 18px;
}

.cross-icon {
    color: var(--danger);
    font-size: 18px;
}

/* Buttons */
.btn-primary {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
    width: 100%;
    padding: 12px 16px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Hidden Columns */
.hidden-column {
    display: none;
}

.vpn-table.show-hidden .hidden-column {
    display: table-cell;
}

/* ==================== Cookie Banner ==================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 2px solid var(--border);
    padding: 20px;
    z-index: 9999;
    box-shadow: 0 -4px 12px var(--shadow);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.cookie-content p {
    flex: 1;
    margin: 0;
    color: var(--text);
}

.cookie-buttons {
    display: flex;
    gap: 12px;
}

/* ==================== Footer ==================== */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 32px 0;
    margin-top: 64px;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer p {
    color: var(--text-secondary);
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

/* ==================== Responsive Design ==================== */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 260px 1fr;
        gap: 24px;
    }
    
    .filters-sidebar {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .results-summary h1 {
        font-size: 24px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .filters-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9998;
        max-width: 100%;
        border-radius: 0;
        overflow-y: auto;
        padding: 24px;
    }
    
    .filters-sidebar.active {
        display: block;
    }
    
    .mobile-filters-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .table-section {
        border-radius: 8px;
    }
    
    .vpn-table {
        font-size: 13px;
    }
    
    .vpn-table th,
    .vpn-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .vpn-name {
        font-size: 13px;
    }
    
    .btn-primary {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .score-badge {
        padding: 3px 8px;
        font-size: 12px;
        min-width: 35px;
    }
    
    .footer .container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .results-summary h1 {
        font-size: 20px;
    }
    
    .vpn-table th,
    .vpn-table td {
        padding: 8px 6px;
        font-size: 11px;
    }
}