/**
 * PC Part Compatibility Checker Styles
 * Primary Color: #7d5860
 * No gradients - flat design only
 */

/* Container */
.aipcb-compat-checker {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Tabs */
.aipcb-compat-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
	padding: 30px;
}

.aipcb-compat-tab {
    background: transparent;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aipcb-compat-tab:hover {
    color: #7d5860;
}

.aipcb-compat-tab.active {
    color: #7d5860;
}

.aipcb-compat-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #7d5860;
}

.aipcb-tab-icon {
    font-size: 18px;
}

/* Tab Content */
.aipcb-compat-tab-content {
    display: none;
}

.aipcb-compat-tab-content.active {
    display: block;
}

/* Full Width Cards */
.aipcb-full-width-card {
    margin-bottom: 20px;
}

/* Cards */
.aipcb-compat-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.aipcb-compat-card-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 20px 0;
}

/* Component Selectors */
#aipcb-component-selectors {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.aipcb-component-selector {
    display: grid;
    grid-template-columns: 150px 1fr auto;
    gap: 12px;
    align-items: start;
}

/* Selected Component Card in Full Build Mode */
.aipcb-selected-full-component {
    grid-column: 1 / 3;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.aipcb-selected-full-badge {
    display: inline-block;
    background: #7d5860;
    color: #fff;
    padding: 0px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.aipcb-selected-full-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.aipcb-selected-full-img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    flex-shrink: 0;
}

.aipcb-selected-full-details {
    flex: 1;
}

.aipcb-selected-full-name,
.aipcb-selected-full-param,
.aipcb-selected-full-price {
    margin-bottom: 6px;
    font-size: 13px;
    color: #333;
}

.aipcb-selected-full-label {
    color: #999;
    font-weight: 400;
    margin-right: 4px;
}

.aipcb-selected-full-price {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.aipcb-selected-full-price-value {
    font-size: 20px;
    font-weight: 700;
    color: #7d5860;
    margin-left: 8px;
}

.aipcb-component-type-select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: #333;
    cursor: pointer;
}

.aipcb-component-search-wrapper {
    position: relative;
}

.aipcb-component-search-input {
    width: 100%;
    padding: 10px 12px 10px 50px !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.aipcb-component-search-input::placeholder {
    text-indent: 0;
}

.aipcb-component-search-input::-webkit-input-placeholder {
    text-indent: 0;
}

.aipcb-component-search-input::-moz-placeholder {
    text-indent: 0;
}

.aipcb-component-search-input:-ms-input-placeholder {
    text-indent: 0;
}

.aipcb-component-search-input:focus {
    outline: none;
    border-color: #7d5860;
}

.aipcb-search-icon-left {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    z-index: 1;
    font-size: 16px;
}

.aipcb-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: none;
    margin-top: 0;
}

.aipcb-search-results.active {
    display: block;
}

.aipcb-search-result-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.aipcb-search-result-item:hover {
    background: #f8f8f8;
}

.aipcb-search-result-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.aipcb-search-result-info {
    flex: 1;
}

.aipcb-search-result-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.aipcb-search-result-brand {
    font-size: 12px;
    color: #666;
}

.aipcb-remove-component-btn {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 16px;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.aipcb-remove-component-btn:hover {
    background: #fee;
    border-color: #f44;
    color: #f44;
}

/* Add Component Button */
.aipcb-add-btn {
    width: 100%;
    padding: 12px;
    background: #fff;
    border: 2px dashed #ddd;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.aipcb-add-btn:hover {
    border-color: #7d5860;
    color: #7d5860;
}

.aipcb-add-icon {
    font-size: 18px;
}

/* Check Button */
.aipcb-check-btn {
    width: 100%;
    padding: 14px;
    background: #7d5860;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.aipcb-check-btn:hover {
    background: #6d4850;
}

.aipcb-check-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.aipcb-check-icon {
    font-size: 18px;
}

/* Reset Button */
.aipcb-reset-btn {
    width: 100%;
    padding: 14px;
    background: #fff;
    border: 2px solid #7d5860;
    border-radius: 4px;
    color: #7d5860;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.aipcb-reset-btn:hover {
    background: #7d5860;
    color: #fff;
}

.aipcb-reset-icon {
    font-size: 18px;
}

/* Build Summary */
.aipcb-summary-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

.aipcb-build-summary-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
}

.aipcb-build-summary-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    padding: 16px 0;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
}

.aipcb-build-summary-row:last-child {
    border-bottom: none;
}

.aipcb-build-summary-type {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.aipcb-build-summary-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.aipcb-build-summary-name {
    color: #333;
    font-size: 14px;
    flex: 1;
    text-align: right;
}

.aipcb-build-summary-price {
    color: #333;
    font-weight: 600;
    font-size: 14px;
    min-width: 80px;
    text-align: right;
}

.aipcb-build-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 2px solid #7d5860;
}

.aipcb-summary-total-label {
    font-weight: 700;
    color: #333;
    font-size: 18px;
}

.aipcb-summary-total-price {
    font-weight: 700;
    color: #7d5860;
    font-size: 24px;
}

.aipcb-summary-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.aipcb-summary-item {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aipcb-summary-label {
    font-weight: 600;
    color: #666;
}

.aipcb-summary-value {
    color: #333;
    text-align: right;
}

/* Summary Actions */
.aipcb-summary-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.aipcb-cta-btn {
    width: 100%;
    max-width: 400px;
    height: 66px;
    min-height: 66px;

    padding: 0 !important;
    margin: 5px;

    border: none;
    border-radius: 6px;

    font-family: inherit;
    font-size: 16px;
    font-weight: 600;

    line-height: normal !important;
    text-align: center;
    text-indent: 0;

    display: grid !important;
    place-items: center !important;

    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;

    cursor: pointer;
    transition: all 0.2s ease;
}

/* Prevent pseudo-elements from interfering with centering */
.aipcb-cta-btn::before,
.aipcb-cta-btn::after {
	content: none !important;
    display: none !important;
}

.aipcb-cta-primary {
    background: #fff;
    color: #7d5860;
    border: 2px solid #7d5860;
}

.aipcb-cta-primary:hover {
    background: #f8f8f8;
    border-color: #6d4850;
    color: #6d4850;
}

.aipcb-cta-secondary {
    background: #fff;
    color: #7d5860;
    border: 2px solid #7d5860;
}

.aipcb-cta-secondary:hover {
    background: #f8f8f8;
    border-color: #6d4850;
    color: #6d4850;
}

/* Mobile responsiveness for CTA buttons */
@media (max-width: 600px) {
    .aipcb-cta-btn {
        max-width: 100%;
        height: 58px;
        min-height: 58px;
        padding: 0 !important;
        font-size: 15px;
    }
}

/* Two Parts Form */
.aipcb-two-parts-card {
    width: 100%;
    margin: 0 auto;
}

.aipcb-two-parts-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    margin-bottom: -74px;
    align-items: start;
}

.aipcb-component-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.aipcb-component-input {
    position: relative;
}

.aipcb-input-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 16px;
}

.aipcb-search-wrapper {
    position: relative;
}

.aipcb-component-search {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.aipcb-component-search:focus {
    outline: none;
    border-color: #7d5860;
}

.aipcb-swap-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 32px;
}

.aipcb-swap-icon {
    font-size: 24px;
    color: #999;
}

.aipcb-component-card-wrapper {
    min-height: 100px;
}

/* Component Card - Clean design, no borders */
.aipcb-component-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
}

.aipcb-card-image-wrapper {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    border-radius: 4px;
}

.aipcb-card-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.aipcb-card-no-image {
    color: #999;
    font-size: 12px;
    text-align: center;
}

.aipcb-card-details {
    flex: 1;
}

.aipcb-card-header {
    margin-bottom: 12px;
}

.aipcb-card-type-badge {
    display: inline-block;
    background: #7d5860;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.aipcb-card-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.3;
}

.aipcb-card-params {
    margin-bottom: 12px;
}

.aipcb-param-row {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.aipcb-param-label {
    color: #999;
    font-weight: 400;
}

.aipcb-param-value {
    color: #333;
    font-weight: 500;
}

.aipcb-card-price {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.aipcb-price-label {
    font-size: 11px;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aipcb-price-value {
    font-size: 24px;
    font-weight: 700;
    color: #7d5860;
    margin-left: 8px;
}

/* Quick Checks */
.aipcb-quick-checks {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid #e0e0e0;
}

.aipcb-quick-title {
    font-size: 16px;
    font-weight: 600;
    color: #666;
    margin: 0 0 16px 0;
}

/* Quick Checks - Simple table layout */
.aipcb-preset-buttons {
    width: 100%;
    border-collapse: separate;
    border-spacing: 12px;
    margin: 0;
    table-layout: fixed;
}

.aipcb-preset-buttons td {
    padding: 0;
    vertical-align: top;
    width: 33.333%;
}

.aipcb-preset-btn {
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    justify-content: flex-start;
    box-sizing: border-box;
}

.aipcb-preset-btn:hover {
    background: #7d5860;
    border-color: #7d5860;
    color: #fff;
}

.aipcb-preset-btn:hover .aipcb-preset-icon {
    filter: brightness(0) invert(1);
}

.aipcb-preset-icon {
    font-size: 16px;
    flex-shrink: 0;
    transition: filter 0.2s ease;
}

/* Tablet and below - Stack to prevent overflow */
@media (max-width: 900px) {
    .aipcb-preset-buttons,
    .aipcb-preset-buttons tbody,
    .aipcb-preset-buttons tr {
        display: block;
        width: 100%;
    }
    
    .aipcb-preset-buttons {
        border-spacing: 0;
    }
    
    .aipcb-preset-buttons td {
        display: block;
        width: 100% !important;
        padding: 0;
        margin-bottom: 12px;
    }
    
    .aipcb-preset-buttons tr {
        display: block;
        margin-bottom: 0;
    }
    
    /* Remove extra margin from last item */
    .aipcb-preset-buttons tr:last-child td:last-child {
        margin-bottom: 0;
    }
}

/* Adjust button sizing for smaller screens */
@media (max-width: 600px) {
    .aipcb-preset-btn {
        font-size: 13px;
        padding: 10px 14px;
    }
}

@media (max-width: 400px) {
    .aipcb-preset-btn {
        font-size: 12px;
        padding: 10px 12px;
        gap: 6px;
    }
    
    .aipcb-preset-icon {
        font-size: 14px;
    }
}

.aipcb-preset-btn {
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    justify-content: flex-start;
}

.aipcb-preset-btn:hover {
    border-color: #7d5860;
    color: #7d5860;
}

.aipcb-preset-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Compatibility Results */
.aipcb-compat-results {
    margin-top: 30px;
}

.aipcb-result-summary {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

.aipcb-result-summary.compatible {
    border-color: #4caf50;
    background: #f1f8f4;
}

.aipcb-result-summary.warning {
    border-color: #ff9800;
    background: #fff8f1;
}

.aipcb-result-summary.incompatible {
    border-color: #f44336;
    background: #fef1f1;
}

.aipcb-result-summary-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.aipcb-result-icon {
    font-size: 28px;
}

.aipcb-result-summary-stats {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Individual Check Results */
.aipcb-check-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aipcb-check-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    transition: all 0.2s ease;
}

.aipcb-check-item.compatible {
    border: 1px solid #e0e0e0;
}

.aipcb-check-item.warning {
    border: 1px solid #e0e0e0;
}

.aipcb-check-item.incompatible {
    border: 1px solid #e0e0e0;
}

.aipcb-check-item.unable_to_verify {
    border: 1px solid #e0e0e0;
}

.aipcb-check-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

.aipcb-check-relationship {
    font-weight: 600;
    color: #333;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aipcb-check-status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
}

.aipcb-check-status-badge.compatible {
    background: #4caf50;
    color: #fff;
}

.aipcb-check-status-badge.warning {
    background: #ff9800;
    color: #fff;
}

.aipcb-check-status-badge.incompatible {
    background: #f44336;
    color: #fff;
}

.aipcb-check-status-badge.unable_to_verify {
    background: #9e9e9e;
    color: #fff;
}

.aipcb-check-message {
    color: #666;
    margin-bottom: 12px;
    font-size: 14px;
}

.aipcb-check-details {
    background: #f8f8f8;
    border-radius: 4px;
    padding: 12px;
    display: block;
    margin-top: 12px;
}

.aipcb-check-item.collapsed .aipcb-check-details {
    display: none;
}

.aipcb-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #e0e0e0;
}

.aipcb-detail-row:last-child {
    border-bottom: none;
}

.aipcb-detail-label {
    font-weight: 600;
    color: #666;
    font-size: 13px;
}

.aipcb-detail-value {
    color: #333;
    font-size: 13px;
}

/* Repair Actions */
.aipcb-repair-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.aipcb-repair-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #7d5860;
    border-radius: 4px;
    color: #7d5860;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aipcb-repair-btn:hover {
    background: #7d5860;
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .aipcb-compat-checker {
        padding: 15px;
    }
    
    .aipcb-component-selector {
        grid-template-columns: 1fr;
    }
    
    .aipcb-selected-full-component {
        grid-column: 1;
    }
    
    .aipcb-selected-full-content {
        flex-direction: column;
    }
    
    .aipcb-selected-full-img {
        align-self: center;
    }
    
    .aipcb-build-summary-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .aipcb-build-summary-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .aipcb-build-summary-name,
    .aipcb-build-summary-price {
        text-align: left;
    }
    
    .aipcb-two-parts-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .aipcb-swap-icon-wrapper {
        padding-top: 0;
        padding-bottom: 10px;
    }
    
    .aipcb-swap-icon {
        transform: rotate(90deg);
        text-align: center;
    }
    
    .aipcb-preset-buttons {
        grid-template-columns: 1fr;
    }
    
    .aipcb-check-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Selected Component Display */
.aipcb-selected-component {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 4px;
}

.aipcb-selected-component-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.aipcb-selected-component-info {
    flex: 1;
}

.aipcb-selected-component-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
}

.aipcb-selected-component-brand {
    font-size: 12px;
    color: #666;
}

/* Loading State */
.aipcb-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.aipcb-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #7d5860;
    border-radius: 50%;
    animation: aipcb-spin 1s linear infinite;
}

@keyframes aipcb-spin {
    to {
        transform: rotate(360deg);
    }
}
