:root {
    --primary-color: #00B1F2;
    --text-color: #333;
    --bg-color: #fff;
    --button-hover-bg: #00000040;
    --button-color: #00c192;
    --form-bg-color: #f0f0f0;
    --pin-bg-color: white;
    --drop-zone-overlay-bg: rgba(255, 255, 255, 0.8);
    --drop-zone-overlay-hover: #c0c0c0;
    --login-bg-color: white;
    --card-bg: #f5f5f5;
    --drag-color: rgba(33, 150, 243, 0.1);
    --header-bg: #1a1a1a;
    --border-color: #eee;
    --code-bg: #f5f7f9;
    --code-color: #2d3748;
    --error-color: #f44336;
    --text-muted: rgba(0, 0, 0, 0.6);
    --link-color: var(--primary-color);
    --link-visited-color: #0091c7;
    --standard-bg: #e3f2fd;
    --standard-color: #1976d2;
    --standard-hover-bg: #1976d2;
    --standard-hover-color: #fff;
    --feature-bg: #e5e5e5;
    --feature-color: #424242;
    --feature-hover-bg: #424242;
    --feature-hover-color: #fff;
    --chip-bg: var(--primary-color);
    --chip-color: #fff;
    --difficulty-1-bg: #e8f5e9;
    --difficulty-1-color: #2e7d32;
    --difficulty-1-hover-bg: #2e7d32;
    --difficulty-1-hover-color: #fff;
    --difficulty-2-bg: #e3f2fd;
    --difficulty-2-color: #1976d2;
    --difficulty-2-hover-bg: #1976d2;
    --difficulty-2-hover-color: #fff;
    --difficulty-3-bg: #fff3e0;
    --difficulty-3-color: #f57c00;
    --difficulty-3-hover-bg: #f57c00;
    --difficulty-3-hover-color: #fff;
    --difficulty-4-bg: #fce4ec;
    --difficulty-4-color: #c2185b;
    --difficulty-4-hover-bg: #c2185b;
    --difficulty-4-hover-color: #fff;
    --difficulty-5-bg: #ffebee;
    --difficulty-5-color: #c62828;
    --difficulty-5-hover-bg: #c62828;
    --difficulty-5-hover-color: #fff;
    --footer-link-color: rgba(255, 255, 255, 0.7);
    --footer-link-hover-color: var(--primary-color);
}

[data-theme="dark"] {
    --text-color: #e4e4e4;
    --bg-color: #1a1a1a;
    --button-hover-bg: #00000080;
    --form-bg-color: #0e0e0e;
    --pin-bg-color: black;
    --drop-zone-overlay-bg: rgba(0, 0, 0, 0.8);
    --login-bg-color: var(--bg-color);
    --card-bg: #2d2d2d;
    --header-bg: #000;
    --border-color: #333;
    --code-bg: #2d2d2d;
    --code-color: #e4e4e4;
    --text-muted: rgba(255, 255, 255, 0.6);
    --link-visited-color: #9575cd;
    --standard-bg: rgba(25, 118, 210, 0.2);
    --standard-color: #64b5f6;
    --standard-hover-bg: #64b5f6;
    --standard-hover-color: #000;
    --feature-bg: #444;
    --feature-color: #e0e0e0;
    --feature-hover-bg: #e0e0e0;
    --feature-hover-color: #000;
    --difficulty-1-bg: rgba(46, 125, 50, 0.2);
    --difficulty-1-color: #81c784;
    --difficulty-1-hover-bg: #81c784;
    --difficulty-1-hover-color: #000;
    --difficulty-2-bg: rgba(25, 118, 210, 0.2);
    --difficulty-2-color: #64b5f6;
    --difficulty-2-hover-bg: #64b5f6;
    --difficulty-2-hover-color: #000;
    --difficulty-3-bg: rgba(245, 124, 0, 0.2);
    --difficulty-3-color: #ffb74d;
    --difficulty-3-hover-bg: #ffb74d;
    --difficulty-3-hover-color: #000;
    --difficulty-4-bg: rgba(194, 24, 91, 0.2);
    --difficulty-4-color: #f06292;
    --difficulty-4-hover-bg: #f06292;
    --difficulty-4-hover-color: #000;
    --difficulty-5-bg: rgba(198, 40, 40, 0.2);
    --difficulty-5-color: #e57373;
    --difficulty-5-hover-bg: #e57373;
    --difficulty-5-hover-color: #000;
}

[data-theme="dark"] .made-for-esphome {
    background: var(--card-bg);
}

[data-theme="dark"] .made-for-content .made-for-esphome {
    background: var(--card-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .made-for-content .made-for-esphome:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .device-image-container .made-for-esphome {
    background: rgba(45, 45, 45, 0.9);
}

[data-theme="dark"] .dropdown-menu {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-item:hover {
    background: var(--header-bg);
}

[data-theme="dark"] tr:nth-child(even) {
    background-color: var(--header-bg);
}

[data-theme="dark"] tr:hover {
    background-color: var(--card-bg);
}

[data-theme="dark"] .pagefind-ui__result {
    border-color: var(--border-color);
}

[data-theme="dark"] .pagefind-ui__result:hover {
    background: var(--card-bg);
}

[data-theme="dark"] .pagefind-ui__message {
    color: var(--text-color);
}

[data-theme="dark"] .pagefind-ui__button {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .pagefind-ui__button:hover {
    background: var(--header-bg);
}

p {
    margin-bottom: 0.5rem;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    transition: color 0.15s ease, background-color 0.15s ease;
    overflow-x: hidden;
}

*, *::before, *::after {
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:visited {
    color: var(--link-visited-color);
}

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

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

header {
    background: var(--header-bg);
    padding: 0.75rem 0;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

nav {
    display: flex;
    align-items: center;
    width: 100%;
}


/* Logo */
.dark-logo {
    display: none;
}

.light-logo {
    display: block;
}

[data-theme="dark"] .dark-logo {
    display: block;
}

[data-theme="dark"] .light-logo {
    display: none;
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--footer-link-color);
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    color: var(--footer-link-hover-color);
    background: rgba(255, 255, 255, 0.1);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .moon-icon,
[data-theme="light"] .sun-icon {
    display: block;
}

.search-container {
    position: relative;
    width: 300px;
    margin: 0 1rem;
}

.comment {
    font-size: 80%;
    font-weight: normal;
    padding-left: .5rem;
    padding-right: .5rem;
}

/* Made for ESPHome section */
.made-for-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.made-for-content p {
    margin: 0;
    flex: 1;
}

.made-for-esphome {
    display: block;
    background: var(--bg-color);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.2s ease;
}

.made-for-content .made-for-esphome {
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .made-for-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Made for ESPHome logo */
.device-page {
    position: relative;
}

.device-page .made-for-esphome {
    position: absolute;
    top: 15px;
    right: 0;
    background: var(--bg-color);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.2s ease;
}

.made-for-esphome:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.badge-logo {
    width: 160px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.badge-logo.dark-badge {
    display: none;
}

[data-theme="dark"] .badge-logo.light-badge {
    display: none;
}

[data-theme="dark"] .badge-logo.dark-badge {
    display: block;
}

@media (max-width: 1023px) {
    .made-for-esphome {
        display: none;
    }
    
    .device-image-container {
        position: relative;
    }
    
    .device-image-container .made-for-esphome {
        display: block;
        position: absolute;
        top: 10px;
        right: 10px;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: none;
    }
    
    .device-image-container .badge-logo {
        width: 120px;
    }
}

/* Content images */
.device-page img:not(.device-image):not(.badge-logo) {
    max-width: 800px;
    width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Table styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background-color: var(--bg-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--code-bg);
    font-weight: 600;
    white-space: nowrap;
}

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

tr:nth-child(even) {
    background-color: var(--code-bg);
}

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

/* Pagefind UI customization */
.pagefind-ui {
    --pagefind-ui-scale: 0.95;
    --pagefind-ui-primary: var(--primary-color);
    --pagefind-ui-text: var(--text-color);
    --pagefind-ui-background: var(--bg-color);
    --pagefind-ui-border: var(--border-color);
    --pagefind-ui-border-width: 1px;
    --pagefind-ui-border-radius: 8px;
    --pagefind-ui-image-border-radius: 8px;
    --pagefind-ui-font: inherit;
}

.pagefind-ui .pagefind-ui__search-input {
    border-radius: 8px;
    padding: 0.375rem 2.5rem 0.375rem 1rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    width: 100%;
    line-height: 1.5;
}

[data-theme="dark"] .pagefind-ui .pagefind-ui__search-input {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
}

.pagefind-ui .pagefind-ui__search-input::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] .pagefind-ui .pagefind-ui__search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}


.pagefind-ui .pagefind-ui__drawer {
    position: absolute;
    z-index: 9999;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (min-width: 1024px) {
    .pagefind-ui .pagefind-ui__drawer {
        width: 640px;
        right: auto;
        transform: translateX(-50%);
    }
}

.pagefind-ui .pagefind-ui__results-area {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    background: var(--bg-color);
    padding: 1rem;
}

.pagefind-ui .pagefind-ui__message {
    color: var(--text-color);
    padding: 1rem;
}

.pagefind-ui .pagefind-ui__result {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.pagefind-ui .pagefind-ui__result:last-child {
    border-bottom: none;
}

.pagefind-ui .pagefind-ui__result-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.pagefind-ui .pagefind-ui__result-excerpt {
    color: var(--text-color);
    font-size: 0.875rem;
}

@media (max-width: 767px) {
    header .container {
        gap: 0.5rem;
    }

    nav {
        flex-wrap: wrap;
    }

    .logo {
        flex: 1;
        margin-right: 0;
    }

    .menu-toggle {
        margin-left: 0;
    }

    .search-container {
        width: 100%;
        margin: 0.75rem 0 0;
        order: 2;
    }

    .pagefind-ui .pagefind-ui__drawer {
        position: fixed;
        top: auto;
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        margin-top: 0;
    }

    .pagefind-ui .pagefind-ui__results-area {
        max-height: calc(100vh - 250px);
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 500;
    margin-right: auto;
    padding: 0.25rem 0;
}

@media (min-width: 640px) {
    .logo {
        gap: 1rem;
        font-size: 1.25rem;
    }
}

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

@media (min-width: 640px) {
    .logo img {
        height: 32px;
    }
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.85);
    padding: 0.5rem;
    cursor: pointer;
    margin-left: auto;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.menu-toggle:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.menu-toggle svg {
    width: 20px;
    height: 20px;
}

@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }
}

.menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--header-bg);
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    gap: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.menu.active {
    display: flex;
}

@media (max-width: 767px) {
    .menu-item {
        width: 100%;
        text-align: left;
        padding: 0.75rem 1rem;
    }

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

@media (min-width: 768px) {
    .menu {
        position: static;
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 0;
        background: none;
        box-shadow: none;
        gap: 1rem;
        margin-left: 1.5rem;
        border-top: none;
    }
}

@media (min-width: 1024px) {
    .menu {
        gap: 1.5rem;
        margin-left: 2rem;
    }
}

.menu-item, .dropdown-toggle {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-toggle svg {
    transition: transform 0.2s;
}

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

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 0.5rem;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}
.dropdown-item:visited {
    color: var(--text-color);
}

.dropdown-item:hover {
    background: var(--primary-color);
}

@media (max-width: 767px) {
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0.5rem 0 0.5rem 1rem;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
    }

    .dropdown-toggle svg {
        display: none;
    }

    .dropdown-item {
        padding: 0.75rem 1rem;
    }
}

@media (min-width: 640px) {
    .menu-item {
        font-size: 1.1rem;
    }
}

.menu-item.active {
    color: white;
    background: var(--primary-color);
}

.menu-item:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.menu-item.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

main {
    padding: 2rem 0;
}

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

.view-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.view-toggle button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    color: var(--text-color);
}

.view-toggle button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--card-bg);
}

.view-toggle button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

[data-theme="dark"] .view-toggle button {
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .view-toggle button:hover {
    border-color: var(--link-color);
    color: var(--link-color);
    background: var(--card-bg);
}

[data-theme="dark"] .view-toggle button.active {
    background: var(--link-color);
    color: var(--bg-color);
    border-color: var(--link-color);
}

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

/* Pagination styles */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.page-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.page-nav:hover {
    background-color: var(--card-bg);
}

.page-nav svg {
    width: 20px;
    height: 20px;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.page-number:hover {
    background-color: var(--card-bg);
}

.page-number.active {
    background-color: var(--primary-color);
    color: white;
}

.page-ellipsis {
    color: var(--text-muted);
    padding: 0 0.25rem;
}

.device-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.device-list .device-card {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
}

.device-list .device-image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.device-list .device-info {
    flex: 1;
    padding: 0;
}

.device-list .device-info h2,
.device-list .device-info h3 {
    margin-bottom: 0.5rem;
}

.device-list .device-meta {
    margin-top: 0.5rem;
}

.device-card {
    background: var(--bg-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

/* Card image styles */
.device-card .image-container {
    position: relative;
    width: 100%;
    padding-top: 66.67%; /* 3:2 aspect ratio */
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.device-card .image-container a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.device-card .device-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--card-bg);
    padding: 0.5rem;
    transition: transform 0.2s ease;
}

.device-card .image-container a:hover .device-image {
    transform: scale(1.05);
}

/* Pagination styles */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

.pagination-numbers {
    display: flex;
    gap: 0.5rem;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.pagination-link svg {
    width: 16px;
    height: 16px;
}

.pagination-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.pagination-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

@media (max-width: 767px) {
    .pagination {
        flex-direction: column;
        gap: 1rem;
    }

    .pagination-numbers {
        order: -1;
    }
}

/* List view image styles */
.device-list .image-container {
    padding-top: 0;
    width: 80px;
    height: 80px;
    border: none;
}

.device-list .device-image {
    position: static;
    width: 80px;
    height: 80px;
    padding: 0.25rem;
}

.device-list .device-card {
    padding: 0.375rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.device-list .device-card:hover {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.device-list .device-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
    flex: 1;
    min-width: 0; /* Enable text truncation */
}

.device-list .device-info h3 {
    margin: 0;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0; /* Enable text truncation */
}

.device-list .device-info h3 a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-list .device-meta {
    display: none;
}

.device-list .device-tags {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.device-list .tag {
    margin: 0;
    font-size: 0.9rem;
    padding: 0.15rem 0.5rem;
}

/* Categories styles */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

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

.category-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.category-card h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.category-card h2 a {
    color: inherit;
    text-decoration: none;
}

.category-card .count {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.preview-devices {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-color);
}

.preview-device {
    display: block;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-muted);
}

/* Single page image styles */
.device-page .device-images {
    margin: 2rem 0;
    display: grid;
    justify-items: center;
    align-items: center;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.device-page .device-image {
    object-fit: contain;
    max-width: 100%;
    max-height: 640px;
    width: auto;
    align-self: center;
    margin: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.device-info {
    padding: 1.25rem;
}

.device-info h2 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.device-info a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.device-info a:hover {
    color: var(--primary-color);
}

.device-meta {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-color);
    opacity: 0.7;
}

.device-meta time {
    display: inline-block;
    font-weight: 500;
}

.button {
    cursor: pointer;
}

img.tag.button {
    margin-top: 0.15rem;
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
    padding: 0;
    background: transparent;
}

img.tag.button:hover {
    background-color: var(--button-hover-bg);
}

[data-theme="dark"] img.tag.button {
    filter: invert(1);
}

.selected-tags {
    display: flex;
}
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    margin: 0 0.25rem 0.25rem 0;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tag.chip {
    background: var(--primary-color);
    color: white;
    opacity: 0.9;
}

.tag.standard {
    background: var(--standard-bg);
    color: var(--standard-color);
}

.tag.standard:hover {
    background: var(--standard-hover-bg);
    color: var(--standard-hover-color);
    transform: translateY(-1px);
}

.tag.feature {
    background: var(--feature-bg);
    color: var(--feature-color);
}

.tag.feature:hover {
    background: var(--feature-hover-bg);
    color: var(--feature-hover-color);
    transform: translateY(-1px);
}

.tag.difficulty {
    transition: all 0.2s ease;
}

.tag.difficulty.level-1 {
    background: var(--difficulty-1-bg);
    color: var(--difficulty-1-color);
}

.tag.difficulty.level-1:hover {
    background: var(--difficulty-1-hover-bg);
    color: var(--difficulty-1-hover-color);
    transform: translateY(-1px);
}

.tag.difficulty.level-2 {
    background: var(--difficulty-2-bg);
    color: var(--difficulty-2-color);
}

.tag.difficulty.level-2:hover {
    background: var(--difficulty-2-hover-bg);
    color: var(--difficulty-2-hover-color);
    transform: translateY(-1px);
}

.tag.difficulty.level-3 {
    background: var(--difficulty-3-bg);
    color: var(--difficulty-3-color);
}

.tag.difficulty.level-3:hover {
    background: var(--difficulty-3-hover-bg);
    color: var(--difficulty-3-hover-color);
    transform: translateY(-1px);
}

.tag.difficulty.level-4 {
    background: var(--difficulty-4-bg);
    color: var(--difficulty-4-color);
}

.tag.difficulty.level-4:hover {
    background: var(--difficulty-4-hover-bg);
    color: var(--difficulty-4-hover-color);
    transform: translateY(-1px);
}

.tag.difficulty.level-5 {
    background: var(--difficulty-5-bg);
    color: var(--difficulty-5-color);
}

.tag.difficulty.level-5:hover {
    background: var(--difficulty-5-hover-bg);
    color: var(--difficulty-5-hover-color);
    transform: translateY(-1px);
}

.tag.button {
    border-radius: 0.75rem;
}

footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

footer .container {
    display: flex;
    align-items: center;
}

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

.footer-left {
    display: flex;
    align-items: center;
}

.footer-left p {
    margin: 0;
}

.version-info-button {
    color: var(--footer-link-color);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0;
    text-decoration: none;
}

.version-info-popup {
    position: fixed;
    bottom: 4rem;
    right: 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.version-info-popup[hidden] {
    display: none;
}

.version-info-content {
    position: relative;
}

.version-info-content p {
    margin: 0.5rem 0;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9rem;
    justify-content: left;
}

.close-version-info {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.2rem;
}

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

.footer-links a {
    color: var(--footer-link-color);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

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

@media (max-width: 767px) {
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

.device-page {
    padding: 2rem 0;
}

.content h1, .device-page h1 {
    font-size: 2rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin-bottom: 2rem;
}

.content h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.device-page h2 {
    font-size: 1.5rem;
    margin: 2.5rem 0 1rem;
    color: var(--text-color);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.device-page h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-color);
}

.device-page p {
    margin: 1rem 0;
    line-height: 1.6;
}

.device-page ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.device-page li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.gpio-table {
    margin: 2rem 0;
}

.gpio-table h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.gpio-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin: 0;
}

.gpio-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    border-bottom: none;
    font-weight: 600;
    white-space: nowrap;
}

.gpio-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    line-height: 1.4;
}

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

.gpio-table tr:hover {
    background-color: var(--card-bg);
}

.gpio-table .category-header {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background-color 0.2s ease;
}

.gpio-table .category-header td {
    padding: 0.5rem 1rem;
}

.gpio-table .category-header:not(:first-child) {
    border-top: 1px solid var(--border-color);
}

.gpio-table .category-header:hover {
    background: var(--primary-color);
}

.gpio-table code {
    font-family: 'SF Mono', Consolas, Monaco, 'Andale Mono', monospace;
    background: var(--code-bg);
    color: var(--code-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.gpio-table code:hover {
    background: var(--primary-color);
    color: white;
}

.config-section {
    margin-top: 2rem;
}

.config-section pre {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.config-section code {
    font-family: 'SF Mono', Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.device-page h1 {
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.device-page .board-name {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1.25rem;
    font-weight: 600;
    font-family: 'SF Mono', Consolas, Monaco, 'Andale Mono', monospace;
    background: #f5f5f5;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    display: inline-block;
}

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

.product-link {
    margin-bottom: 2rem;
}

.product-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.product-link a:hover {
    border-bottom-color: var(--primary-color);
}

.device-images {
    margin: 2rem 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .device-images {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem;
    }
}

@media (min-width: 1280px) {
    .device-images {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.device-images picture {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

.device-images picture:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.device-images  > img {
    width: 100%;
    min-height: 300px;
    max-height: 600px;
    object-fit: contain;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 4px;
}

.code-block {
    position: relative;
    background: var(--card-bg);
    border-radius: 8px;
    margin: 1rem 0;
}

.yaml-content {
    position: relative;
    overflow-x: auto;
}

.yaml-content pre {
    margin: 0;
    padding: 1.25rem;
}

#YAMLGroup {
    position: relative;
}
#yamlValidateButton {
    width: 2rem;
    height: 2rem;
    padding: 0;
    position: absolute;
    bottom: 10px;
    right: 10px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    z-index: 100;
}
#uploadYamlFile {
    width: 2rem;
    height: 2rem;
    padding: 0;
    position: absolute;
    top: 10px;
    right: 10px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    background: transparent;
    z-index: 100;
}
.copy-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: all 0.2s ease;
    z-index: 1;
}

.copy-button:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.copy-button svg {
    width: 16px;
    height: 16px;
}

.copy-feedback {
    position: absolute;
    right: calc(100% + 0.5rem);
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-color);
    color: var(--bg-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Pagination styles */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1rem;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.5rem;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.page-number:hover {
    background: var(--border-color);
}

.page-number.active {
    background: var(--primary-color);
    color: white;
}

.page-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.page-nav:hover {
    background: var(--border-color);
}

.page-nav svg {
    width: 1.25rem;
    height: 1.25rem;
}

.page-ellipsis {
    color: var(--text-muted);
    padding: 0 0.25rem;
}

@media (max-width: 640px) {
    .pagination {
        flex-direction: column;
        gap: 1rem;
    }

    .page-numbers {
        order: -1;
    }
}

.copy-button.copied .copy-feedback {
    opacity: 1;
}

.content-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
    object-fit: contain;
}

.device-content {
    margin: 2rem 0;
}

.config-section {
    margin: 2rem 0;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
}

pre {
    background: #272822;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

footer {
    background: var(--header-bg);
    color: rgba(255, 255, 255, 0.85);
    padding: 1rem 0;
    margin-top: 2rem;
    font-size: 0.9375rem;
}

footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
}

footer a {
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

footer a:hover {
    opacity: 1;
}

.ohf-logo {
    height: 20px;
    width: auto;
    vertical-align: middle;
    opacity: 0.85;
    transition: opacity 0.2s ease;
    filter: brightness(0) invert(1);
}

@media (max-width: 640px) {
    footer {
        font-size: 0.875rem;
    }
    
    .ohf-logo {
        height: 18px;
    }
}

/* Form styles */

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group.error {
    animation: shake 0.4s linear;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

.form-group.error input,
.form-group.error textarea,
.form-group.error select,
.form-group.error .drop-zone,
.form-group.error .CodeMirror {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25) !important;
}

.error-message {
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 4px;
    min-height: 1.25em;
    transition: all 0.2s ease;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: none;
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
    font-weight: 500;
    white-space: nowrap;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.label-container {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

label {
    font-weight: bold;
}

.info-icon {
    margin-right: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    margin-left: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s ease;
}

.info-icon:hover {
    color: #1976D2;
}

.info-popup {
    display: none;
    position: absolute;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    max-width: 300px;
    margin-top: 5px;
}

.info-popup-content {
    padding: 24px;
    font-size: 14px;
}

.info-popup h3 {
    margin: 0 0 10px 0;
    color: var(--primary-color);
    font-size: 16px;
}

.info-popup p {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.info-tag {
    background: var(--feature-bg);
    color: var(--feature-color);
    white-space: nowrap;
    display: inline-block;
    margin-right: 5px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: filter 0.3s ease-in-out;
}

.info-tag:hover {
    filter: brightness(80%); /* Darkens by 20% */
}

.info-tag.selected {
    background: var(--primary-color);
    color: white;
}

.info-standard {
    white-space: nowrap;
    display: inline-block;
    margin-right: 5px;
    background: var(--standard-bg);
    color: var(--standard-color);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: filter 0.3s ease-in-out;
}

.info-standard:hover {
    filter: brightness(80%); /* Darkens by 20% */
}

.info-standard.selected {
    background: var(--primary-color);
    color: white;
}

input[type="text"],
input[type="url"],
textarea,
select {
    background-color: var(--form-bg-color);
    color: var(--text-color);
    width: 100%;
    padding: 8px;
    border-color: var(--border-color);
    border-style: solid;
    border-width: 1px;
    border-radius: 4px;
    font-size: 14px;
}

input[type="text"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

button {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

button.loading {
    background-color: var(--primary-color);
    opacity: 0.8;
    cursor: wait;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    right: 10px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s infinite linear;
}

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

.github-login-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #f5f5f5;
    padding: 8px;
    border-radius: 4px;
}

.github-logo {
    width: 24px;
    height: 24px;
}

.github-logo.dark-logo {
    filter: brightness(0.7);
}

.github-login {
    background-color: #24292e;
    padding: 8px 16px;
}

.github-login:hover {
    background-color: #1a1f23;
}

.login-text {
    font-size: 14px;
    font-weight: 500;
}

button:hover {
    background-color: #1976D2;
}

#gpioPinContainer {
    border: 1px solid #ddd;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.gpio-entry {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.gpio-entry button {
    background-color: var(--error-color);
}

.gpio-entry button:hover {
    background-color: #d32f2f;
}

.gpio-pin-list {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 4px;
}

.gpio-pin-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
}

.gpio-pin-item:hover {
    border-color: #4CAF50;
    background: var(--button-hover-bg);
}

.pin-number {
    font-family: monospace;
    font-weight: bold;
    color: #666;
    min-width: 70px;
}

input.pin-function {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: var(--pin-bg-color);
}

.pin-function:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.drop-zone {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 4px;
    padding: 20px;
    transition: border-color 0.3s ease;
    background: #fff;
}

.drop-zone.drag-over {
    border-color: #4CAF50;
    background: #f0f9f0;
}

.drop-zone-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
}

.drop-zone-text {
    color: #666;
    font-size: 14px;
}

.file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.image-preview {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    min-height: 100px;
}

.preview-image {
    max-height: 100px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.select-chip-message {
    text-align: center;
    color: #666;
    padding: 20px;
    font-style: italic;
    background: var(--card-bg);
    border-radius: 4px;
    margin: 10px 0;
    grid-column: 1 / -1;
}

.tags-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.github-login {
    display: flex;
    align-items: center;
    background: #24292e;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.github-login:hover {
    background: #2c3238;
}

.github-login img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.hidden {
    display: none !important;
}

.user-avatar-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.user-avatar-wrapper:hover {
    background-color: var(--feature-hover-color);
    color: var(--text-color);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #24292e;
}

.dropdown-arrow {
    font-size: 12px;
    color: #666;
    margin-left: 4px;
    transition: transform 0.2s;
}


.user-dropdown.show {
    display: block;
}

.dropdown-arrow.rotated {
    transform: rotate(180deg);
}

.user-dropdown-button {
    display: block;
    width: 100%;
    padding: 8px 16px;
    text-align: left;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}
/* Form validation styles */
.form-group.error {
    animation: none;
}

.form-group.error input,
.form-group.error textarea,
.form-group.error select,
.form-group.error .drop-zone,
.form-group.error .CodeMirror {
    border-color: transparent;
    box-shadow: none;
}

.form-group.error.validate input,
.form-group.error.validate textarea,
.form-group.error.validate select,
.form-group.error.validate .drop-zone,
.form-group.error.validate .CodeMirror {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25) !important;
}

/* Drop zone overlay styles */
.drop-zone {
    position: relative;
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
    background: var(--card-bg);
}

.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: var(--drag-color);
}

.drop-zone-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--drop-zone-overlay-bg);
    font-size: 14px;
    color: #666;
    z-index: 30;
    pointer-events: auto;
    transition: all 0.3s ease;
}

.drop-zone.has-content .drop-zone-overlay {
    opacity: 0;
    pointer-events: none;
}

.drop-zone .CodeMirror {
    z-index: 20;
    border: none;
    height: auto !important;
    min-height: 200px;
}

.drop-zone.drag-over .CodeMirror {
    opacity: 0.5;
}

.tags-input-container {
    position: relative;
}

.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.tag-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tag-suggestion-item:hover,
.tag-suggestion-item.highlighted {
    background: var(--feature-hover-color);
}

.tag-remove {
    cursor: pointer;
    padding-left: 0.5rem;
    font-size: 18px;
    line-height: 1;
    color: #666;
}

.tag-remove:hover {
    color: var(--bg-color);
}

.input-help {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

/* CodeMirror Customization */
.code-editor-container {
    border-radius: 4px;
    overflow: hidden;
    background: #272822; /* Monokai background color */
}

.CodeMirror {
    height: auto !important;
    min-height: 200px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
    background-color: #272822 !important; /* Force Monokai background */
    border-radius: 4px;
    transition: opacity 0.3s ease;
}

.CodeMirror-lines {
    padding: 12px;
}

.CodeMirror-gutters {
    border-right: 1px solid #444;
    background-color: #272822 !important; /* Match Monokai background */
}

.CodeMirror-focused {
    border: 1px solid #4CAF50;
}

.CodeMirror-scroll {
    background-color: #272822; /* Ensure scrollable area matches */
    min-height: 200px;
}

.CodeMirror-sizer {
    background-color: #272822; /* Ensure content area matches */
    min-height: 200px !important;
}

/* Ensure proper stacking with drop zone */
.CodeMirror-wrap {
    position: relative;
    z-index: 20;
}

/* Image drop zone specific styles */
.image-drop-zone {
    min-height: 150px;
    display: flex;
    flex-direction: column;
}


.image-drop-zone.has-images .drop-zone-overlay {
    opacity: 0;
    pointer-events: none;
}

.image-drop-zone.has-images:hover .drop-zone-overlay {
    opacity: 0.95;
    pointer-events: auto;
}

/* Make overlays more visible on hover */
.drop-zone-overlay:hover {
    background: var(--drop-zone-overlay-hover);
}

.drop-zone-overlay:hover .drop-zone-text {
    color: #333;
}

.error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-group.error input,
.form-group.error textarea,
.form-group.error .drop-zone {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

.form-group.error .error-message {
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 4px;
}

.help-text {
    font-size: 0.775em;
    opacity: 80%;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.github-login-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--login-bg-color);
    padding: 8px;
    border-radius: 6px;
}

.github-login {
    background-color: #24292e;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.github-login:hover {
    background-color: #1a1f23;
}

.login-text {
    font-size: 14px;
    font-weight: 500;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--login-bg-color);
    border: 1px solid var(--border-color);
    padding: 8px;
    color: var(--text-color);
    border-radius: 6px;
}

.user-info.hidden {
    display: none;
}

.user-avatar-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.dropdown-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s;
}

.dropdown-arrow.rotated {
    transform: rotate(180deg);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--login-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 4px;
    z-index: 100;
}

.dropdown-item:hover {
    background-color: #e5e5e5;
}

.form-actions {
    margin-top: 2rem;
}

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

.secondary-button {
    padding: 12px 24px;
    background: #f6f8fa;
    color: #24292e;
    border: 1px solid rgba(27, 31, 35, 0.15);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.secondary-button:hover {
    background-color: #e1e4e8;
}

.secondary-button:active {
    background-color: #d1d5da;
}

.submit-wrapper {
    position: relative;
    display: inline-block;
}

#submitBtn {
    padding: 12px 24px;
    background: #0366d6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

#submitBtn:hover {
    background: #0256b9;
}

#submitBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.spinner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
}

.spinner.hidden {
    display: none;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

