/* ===== Symbols Page - Dark Mode Styles ===== */

/* Force Dark Mode for Sidebar */
#categoryList {
    background: #12151a !important;
    padding: 0.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s ease;
}

#categoryList:hover,
#categoryList:focus-within {
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* Webkit browsers (Chrome, Edge, Safari) */
#categoryList::-webkit-scrollbar {
    width: 8px;
}

#categoryList::-webkit-scrollbar-track {
    background: transparent;
}

#categoryList::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 10px;
    transition: background 0.3s ease, opacity 0.3s ease;
}

/* Show scrollbar on hover or scroll */
#categoryList:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

#categoryList::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

#categoryList::-webkit-scrollbar-thumb:active {
    background: rgba(255, 255, 255, 0.4);
}

#categoryList .list-group-item {
    background: transparent !important;
    border: none !important;
    color: #e6edf3 !important;
    padding: 0.5rem 0.75rem;
    margin-bottom: 2px;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

#categoryList .list-group-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

#categoryList .list-group-item.active {
    background: var(--bs-primary) !important;
    color: white !important;
}

#categoryList .badge {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #8b949e !important;
}

#categoryList .list-group-item.active .badge {
    background: rgba(255, 255, 255, 0.25) !important;
    color: white !important;
}

/* Category Grouping Styles */
.category-group {
    margin-bottom: 4px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.category-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.category-chevron {
    font-size: 10px;
    color: #8b949e;
    transition: transform 0.2s ease;
}

.category-name {
    flex: 1;
    font-weight: 600;
    font-size: 12px;
    color: #7d8590;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-header .badge {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #7d8590 !important;
    font-size: 11px;
    padding: 2px 6px;
}

.category-libraries {
    margin-left: 8px;
    margin-top: 2px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.category-libraries .list-group-item {
    padding-left: 28px;
    font-size: 13px;
}

.category-libraries .list-group-item.sub-item {
    border-left: 2px solid transparent;
    transition: border-left-color 0.2s ease;
}

.category-libraries .list-group-item.sub-item:hover {
    border-left-color: rgba(255, 255, 255, 0.1);
}

.category-libraries .list-group-item.sub-item.active {
    border-left-color: var(--bs-primary);
}

/* Main Content Area */
.sym-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #0d1117 !important;
}

/* Toolbar */
.sym-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #161b22 !important;
    border-bottom: 1px solid #30363d;
    flex-shrink: 0;
}

/* View Toggle Buttons */
.view-toggle {
    display: flex;
    gap: 4px;
    background: #21262d;
    border-radius: 6px;
    padding: 2px;
}

.view-toggle-btn {
    padding: 6px 10px;
    background: transparent;
    border: none;
    color: #8b949e;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.view-toggle-btn:hover {
    color: #e6edf3;
    background: rgba(255, 255, 255, 0.05);
}

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

.sym-toolbar .search-box {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.sym-toolbar .search-box input {
    width: 100%;
    background: #21262d !important;
    border: 1px solid #30363d !important;
    color: #e6edf3 !important;
    border-radius: 6px;
    padding: 8px 12px 8px 36px;
    font-size: 14px;
}

.sym-toolbar .search-box input::placeholder {
    color: #8b949e;
}

.sym-toolbar .search-box .bi {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #8b949e;
}

.sym-toolbar select {
    background: #21262d !important;
    border: 1px solid #30363d !important;
    color: #e6edf3 !important;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
}

.sym-toolbar select option {
    background: #161b22;
    color: #e6edf3;
}

/* Smart Scrollbar for Main Content */
.sym-table-container,
.sym-grid-container {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s ease;
}

.sym-table-container:hover,
.sym-grid-container:hover {
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sym-table-container::-webkit-scrollbar,
.sym-grid-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.sym-table-container::-webkit-scrollbar-track,
.sym-grid-container::-webkit-scrollbar-track {
    background: transparent;
}

.sym-table-container::-webkit-scrollbar-thumb,
.sym-grid-container::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.sym-table-container:hover::-webkit-scrollbar-thumb,
.sym-grid-container:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

.sym-table-container::-webkit-scrollbar-thumb:hover,
.sym-grid-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sym-table-container::-webkit-scrollbar-thumb:active,
.sym-grid-container::-webkit-scrollbar-thumb:active {
    background: rgba(255, 255, 255, 0.4);
}

/* Footprints Table */
.sym-table-container {
    flex: 1;
    overflow: auto;
    padding: 16px;
}

.sym-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sym-table th {
    background: #161b22 !important;
    color: #8b949e !important;
    padding: 12px 16px;
    text-align: left;
    font-weight: 500;
    border-bottom: 1px solid #30363d;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sym-table td {
    padding: 12px 16px;
    color: #e6edf3 !important;
    border-bottom: 1px solid #21262d;
}

.sym-table tr:hover td {
    background: #161b22 !important;
}

.sym-table .sym-name {
    font-weight: 500;
    color: #58a6ff !important;
}

.sym-table .sym-library {
    color: #8b949e !important;
    font-size: 12px;
}

.sym-table .sym-attr {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.sym-table .sym-attr.smd {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.sym-table .sym-attr.through_hole {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

/* Stats Badge */
.stats-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #21262d;
    border-radius: 6px;
    padding: 6px 12px;
    color: #8b949e;
    font-size: 13px;
}

.stats-badge strong {
    color: #e6edf3;
}

/* Empty State */
.sym-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #8b949e;
}

.sym-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Loading State */
.sym-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #8b949e;
}

/* Grid View */
.sym-grid-container {
    flex: 1;
    overflow: auto;
    padding: 16px;
}

.sym-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.sym-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sym-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: var(--bs-primary);
}

.sym-card-image {
    width: 100%;
    aspect-ratio: 1;
    background: #0d1117;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #30363d;
    position: relative;
    overflow: hidden;
}

.sym-card-image svg,
.sym-card-image img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.sym-card-placeholder {
    color: #30363d;
    font-size: 48px;
}

.sym-card-body {
    padding: 12px;
}

.sym-card-name {
    font-weight: 500;
    color: #58a6ff;
    font-size: 13px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sym-card-library {
    color: #8b949e;
    font-size: 11px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sym-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    font-size: 11px;
}

.sym-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.sym-card-badge.smd {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.sym-card-badge.through_hole {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.sym-card-info {
    color: #8b949e;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sym-card-info i {
    font-size: 10px;
}

/* Side Panel Styles */
.sym-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sym-detail-overlay.show {
    opacity: 1;
    visibility: visible;
}

.sym-detail-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 500px;
    height: 100vh;
    background: #161b22;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 1050;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sym-detail-panel.show {
    right: 0;
}

.sym-detail-header {
    padding: 20px;
    border-bottom: 1px solid #30363d;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0d1117;
}

.sym-detail-header h5 {
    margin: 0;
    color: #e6edf3;
    font-size: 18px;
    font-weight: 600;
}

.sym-detail-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.sym-detail-header .btn-close:hover {
    opacity: 1;
}

.sym-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    /* Smart scrollbar */
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s ease;
}

.sym-detail-body:hover {
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sym-detail-body::-webkit-scrollbar {
    width: 8px;
}

.sym-detail-body::-webkit-scrollbar-track {
    background: transparent;
}

.sym-detail-body::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.sym-detail-body:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

.sym-detail-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sym-detail-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #8b949e;
}

.sym-detail-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sym-detail-preview {
    background: #0d1117;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #30363d;
}

.sym-detail-preview canvas {
    max-width: 100%;
    height: auto;
}

.sym-detail-section {
    margin-bottom: 24px;
}

.sym-detail-section h6 {
    color: #7d8590;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #30363d;
}

.sym-detail-table {
    width: 100%;
    font-size: 13px;
}

.sym-detail-table th {
    color: #7d8590;
    font-weight: 500;
    padding: 8px 12px 8px 0;
    width: 100px;
    text-align: left;
    vertical-align: top;
}

.sym-detail-table td {
    color: #e6edf3;
    padding: 8px 0;
}

.sym-detail-pads-container {
    max-height: 300px;
    overflow-y: auto;
    border-radius: 6px;
    border: 1px solid #30363d;
}

.sym-detail-pads-container table {
    margin: 0;
}

.sym-detail-pads-container thead th {
    position: sticky;
    top: 0;
    background: #0d1117;
    padding: 10px 8px;
    font-size: 11px;
    color: #7d8590;
    border-bottom: 1px solid #30363d;
}

.sym-detail-pads-container tbody tr {
    border-bottom: 1px solid #21262d;
}

.sym-detail-pads-container tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.sym-detail-pads-container tbody td {
    padding: 10px 8px;
    font-size: 12px;
}

/* Preview tools (Zoom/Pan) */
.sym-detail-preview {
    position: relative;
    overflow: hidden;
}

.sym-preview-tools {
    position: absolute;
    bottom: 25px;
    right: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(22, 27, 34, 0.8) !important;
    backdrop-filter: blur(4px);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #30363d;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tool-btn {
    background: transparent;
    border: none;
    color: #8b949e;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.tool-btn:hover {
    color: #58a6ff;
    background: rgba(88, 166, 255, 0.1);
}

#zoomDisplay {
    font-size: 12px;
    color: #8b949e;
    min-width: 45px;
    text-align: center;
    border-left: 1px solid #30363d;
    padding-left: 8px;
    font-family: monospace;
}