/* ============================================
   LAYOUT - Search, Grid, Cards
   ============================================ */

/* ========== SEARCH & FILTER ========== */
.search-container {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 72px;
    z-index: 90;
}

.search-box {
    position: relative;
    max-width: 400px;
    margin-bottom: 1rem;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

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

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
}

.filter-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-pill {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.filter-divider {
    color: var(--gray-300);
    margin: 0 0.25rem;
}

.filter-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 600;
    text-transform: uppercase;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

/* ========== SYMBOL GRID ========== */
.symbol-grid {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* ========== CATEGORY HEADER ========== */
.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, var(--gray-200), transparent);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.category-header span:first-child {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.category-count {
    background: var(--gray-300);
    color: var(--gray-700);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ========== CATEGORY GRID ========== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.category-grid .symbol-card {
    height: 100%;
    min-height: 200px;
}

/* ========== SYMBOL CARD ========== */
.symbol-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.symbol-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.symbol-card svg {
    width: 64px;
    height: 64px;
    margin-bottom: 0.75rem;
}

.symbol-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

/* ========== SYMBOL ACTIONS ========== */
.symbol-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.3rem;
    margin-top: auto;
    padding-top: 0.75rem;
    width: 100%;
    opacity: 0;
    transition: opacity 0.2s;
}

.symbol-card:hover .symbol-actions {
    opacity: 1;
}

.btn-action {
    padding: 0.35rem 0.4rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.65rem;
    transition: all 0.15s;
    white-space: nowrap;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-action:hover {
    background: var(--gray-100);
}

.btn-copy:hover { background: #dcfce7; border-color: #22c55e; }
.btn-svg:hover { background: #dbeafe; border-color: #3b82f6; }
.btn-dxf:hover { background: #fef3c7; border-color: #f59e0b; }
.btn-legend:hover { background: #fce7f3; border-color: #ec4899; }
.btn-legend.active { background: #fce7f3; border-color: #ec4899; }

/* ========== CHECKBOX ========== */
.symbol-checkbox {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 22px;
    height: 22px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s;
    opacity: 0;
}

.symbol-card:hover .symbol-checkbox {
    opacity: 1;
}

.symbol-checkbox.checked {
    opacity: 1;
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
    font-size: 1rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }

    .search-container {
        padding: 1rem;
        top: auto;
        position: static;
    }

    .main-content {
        padding: 1rem;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .symbol-actions {
        opacity: 1;
    }
}

.hidden {
    display: none !important;
}
