/* css/ics.css */

.tool-page-container {
    padding: 2rem 0 6rem;
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-header h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.tool-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.lookup-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.search-panel {
    text-align: center;
}

.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-box input {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--bg-base);
    color: var(--text-main);
    font-size: 1.1rem;
    outline: none;
    font-family: inherit;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.popular-searches {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tag:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Results Panel */
.results-panel {
    animation: fadeIn 0.5s ease;
    padding: 3rem;
}

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

.ic-header-info {
    text-align: center;
    margin-bottom: 3rem;
}

#resultTitle {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.ic-type {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

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

.ic-visual-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

@media (max-width: 800px) {
    .ic-visual-layout {
        grid-template-columns: 1fr;
    }
}

/* IC Graphic */
.ic-graphic-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.ic-graphic {
    position: relative;
    width: 120px;
    min-height: 180px;
    margin: 0 auto;
}

.ic-body {
    position: absolute;
    top: 0; bottom: 0; left: 15px; right: 15px;
    background: #222; /* IC body color */
    border-radius: 4px;
    box-shadow: inset 2px 2px 5px rgba(255,255,255,0.1), 0 10px 20px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.ic-notch {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 10px;
    background: #0f172a; /* matches bg behind IC */
    border-radius: 0 0 10px 10px;
    z-index: 3;
    border-bottom: 1px solid #333;
}

.ic-label {
    color: rgba(255,255,255,0.4);
    font-family: 'Roboto Mono', monospace;
    transform: rotate(-90deg);
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.pins-left, .pins-right {
    position: absolute;
    top: 10px;
    bottom: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1;
}

.pins-left { left: 0; }
.pins-right { right: 0; }

.pin {
    width: 25px;
    height: 10px;
    background: linear-gradient(to bottom, #d4d4d8, #94a3b8);
    position: relative;
}

.pins-left .pin {
    border-radius: 2px 0 0 2px;
}

.pins-right .pin {
    border-radius: 0 2px 2px 0;
}

.pin-number {
    position: absolute;
    top: -2px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pins-left .pin-number { left: -18px; }
.pins-right .pin-number { right: -18px; }

/* Pinout Table */
.pinout-table-container h3 {
    margin-bottom: 1rem;
    color: var(--text-main);
}

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

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

.pinout-table th {
    background: rgba(255,255,255,0.05);
    color: var(--primary);
    font-weight: 600;
}

.pinout-table tr:hover {
    background: rgba(255,255,255,0.02);
}

.pin-num-cell {
    font-family: 'Roboto Mono', monospace;
    color: var(--accent);
    font-weight: bold;
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results svg {
    width: 48px;
    height: 48px;
    color: #ef4444;
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-muted);
}

/* Loading Spinner */
.loading-container {
    text-align: center;
    padding: 4rem 2rem;
    animation: fadeIn 0.3s ease;
}

.loading-container h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Multiple Results */
.multiple-results {
    text-align: center;
    padding: 3rem;
    animation: fadeIn 0.5s ease;
}

.multiple-results h3 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.multiple-results p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.option-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.option-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.opt-part {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary);
}

.opt-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}
