/* ============================================
   DEVICE PAGES - List and Single Device Pages
   ============================================ */

/* Devices List Page */
.devices-page {
    padding: 2rem 0 4rem 0;
}

.devices-page .page-header {
    background: var(--bg-secondary);
    padding: 3rem 0;
    margin-bottom: 3rem;
    text-align: center;
}

.devices-page .page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.devices-page .page-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.devices-filter {
    max-width: 1400px;
    margin: 0 auto 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.filter-top-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-input {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.filter-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.filter-input:focus {
    border-color: #2563eb;
}

.filter-stats {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-align: center;
}

.filter-stats #filter-count {
    font-weight: 600;
    color: #2563eb;
}

.view-switcher {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
    background: var(--bg-color);
    border-radius: 8px;
}

.view-btn {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover {
    background: rgba(53, 132, 228, 0.1);
    color: #2563eb;
}

.view-btn.active {
    background: var(--bg-secondary);
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.device-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.device-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.device-card-image {
    height: 180px;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.device-card-image img {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
}

.device-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    height: 100%;
    color: var(--text-secondary);
    opacity: 0.5;
}

.device-placeholder svg {
    color: var(--text-secondary);
}

.device-placeholder span {
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    max-width: 80%;
}

.device-placeholder-large {
    opacity: 0.4;
}

.device-placeholder-large svg {
    width: 120px;
    height: 120px;
}

.device-placeholder-large span {
    font-size: 1rem;
}

.device-card-content {
    padding: 1.5rem;
}

.device-card-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.device-card-codename {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    margin-bottom: 0.5rem;
}

.device-card-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.device-card-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.device-card-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.device-card-link:hover {
    text-decoration: underline;
}

/* Table View Styles */
.devices-table-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* OS and Version Filters */
.os-version-filters {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

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

.filter-group-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    height: 1.2rem;
    line-height: 1.2rem;
    margin: 0;
}

.os-radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.os-radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.os-radio-label:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

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

.os-radio-label input[type="radio"]:checked {
    accent-color: var(--primary-color);
}

.os-radio-label:has(input[type="radio"]:checked) {
    background: rgba(53, 132, 228, 0.15);
    border-color: var(--primary-color);
}

.os-radio-label span {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.version-select {
    padding: 0.75rem 1.25rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 180px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.version-select:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.version-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(53, 132, 228, 0.2);
}

/* Toggle Switch */
.toggle-switch-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.toggle-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
}

.toggle-switch-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid var(--border-color);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch-checkbox:checked + .toggle-switch-slider {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.toggle-switch-checkbox:checked + .toggle-switch-slider:before {
    transform: translateX(24px);
}

.toggle-switch-slider:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.toggle-switch-checkbox:checked + .toggle-switch-slider:hover {
    background-color: var(--secondary-color);
}

/* Feature Filters */
.feature-filters {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

.filter-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.clear-filters-btn {
    padding: 0.4rem 0.75rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.clear-filters-btn:hover {
    background: #dc2626;
}

.filter-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.filter-tag:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.filter-tag .tag-name {
    user-select: none;
}

.filter-tag .tag-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: all 0.2s;
}

/* Filter states - visible on dark background */
.filter-tag[data-state="works"] {
    background: rgba(76, 175, 80, 0.2);
    border-color: var(--success-color);
    color: #a7f3d0;
}

.filter-tag[data-state="works"] .tag-indicator {
    background: var(--success-color);
    border-color: var(--success-color);
}

.filter-tag[data-state="partial"] {
    background: rgba(243, 156, 18, 0.2);
    border-color: #f59e0b;
    color: #fdc67b;
}

.filter-tag[data-state="partial"] .tag-indicator {
    background: #f59e0b;
    border-color: #f59e0b;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.devices-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.devices-table thead {
    background: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.devices-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    font-size: 0.85rem;
}

.devices-table th:not(.sticky-col) {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    text-align: center;
}

.devices-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.devices-table tbody tr {
    transition: background-color 0.15s;
}

.devices-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.sticky-col {
    position: sticky;
    left: 0;
    background: var(--bg-secondary);
    z-index: 5;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.3);
    min-width: 200px;
}

.devices-table thead .sticky-col {
    z-index: 11;
    background: var(--bg-color);
}

.devices-table tbody tr:hover .sticky-col {
    background: var(--bg-secondary);
    filter: brightness(1.05);
}

.device-info {
    padding: 0.75rem 1rem;
}

.device-name-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: opacity 0.2s;
}

.device-name-link:hover {
    opacity: 0.8;
}

.device-name-link:hover strong {
    color: #2563eb;
    text-decoration: underline;
}

.device-name {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.device-name strong {
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: color 0.2s;
}

.device-codename-small {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.feature-status {
    text-align: center;
    padding: 0.5rem;
}

.feature-header-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.feature-header-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.table-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    padding: 1rem;
    margin-top: 1rem;
    background: var(--bg-color);
    border-radius: var(--border-radius);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================
   DEVICE DETAIL PAGE - New Layout
   ============================================ */

.device-detail-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.device-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.device-header-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.device-name {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.device-codename-header {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.device-badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.device-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Main Layout: Content + Sidebar */
.device-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .device-layout {
        grid-template-columns: 1fr;
    }
    
    .device-sidebar {
        order: -1;
    }
}

.device-main-content {
    min-width: 0;
}

/* Device Sections */
.device-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

/* Hardware Specifications Grid */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.spec-category {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1.25rem;
}

.spec-category-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.spec-row {
    display: flex;
    font-size: 0.875rem;
    line-height: 1.5;
}

.spec-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 100px;
    flex-shrink: 0;
}

.spec-value {
    color: var(--text-secondary);
    flex: 1;
}

/* Sensors & Features */
.sensors-features {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.feature-tag {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    background: rgba(53, 132, 228, 0.15);
    border: 1px solid rgba(53, 132, 228, 0.3);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--primary-color);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* OS Support Section */
.os-subsection {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--primary-color);
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.os-subsection.eos-support {
    border-left-color: #16a34a;
}

.os-subsection-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.os-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.os-selector-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.os-selector-item {
    flex: 1;
    min-width: 200px;
}

.version-select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    cursor: pointer;
    transition: all 0.2s;
}

.version-select:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.version-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(53, 132, 228, 0.2);
}

/* Feature Matrix */
.feature-matrix-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.feature-matrix-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.feature-table-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

html[data-theme="light"] .feature-table-wrapper {
    background: #ffffff;
    border: 1px solid var(--border-color);
}

.status-legend {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Resources Grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.resource-column {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.resource-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 1rem 0;
}

.resource-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resource-links li {
    margin-bottom: 0.5rem;
}

.resource-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.resource-links a::before {
    content: '→';
    color: var(--primary-color);
}

.resource-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Sidebar Widgets */
.device-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-widget {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.widget-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.widget-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.comparison-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.device-select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.device-select:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.device-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(53, 132, 228, 0.2);
}

.compare-btn {
    width: 100%;
    padding: 0.6rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.compare-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(53, 132, 228, 0.4);
}

.quick-compare-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quick-compare-list li {
    margin-bottom: 0.5rem;
}

.quick-compare-list li:last-child {
    margin-bottom: 0;
}

.quick-compare-list a {
    display: block;
    padding: 0.6rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.quick-compare-list a:hover {
    background: rgba(53, 132, 228, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateX(4px);
}

.related-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-links li {
    margin-bottom: 0.5rem;
}

.related-links li:last-child {
    margin-bottom: 0;
}

.related-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

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

/* ============================================
   DEVICE STATISTICS WIDGET
   ============================================ */

.device-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.device-stats-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

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

.device-stats-table td:first-child {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.device-stats-table td:last-child {
    text-align: right;
    color: var(--text-primary);
    font-weight: 600;
}

.device-stats-table #stat-patches {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

.device-stats-table #stat-patches:hover {
    opacity: 0.7;
}

.device-stats-table .data-repo-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    transition: opacity 0.2s;
}

.device-stats-table .data-repo-link:hover {
    opacity: 0.7;
}

/* ============================================
   PATCHES SECTION
   ============================================ */

.patches-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.patch-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.2s;
}

.patch-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.2);
}

.patch-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.patch-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.patch-tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: rgba(53, 132, 228, 0.15);
    border: 1px solid rgba(53, 132, 228, 0.3);
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: var(--primary-color);
    font-weight: 500;
}

.patch-tag:first-child {
    background: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.3);
    color: var(--success-color);
}

.patch-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.patch-type {
    font-size: 0.85rem;
    opacity: 0.8;
}

.patch-timestamp {
    opacity: 0.7;
}

.patch-description {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.patch-link {
    margin-top: 0.5rem;
}

.patch-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.patch-link a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Light theme adjustments for patches */
html[data-theme="light"] .patch-item {
    background: rgba(0, 0, 0, 0.02);
}

html[data-theme="light"] .patch-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* ============================================
   DEVICE FEATURE CONTENT - OS-Specific Sections
   ============================================ */

.device-content-section {
    margin-top: 2rem;
}

.feature-details-intro {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(53, 132, 228, 0.1);
    border-left: 3px solid var(--primary-color);
    border-radius: 6px;
}

.feature-details-intro p {
    margin: 0;
    line-height: 1.6;
}

.device-feature-content {
    color: var(--text-secondary);
    line-height: 1.8;
}

.device-feature-content h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.device-feature-content h2:first-child {
    margin-top: 0;
}

.device-feature-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 1.5rem 0 0.75rem 0;
}

.device-feature-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.25rem 0 0.5rem 0;
}

.device-feature-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.device-feature-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.device-feature-content ul,
.device-feature-content ol {
    margin: 0.75rem 0 1.25rem 1.5rem;
    padding-left: 1rem;
}

.device-feature-content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.device-feature-content code {
    padding: 0.2rem 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85em;
    color: var(--primary-color);
}

.device-feature-content pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.device-feature-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-secondary);
}

/* OS-Specific Content Blocks */
.os-content {
    margin: 0;
    padding: 0;
}

.os-content p:first-child {
    margin-top: 0;
}

.os-content p:last-child {
    margin-bottom: 0;
}

/* Light theme adjustments for OS content */
html[data-theme="light"] .device-feature-content code {
    background: rgba(0, 0, 0, 0.05);
    color: #2563eb;
}

html[data-theme="light"] .device-feature-content pre {
    background: #f6f5f4;
}

/* Device Single Page */
.device-page {
    background: var(--bg-color);
}

.device-hero {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-color) 100%);
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
}

.device-hero-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.device-info h1.device-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.device-codename {
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-weight: 400;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.device-meta {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.device-meta span {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.device-type {
    color: var(--primary-color) !important;
    font-weight: 600;
}

.device-image {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.device-image img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.device-content {
    padding: 3rem 0;
}

.device-content .container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    max-width: 1400px;
}

.device-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.device-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.device-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.device-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.device-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

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

.spec-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.spec-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
    transform: translateY(-2px);
}

.spec-item h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.spec-item p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.spec-item p strong {
    color: var(--text-primary);
    font-weight: 600;
    margin-right: 0.5rem;
}

.os-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.eos-section {
    border-left: 3px solid #16a34a;
}

.pmos-section {
    border-left: 3px solid var(--primary-color);
}

.os-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
}

.os-details p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.os-details p strong {
    color: var(--text-primary);
    font-weight: 600;
    margin-right: 0.5rem;
}

.boot-modes,
.compatibility {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-matrix {
    margin-top: 1.5rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.feature-item {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.feature-name {
    font-size: 0.9rem;
    color: #1a1a1a;
    font-weight: 500;
}

.feature-status {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: capitalize;
}

.feature-item.status-works {
    background: #d1fae5;
    border-color: #a7f3d0;
}

.feature-item.status-works .feature-name {
    color: #065f46;
}

.feature-item.status-works .feature-status {
    color: #065f46;
}

.feature-item.status-partial {
    background: #fed7aa;
    border-color: #fdba74;
}

.feature-item.status-partial .feature-name {
    color: #92400e;
}

.feature-item.status-partial .feature-status {
    color: #92400e;
}

.feature-item.status-broken {
    background: #fee2e2;
    border-color: #fecaca;
}

.feature-item.status-broken .feature-name {
    color: #991b1b;
}

.feature-item.status-broken .feature-status {
    color: #991b1b;
}

.feature-item.status-unknown {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.feature-item.status-unknown .feature-name {
    color: #4b5563;
}

.feature-item.status-unknown .feature-status {
    color: #6b7280;
}

/* Light theme adjustments */
html[data-theme="light"] .device-card,
html[data-theme="light"] .device-section,
html[data-theme="light"] .sidebar-widget {
    background: #ffffff;
}

html[data-theme="light"] .spec-item,
html[data-theme="light"] .spec-category,
html[data-theme="light"] .resource-column,
html[data-theme="light"] .os-subsection {
    background: rgba(0, 0, 0, 0.02);
}

html[data-theme="light"] .device-image,
html[data-theme="light"] .device-card-image {
    background: #f6f5f4;
}

html[data-theme="light"] .nav-menu a:hover,
html[data-theme="light"] .nav-menu a.active {
    background: rgba(0, 0, 0, 0.05);
}

.issues-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.known-issues,
.workarounds {
    margin-bottom: 1.5rem;
}

.known-issues h4,
.workarounds h4 {
    color: var(--text-primary);
}

.known-issues ul,
.workarounds ul {
    list-style: none;
    padding: 0;
    margin-top: 0.75rem;
}

.known-issues li,
.workarounds li {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(244, 67, 54, 0.1);
    border-left: 3px solid var(--error-color);
    border-radius: 4px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.workarounds li {
    background: rgba(243, 156, 18, 0.1);
    border-left-color: #f59e0b;
}

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

.link-group h4 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.link-group ul {
    list-style: none;
    padding: 0;
}

.link-group li {
    margin-bottom: 0.75rem;
}

.link-group a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.link-group a::before {
    content: '→';
    color: var(--primary-color);
    font-weight: bold;
}

.link-group a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.last-updated {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.last-updated p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.last-updated strong {
    color: var(--text-primary);
}

/* Device Sidebar */
.device-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.comparison-widget,
.related-links {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.comparison-widget h3,
.related-links h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.comparison-widget p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.device-selector {
    margin-bottom: 2rem;
}

.device-selector label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.device-selector select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.device-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.device-selector .btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
}

.device-selector .btn:disabled {
    background: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    opacity: 0.5;
}

.device-selector .btn:not(:disabled):hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(53, 132, 228, 0.4);
}

.quick-compare {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.quick-compare h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.popular-devices {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quick-compare-link {
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: block;
}

.quick-compare-link:hover {
    background: rgba(53, 132, 228, 0.1);
    border-color: var(--primary-color);
    transform: translateX(4px);
    color: var(--primary-color);
}

.related-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-links li {
    margin-bottom: 0.75rem;
}

.related-links li:last-child {
    margin-bottom: 0;
}

.related-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.related-links a::before {
    content: '•';
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

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