/* CSS Design System for Maddison Smart Tech Assistant */

:root {
    /* Color Palette */
    --brand-primary: #d32f2f; /* Maddison Red */
    --brand-primary-hover: #b71c1c;
    --brand-primary-light: #ffebee;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    
    /* Layout & System Styles */
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Typography */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Global Widget Box Styling */
body {
    margin: 0;
    padding: 0;
    background-color: transparent;
    font-family: var(--font-body);
    color: var(--slate-700);
    -webkit-font-smoothing: antialiased;
}

.maddison-finder-container {
    max-width: 950px;
    margin: 20px auto;
    background-color: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 30px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Assistant Nav Tabs Bar */
.assistant-nav-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--slate-100);
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.tab-trigger {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--slate-600);
    padding: 12px 20px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-trigger:hover {
    color: var(--brand-primary);
    background-color: var(--slate-50);
    border-radius: 8px 8px 0 0;
}

.tab-trigger.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
    font-weight: 700;
}

/* Tab contents and panels */
.tab-content {
    animation: fadeIn 0.4s ease-out;
}

.finder-panel {
    animation: fadeIn 0.3s ease-out;
}

.hidden {
    display: none !important;
}

/* Header Area */
.finder-header {
    text-align: center;
    margin-bottom: 30px;
}

.badge-new {
    display: inline-block;
    background-color: var(--brand-primary-light);
    color: var(--brand-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 12px;
    font-family: var(--font-heading);
}

.finder-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--slate-900);
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.finder-subtitle {
    font-size: 15px;
    line-height: 1.5;
    color: var(--slate-600);
    max-width: 680px;
    margin: 0 auto;
}

/* Wizard Steps Bar */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto 35px auto;
    position: relative;
    padding: 0 10px;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 40px;
    right: 40px;
    height: 3px;
    background-color: var(--slate-100);
    z-index: 1;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    cursor: pointer;
    flex: 1;
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 3px solid var(--border-color);
    color: var(--slate-600);
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-heading);
}

.step-label {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--slate-600);
    transition: all 0.3s ease;
}

/* Active Step Styling */
.step-indicator.active .step-num {
    border-color: var(--brand-primary);
    background-color: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(211, 47, 47, 0.3);
}

.step-indicator.active .step-label {
    color: var(--brand-primary);
    font-weight: 700;
}

/* Completed Step Styling */
.step-indicator.completed .step-num {
    border-color: var(--brand-primary);
    background-color: var(--bg-card);
    color: var(--brand-primary);
}

.section-instruction {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0 0 4px 0;
    text-align: center;
}

.section-hint {
    font-size: 14px;
    color: var(--slate-600);
    margin: 0 0 25px 0;
    text-align: center;
}

/* Back navigation */
.panel-nav {
    margin-bottom: 20px;
}

.btn-back {
    background: transparent;
    border: none;
    color: var(--slate-600);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.btn-back:hover {
    color: var(--brand-primary);
    background-color: var(--slate-50);
}

/* Summary Badge */
.selected-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    font-size: 14px;
    font-weight: 500;
}

.active-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--slate-50);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--slate-900);
}

/* Sockets Selection Grid */
.sockets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.socket-card {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    user-select: none;
}

.socket-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.socket-card.selected {
    border-color: var(--brand-primary);
    background-color: #fff8f8;
    box-shadow: 0 0 0 1px var(--brand-primary);
}

.socket-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background-color: var(--slate-50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.socket-card.selected .socket-icon-box {
    background-color: var(--brand-primary-light);
}

.socket-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-800);
}

.socket-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--slate-600);
    text-transform: uppercase;
    margin-top: 4px;
    background-color: var(--slate-100);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.socket-card.selected .socket-tag {
    background-color: #ffcdd2;
    color: #b71c1c;
}

/* Results & Recommendations Panel */
.results-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
    margin-top: 20px;
}

/* Product Card */
.recommendation-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    position: relative;
}

.rec-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: #10b981;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.product-img-box {
    width: 140px;
    height: 140px;
    background-color: var(--slate-50);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.product-img-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-details {
    flex-grow: 1;
}

.product-category {
    font-size: 11px;
    font-weight: 600;
    color: var(--slate-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.product-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.product-sku {
    font-size: 11px;
    color: var(--slate-600);
    margin-bottom: 8px;
}

.rating-box {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #f59e0b;
    margin-bottom: 12px;
}

.reviews-count {
    color: var(--slate-600);
    font-size: 11px;
}

.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #10b981;
    font-weight: 600;
    margin-bottom: 12px;
}

.stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    display: inline-block;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 20px;
}

.current-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--slate-900);
    font-family: var(--font-heading);
}

.original-price {
    font-size: 15px;
    color: var(--slate-600);
    text-decoration: line-through;
}

/* Interactive Add to Cart Inside Widget */
.rec-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-buy-now {
    background-color: var(--brand-primary);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-heading);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.2);
}

.btn-buy-now:hover {
    background-color: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(211, 47, 47, 0.3);
}

/* Expert Panel */
.expert-box {
    background-color: var(--slate-50);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.expert-avatar-grid {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.expert-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--brand-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.expert-avatar-grid h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--slate-900);
}

.expert-avatar-grid p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--slate-600);
}

.expert-ctas {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-expert-call {
    background-color: var(--slate-900);
    color: white;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-expert-call:hover {
    background-color: var(--slate-800);
}

.btn-expert-email {
    background-color: transparent;
    color: var(--slate-900);
    border: 1px solid var(--border-color);
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-expert-email:hover {
    background-color: var(--slate-100);
}

/* Reset button container */
.finder-reset-container {
    text-align: center;
    margin-top: 30px;
}

.btn-reset {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--slate-600);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset:hover {
    background-color: var(--slate-50);
    color: var(--brand-primary);
    border-color: #cbd5e1;
}

/* ==================== TAB 2 & 3 COMPONENTS ==================== */
.panel-subtitle {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0 0 16px 0;
    border-bottom: 1px dashed var(--slate-200);
    padding-bottom: 8px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--slate-800);
    margin-bottom: 8px;
}

.select-field {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--slate-800);
    background-color: var(--slate-50);
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.select-field:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.slider-field {
    width: 100%;
    margin-right: 15px;
    height: 6px;
    border-radius: 5px;
    background: var(--slate-100);
    outline: none;
    cursor: pointer;
    accent-color: var(--brand-primary);
}

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

.range-value {
    min-width: 60px;
    font-size: 15px;
    color: var(--slate-900);
}

/* Wire Gauge grid */
.wire-calculator-grid, 
.resistor-calculator-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 30px;
    margin-bottom: 35px;
}

.wire-inputs-box, 
.wire-results-box,
.resistor-visual-box,
.resistor-selectors-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.wire-results-box {
    background-color: var(--slate-50);
}

/* Large Gauge Result Display */
.gauge-display-badge {
    text-align: center;
    background-color: var(--bg-card);
    border: 2px solid var(--brand-primary);
    border-radius: 12px;
    padding: 24px 15px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.gauge-prefix {
    font-size: 10px;
    font-weight: 700;
    color: var(--brand-primary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.gauge-value-big {
    font-family: var(--font-heading);
    font-size: 38px;
    font-weight: 800;
    color: var(--slate-900);
    margin: 8px 0;
}

.gauge-sub {
    font-size: 12px;
    color: var(--slate-600);
}

.wire-specs-sheet {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--slate-200);
    padding-bottom: 8px;
    font-size: 14px;
}

.spec-row span {
    color: var(--slate-600);
}

.spec-row strong {
    color: var(--slate-900);
}

.text-red {
    color: var(--brand-primary) !important;
}

/* AWG Table Styles */
.static-chart-container {
    background-color: var(--slate-50);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.chart-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0 0 16px 0;
    text-align: center;
}

.table-responsive {
    overflow-x: auto;
}

.awg-reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background-color: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.awg-reference-table th {
    background-color: var(--slate-800);
    color: white;
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 12px;
    text-align: left;
}

.awg-reference-table td {
    padding: 12px;
    border-bottom: 1px solid var(--slate-100);
    color: var(--slate-700);
}

.awg-reference-table tr:hover {
    background-color: var(--slate-50);
}

/* ==================== RESISTOR VISUAL DRAWING ==================== */
.resistor-visual-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--slate-50);
}

.resistor-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100px;
    margin: 20px 0;
}

.resistor-wire {
    width: 70px;
    height: 5px;
    background-color: #cbd5e1;
    border-radius: 2px;
}

.resistor-body {
    width: 170px;
    height: 48px;
    background-color: #ffd8a8; /* Light tan capsule */
    border-radius: 24px;
    position: relative;
    border: 2px solid #e8590c;
    box-shadow: inset 0 5px 15px rgba(255,255,255,0.4), inset 0 -5px 15px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    padding: 0 25px;
    box-sizing: border-box;
    align-items: center;
}

.resistor-band {
    width: 10px;
    height: 100%;
    position: absolute;
    top: 0;
    box-shadow: 1px 0 3px rgba(0,0,0,0.1);
}

/* Position color bands precisely on the body */
#band1 { left: 35px; }
#band2 { left: 60px; }
#band3 { left: 85px; }
#band4 { right: 35px; }

.resistor-output-value {
    text-align: center;
    margin-top: 15px;
}

.resistor-ohms-label {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: var(--slate-900);
}

.resistor-tolerance-label {
    font-size: 13px;
    color: var(--slate-600);
    margin-top: 4px;
    font-weight: 600;
}

.resistor-stock-info {
    background-color: var(--slate-50);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-top: 20px;
}

/* Footer / trust items in widget */
.finder-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 35px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-color);
    gap: 15px;
}

.footer-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--slate-600);
    flex: 1;
}

.f-badge-icon {
    font-size: 20px;
}

.f-badge-text strong {
    color: var(--slate-900);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Rules */
@media (max-width: 768px) {
    .maddison-finder-container {
        padding: 20px 15px;
        margin: 10px auto;
        border-radius: 12px;
    }

    .finder-title {
        font-size: 22px;
    }

    .finder-subtitle {
        font-size: 13px;
    }

    .assistant-nav-tabs {
        margin-bottom: 20px;
    }

    .tab-trigger {
        padding: 10px 12px;
        font-size: 13px;
    }

    .wizard-steps {
        margin-bottom: 25px;
    }

    .wizard-steps::before {
        top: 14px;
        left: 20px;
        right: 20px;
    }

    .step-num {
        width: 28px;
        height: 28px;
        font-size: 12px;
        border-width: 2px;
    }

    .step-label {
        font-size: 10px;
        margin-top: 6px;
    }

    .sockets-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .socket-card {
        padding: 10px 4px;
        border-radius: 8px;
    }

    .socket-icon-box {
        width: 38px;
        height: 38px;
        font-size: 18px;
        margin-bottom: 6px;
        border-radius: 6px;
    }

    .socket-name {
        font-size: 11px;
    }

    .socket-tag {
        font-size: 8px;
        padding: 1px 4px;
    }

    .results-layout,
    .wire-calculator-grid,
    .resistor-calculator-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .product-img-box {
        width: 100%;
        max-width: 160px;
        height: 140px;
    }

    .rating-box {
        justify-content: center;
    }

    .price-row {
        justify-content: center;
    }

    .finder-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .sockets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== TAB 4: CROSS-REFERENCE DESIGN STYLES ==================== */
.xref-container-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 30px;
    margin-bottom: 35px;
}

.xref-search-box, 
.xref-results-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
}

.xref-results-box {
    background-color: var(--slate-50);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 250px;
}

.tag-chip:hover {
    background-color: var(--brand-primary-light) !important;
    color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}

.xref-result-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.3s ease-out;
}

.xref-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--slate-100);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.xref-part-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background-color: var(--slate-100);
    color: var(--slate-700);
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.xref-part-type.phono {
    background-color: #e0f2fe;
    color: #0369a1;
}

.xref-part-type.semis {
    background-color: #fef3c7;
    color: #b45309;
}

.xref-equiv-box {
    text-align: center;
    padding: 15px;
    background-color: var(--slate-50);
    border-radius: 8px;
    border: 1px dashed var(--brand-primary);
    margin: 15px 0;
}

.xref-equiv-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--slate-600);
    text-transform: uppercase;
}

.xref-equiv-value {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    color: var(--brand-primary);
    margin-top: 4px;
}

.xref-specs-list {
    margin-bottom: 15px;
}

.xref-spec-item {
    font-size: 13px;
    border-bottom: 1px solid var(--slate-100);
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
}

.xref-spec-item span {
    color: var(--slate-600);
}

.xref-spec-item strong {
    color: var(--slate-900);
}

@media (max-width: 768px) {
    .xref-container-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ==================== ADDITIONAL PREMIUM FEATURES ==================== */

/* Resistor Band Toggle */
.resistor-mode-toggle {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    width: 100%;
}

.btn-toggle-band {
    background-color: var(--slate-100);
    border: 1px solid var(--slate-200);
    color: var(--slate-700);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-heading);
}

.btn-toggle-band:hover {
    background-color: var(--slate-200);
}

.btn-toggle-band.active {
    background-color: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
    box-shadow: 0 4px 8px rgba(211, 47, 47, 0.2);
}

/* AWG Visualizer */
.wire-scale-visualizer {
    background-color: var(--bg-card);
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.visualizer-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--slate-600);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.wire-crosssection-container {
    width: 100%;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: var(--slate-50);
    border-radius: 6px;
    border: 1px solid var(--slate-100);
    overflow: hidden;
}

.wire-insulation-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #3b82f6; /* Default Blue Insulation */
    border: 2px solid #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.wire-core-preview {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #ea580c; /* Copper Orange */
    border: 1px solid #c2410c;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.4);
}

.wire-reference-gauge {
    position: absolute;
    bottom: 5px;
    left: 10px;
    right: 10px;
    height: 15px;
    border-top: 1px solid var(--slate-300);
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: var(--slate-500);
}

.wire-reference-gauge::before {
    content: '0mm';
}

.wire-reference-gauge::after {
    content: '5mm';
}

.wire-comparison-badge {
    margin-top: 10px;
    background-color: var(--brand-primary-light);
    color: var(--brand-primary);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-align: center;
    transition: all 0.2s ease;
}

/* Dynamic CSS Component Packages */
.xref-pinout-box {
    margin: 15px 0;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
}

.pinout-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--slate-600);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.package-render {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0 35px 0;
    height: 60px;
    position: relative;
}

/* TO-92 CSS Drawing */
.package-to92 {
    width: 45px;
    height: 40px;
    background: #1e293b;
    border-radius: 20px 20px 4px 4px;
    position: relative;
    border-bottom: 6px solid #0f172a;
}

.package-to92::before {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 8px;
    width: 3px;
    height: 30px;
    background: #94a3b8;
    box-shadow: 11px 0 0 #94a3b8, 22px 0 0 #94a3b8;
}

/* TO-220 CSS Drawing */
.package-to220 {
    width: 50px;
    height: 50px;
    background: #1e293b;
    border-radius: 4px;
    position: relative;
}

.package-to220::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 8px;
    width: 34px;
    height: 20px;
    background: #94a3b8;
    border-radius: 4px 4px 0 0;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2);
}

.package-to220::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 10px;
    width: 3px;
    height: 30px;
    background: #94a3b8;
    box-shadow: 12px 0 0 #94a3b8, 24px 0 0 #94a3b8;
}

/* DIP-8 CSS Drawing */
.package-dip8 {
    width: 70px;
    height: 40px;
    background: #1e293b;
    border-radius: 6px;
    position: relative;
    border: 2px solid #0f172a;
}

.package-dip8::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15px;
    width: 6px;
    height: 8px;
    background: #0f172a;
    border-radius: 0 4px 4px 0;
}

.package-dip8::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 8px;
    width: 3px;
    height: 12px;
    background: #94a3b8;
    box-shadow: 15px 0 0 #94a3b8, 30px 0 0 #94a3b8, 45px 0 0 #94a3b8,
                0 50px 0 #94a3b8, 15px 50px 0 #94a3b8, 30px 50px 0 #94a3b8, 45px 50px 0 #94a3b8;
}

/* DIP-14 CSS Drawing */
.package-dip14 {
    width: 110px;
    height: 40px;
    background: #1e293b;
    border-radius: 6px;
    position: relative;
    border: 2px solid #0f172a;
}

.package-dip14::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15px;
    width: 6px;
    height: 8px;
    background: #0f172a;
    border-radius: 0 4px 4px 0;
}

.package-dip14::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 8px;
    width: 3px;
    height: 12px;
    background: #94a3b8;
    box-shadow: 14px 0 0 #94a3b8, 28px 0 0 #94a3b8, 42px 0 0 #94a3b8, 56px 0 0 #94a3b8, 70px 0 0 #94a3b8, 84px 0 0 #94a3b8,
                0 50px 0 #94a3b8, 14px 50px 0 #94a3b8, 28px 50px 0 #94a3b8, 42px 50px 0 #94a3b8, 56px 50px 0 #94a3b8, 70px 50px 0 #94a3b8, 84px 50px 0 #94a3b8;
}

/* DIP-16 CSS Drawing */
.package-dip16 {
    width: 125px;
    height: 40px;
    background: #1e293b;
    border-radius: 6px;
    position: relative;
    border: 2px solid #0f172a;
}

.package-dip16::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15px;
    width: 6px;
    height: 8px;
    background: #0f172a;
    border-radius: 0 4px 4px 0;
}

.package-dip16::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 8px;
    width: 3px;
    height: 12px;
    background: #94a3b8;
    box-shadow: 14px 0 0 #94a3b8, 28px 0 0 #94a3b8, 42px 0 0 #94a3b8, 56px 0 0 #94a3b8, 70px 0 0 #94a3b8, 84px 0 0 #94a3b8, 98px 0 0 #94a3b8,
                0 50px 0 #94a3b8, 14px 50px 0 #94a3b8, 28px 50px 0 #94a3b8, 42px 50px 0 #94a3b8, 56px 50px 0 #94a3b8, 70px 50px 0 #94a3b8, 84px 50px 0 #94a3b8, 98px 50px 0 #94a3b8;
}

.pinout-labels-container {
    width: 100%;
    margin-top: 10px;
    font-size: 11px;
    color: var(--slate-700);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pin-label-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed var(--slate-200);
    padding: 3px 0;
}

.pin-label-row span {
    font-weight: bold;
    color: var(--brand-primary);
}

/* Category Filter Button Styles */
.xref-category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--slate-100);
    padding-bottom: 12px;
}

.xref-filter-btn {
    background: var(--slate-100);
    border: 1px solid var(--slate-200);
    color: var(--slate-700);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-heading);
}

.xref-filter-btn:hover {
    background: var(--slate-200);
    border-color: var(--slate-300);
}

.xref-filter-btn.active {
    background: var(--slate-900);
    color: white;
    border-color: var(--slate-900);
}

/* ==================== GLOBAL SMART SEARCH ==================== */
.maddison-smart-search-wrapper {
    position: relative;
    margin-bottom: 25px;
    z-index: 100;
}

.smart-search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--slate-50);
    border: 2px solid var(--slate-200);
    border-radius: 12px;
    padding: 2px 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.smart-search-input-container:focus-within {
    border-color: var(--brand-primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.15);
}

.smart-search-icon {
    font-size: 20px;
    margin-left: 10px;
    margin-right: 10px;
    color: var(--slate-400);
}

#global-smart-search {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 0;
    font-size: 16px;
    font-family: var(--font-body);
    color: var(--slate-900);
    outline: none;
}

#global-smart-search::placeholder {
    color: var(--slate-400);
    font-weight: 500;
}

.clear-search-btn {
    background: var(--slate-200);
    border: none;
    color: var(--slate-600);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s;
    margin-right: 8px;
}

.clear-search-btn:hover {
    background: var(--slate-300);
    color: var(--slate-900);
}

.search-suggestions-box {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-height: 380px;
    overflow-y: auto;
    z-index: 1000;
    animation: slideDown 0.2s ease-out;
}

.suggestion-group {
    padding: 8px 0;
}

.suggestion-group-title {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--slate-400);
    padding: 8px 16px 4px 16px;
    border-bottom: 1px solid var(--slate-50);
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background-color: var(--slate-50);
}

.suggestion-item-icon {
    font-size: 18px;
    width: 28px;
    height: 28px;
    background: var(--slate-100);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.suggestion-item-details {
    display: flex;
    flex-direction: column;
}

.suggestion-item-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--slate-800);
}

.suggestion-item-subtitle {
    font-size: 11px;
    color: var(--slate-500);
    margin-top: 1px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== SEARCH SHORTCUTS ==================== */
.maddison-suggested-searches-box {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--slate-200);
}

.maddison-suggested-searches-box h4 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0 0 6px 0;
}

.maddison-suggested-searches-box p {
    font-size: 13px;
    color: var(--slate-600);
    margin: 0 0 16px 0;
    line-height: 1.45;
}

.search-links-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 576px) {
    .search-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.btn-search-shortcut {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--slate-800);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.btn-search-shortcut span {
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-search-shortcut:hover {
    background-color: var(--brand-primary-light);
    border-color: var(--brand-primary);
    color: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ==================== ACTIVE CONVERTER ALERTS & ADVICE BADGES ==================== */
.maddison-active-alert {
    display: flex;
    gap: 15px;
    background: #fff5f5;
    border-left: 4px solid var(--brand-primary);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.4s ease-out;
    border: 1px solid rgba(211, 47, 47, 0.1);
    border-left-width: 4px;
}

.maddison-active-alert.warning-orange {
    background: #fffbeb;
    border-left-color: #d97706; /* Amber/Orange */
    border-color: rgba(217, 119, 6, 0.1);
    border-left-width: 4px;
}

.maddison-active-alert.info-blue {
    background: #f0f9ff;
    border-left-color: #0284c7; /* Blue */
    border-color: rgba(2, 132, 199, 0.1);
    border-left-width: 4px;
}

.maddison-active-alert.success-green {
    background: #f0fdf4;
    border-left-color: #16a34a; /* Green */
    border-color: rgba(22, 163, 74, 0.1);
    border-left-width: 4px;
}

.maddison-active-alert-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maddison-active-alert-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.maddison-active-alert-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.maddison-active-alert-desc {
    font-size: 13.5px;
    line-height: 1.5;
    color: #475569;
    margin: 0;
}

.advice-badge-container {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.advice-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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




