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

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border-color: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-green: #3fb950;
    --accent-yellow: #d29922;
    --accent-red: #f85149;
    --accent-blue: #58a6ff;
    --hover-bg: #30363d;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(22, 27, 34, 0.9);
}

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

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

.header-content a {
    text-decoration: none;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

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

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

nav a:hover {
    color: var(--text-primary);
    background-color: var(--hover-bg);
}

.search-filter {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.5rem;
    margin: 2rem 0;
}

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

.filter-toggle {
    display: none;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.filter-toggle:hover {
    color: var(--text-primary);
}

.toggle-text {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
}

.toggle-icon {
    transition: transform 0.3s ease;
    width: 16px;
    height: 16px;
}

.filter-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .filter-toggle {
        display: flex;
    }

    .filter-grid {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    }

    .filter-grid.expanded {
        max-height: 1000px;
        opacity: 1;
        margin-top: 0;
    }
}

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

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
select {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.comparison-table {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: var(--bg-tertiary);
    position: sticky;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-primary);
}

th a {
    color: var(--text-primary);
    text-decoration: none;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

tr:hover {
    background-color: var(--hover-bg);
}

.device-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.device-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--hover-bg));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.device-name {
    font-weight: 500;
    color: var(--text-primary);
}

.device-name a {
    color: var(--text-primary);
    text-decoration: none;
}

.device-codename {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-yes {
    background-color: rgba(63, 185, 80, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(63, 185, 80, 0.3);
}

.badge-yes a {
    color: var(--accent-green);
    text-decoration: none;
}

.badge-no {
    background-color: rgba(248, 81, 73, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(248, 81, 73, 0.3);
}

.badge-no a {
    color: var(--accent-red);
    text-decoration: none;
}

.badge-partial {
    background-color: rgba(210, 153, 34, 0.15);
    color: var(--accent-yellow);
    border: 1px solid rgba(210, 153, 34, 0.3);
}

.badge-partial a {
    color: var(--accent-yellow);
    text-decoration: none;
}

.badge-unknown {
    background-color: rgba(139, 148, 158, 0.15);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.security-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.score-bar {
    width: 60px;
    height: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.score-high {
    background: linear-gradient(90deg, var(--accent-green), #4cc263);
}

.score-medium {
    background: linear-gradient(90deg, var(--accent-yellow), #e0a82e);
}

.score-low {
    background: linear-gradient(90deg, var(--accent-red), #ff6b6b);
}

.details-page {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 50rem;
}

.info-section {
    margin: 3rem 0;
    padding: 2rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

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

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.info-card {
    background-color: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.info-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--accent-blue);
}

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

.info-card a {
  color: var(--accent-blue);
}

footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer a {
    color: var(--accent-blue);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

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

    h1 {
        font-size: 1.5rem;
    }

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

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }

    .device-icon {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
}

.tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted var(--text-muted);
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 1000;
    margin-top: 0.5rem;
}

.disclaimer {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

/* Device Details Page Styles */
.device-details {
    max-width: 1200px;
    margin: 2rem auto;
}

.device-details-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.device-header-info {
    flex: 1;
}

.device-header-info h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.device-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    font-size: 1rem;
}

.separator {
    color: var(--text-muted);
}

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

.device-image-container {
    flex-shrink: 0;
}

.device-image {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

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

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

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

.feature-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.feature-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.feature-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.nav-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.button-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.button-secondary:hover {
    background-color: var(--hover-bg);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

@media (max-width: 768px) {
    .device-header {
        flex-direction: column;
        text-align: center;
    }

    .device-header-info h1 {
        font-size: 1.8rem;
    }

    .device-meta {
        justify-content: center;
        flex-wrap: wrap;
    }

    .device-image {
        max-width: 150px;
        max-height: 150px;
    }

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

    .info-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .info-label {
        font-size: 0.85rem;
    }

    .security-item {
        flex-direction: column;
        text-align: center;
    }
}
