/**
 * Upgrade Advisor Stylesheet
 * 
 * Styles for the PC Upgrade Advisor feature including:
 * - Component input search interface
 * - Use case and goal configuration UI
 * - Budget input controls
 * - Bottleneck analysis display
 * - Recommendation cards with performance deltas
 * - Mobile responsive layouts
 * - Color-coded optimization scores
 * - Amazon cart integration buttons
 * - Loading states and transitions
 * 
 * Design Goals:
 * - Clean, modern interface matching existing plugin style
 * - WCAG 2.1 AA compliant color contrast (4.5:1 minimum)
 * - Responsive design for mobile and tablet
 * - Clear visual hierarchy
 * - Accessible touch targets (44x44px minimum)
 * 
 * @package AI_PC_Builder
 * @subpackage Upgrade_Advisor
 * @since 1.0.0
 */

/* ==========================================================================
   Hide Page Meta (Author, Date, etc.) for Upgrade Advisor Page
   ========================================================================== */

/* Common post meta classes used by themes */
.aipcb-upgrade-advisor-container ~ .entry-meta,
.page .entry-meta,
.page .post-meta,
.page .entry-header .entry-meta,
body.page .entry-meta,
body.page .post-meta,
.ast-single-post .entry-header .ast-blog-meta-container {
    display: none !important;
}

/* Hide "Add a Comment" link if it appears */
.page .post-edit-link,
.page .comment-link {
    display: none !important;
}

/* ==========================================================================
   Container and Section Styles
   ========================================================================== */

.aipcb-upgrade-advisor-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}

/* Platform section appears first */
.aipcb-upgrade-advisor-container .platform-section {
    margin-bottom: 24px;
}

.upgrade-advisor-header {
    display: none; /* Header removed per user request */
}

.upgrade-advisor-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.upgrade-advisor-description {
    font-size: 16px;
    color: #666666;
    max-width: 700px;
    margin: 0 auto;
}

.upgrade-advisor-section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    box-shadow: none;
    transition: none;
    position: relative;
}

.upgrade-advisor-section:hover {
    box-shadow: none;
}

.upgrade-advisor-section::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background-color: #e0e0e0;
    margin: 50px 0;
}

.upgrade-advisor-section:last-child::after {
    display: none;
}

.upgrade-advisor-section h3 {
    margin: 0 0 12px 0;
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
}

.upgrade-advisor-section h4 {
    margin: 20px 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333333;
}

.section-description {
    font-size: 14px;
    color: #666666;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.field-description {
    font-size: 13px;
    color: #888888;
    margin-top: 6px;
    font-style: italic;
}

.required {
    color: #dc3545;
    font-weight: 700;
}

/* ==========================================================================
   Component Input Section
   ========================================================================== */

.component-inputs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.component-row-divider {
    grid-column: 1 / -1; /* Span all columns */
    border: none;
    border-top: 1px solid #ddd;
    margin: 20px 0;
}

/* Desktop: Hide dividers between components in the same row, show only at row ends */
@media screen and (min-width: 769px) {
    .component-row-divider:not(.row-end-divider) {
        display: none;
    }
}

/* Mobile: Show all dividers (default behavior) */

.component-search-group {
    position: relative; /* Contains absolutely positioned dropdown */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.component-search-wrapper {
    position: relative; /* Positioning context for dropdown */
    width: 100%;
}

.component-search-label {
    display: block;
    font-weight: 400;
    font-size: 15px;
    color: #333333;
	margin-bottom: 5px;
}

.component-input-wrapper {
    position: relative;
}

.component-input-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333333;
    font-size: 14px;
}

.component-search-container {
    position: relative;
}

.component-search-input {
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px; /* Space for loading spinner */
    border: 1px solid #cccccc;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.component-search-input:hover {
    border-color: #999999;
}

.component-search-input:focus {
    outline: none;
    border-color: #7d5860;
    box-shadow: 0 0 0 3px rgba(125, 88, 96, 0.1);
}

.component-search-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: #999999;
}

.search-loading {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.component-search-results {
    position: absolute;
    top: 100%; /* Position directly below the input */
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-top: 4px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none; /* Hidden by default */
}

.component-search-results.active {
    display: block;
}

.component-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.component-result-item:last-child {
    border-bottom: none;
}

.component-result-item:hover,
.component-result-item:focus {
    background-color: #f0f7ff;
    outline: none;
}

.component-result-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.component-result-info {
    flex: 1;
    min-width: 0;
}

.component-result-name {
    font-weight: 500;
    color: #1a1a1a;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.component-result-brand {
    font-size: 12px;
    color: #666666;
}

.component-result-price {
    font-weight: 600;
    color: #7d5860;
    font-size: 14px;
    white-space: nowrap;
}

.component-result-params {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-component-card {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #7d5860;
    border-radius: 6px;
    margin-top: 12px;
    background: #f0f7ff;
    gap: 16px;
    transition: all 0.3s ease;
}

.component-selected-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.component-selected-info {
    flex: 1;
    min-width: 0;
}

.component-selected-name {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    font-size: 15px;
}

.component-selected-brand {
    font-size: 13px;
    color: #666666;
    margin-bottom: 6px;
}

.component-selected-specs {
    font-size: 13px;
    color: #666666;
    line-height: 1.4;
}

.component-selected-price {
    font-weight: 700;
    color: #7d5860;
    font-size: 16px;
    margin-top: 8px;
}

.component-selected-params {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
    line-height: 1.4;
}

/* Optimization Score Badge */
.optimization-score-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.optimization-score-badge.score-green,
.optimization-score-badge.score-yellow,
.optimization-score-badge.score-red {
    background-color: #7d5860;
    color: #ffffff;
    border: none;
}

.component-remove-btn {
    padding: 6px 12px;
    background-color: #dc3545;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: 32px;
}

.component-remove-btn:hover {
    background-color: #c82333;
}

/* ==========================================================================
   Use Case Configuration
   ========================================================================== */

.use-case-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.use-case-option {
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
}

.use-case-option:hover {
    border-color: #7d5860;
    background-color: #fceaff;
}

.use-case-option.active {
    border-color: #7d5860;
    background-color: #fceaff;
    font-weight: 600;
}

.goals-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
}

.goal-checkbox-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
}

.goal-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ==========================================================================
   Budget Section
   ========================================================================== */

.budget-input-wrapper {
    max-width: 400px;
}

.budget-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cccccc;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
}

.budget-input:focus {
    outline: none;
    border-color: #7d5860;
    box-shadow: 0 0 0 3px rgba(125, 88, 96, 0.1);
}

.suggest-upgrades-button {
    margin-top: 24px;
    padding: 14px 32px;
    background-color: #7d5860;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: 44px;
}

.suggest-upgrades-button:hover {
    background-color: #7d5860;
}

.suggest-upgrades-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* ==========================================================================
   Results Section - Bottleneck Analysis
   ========================================================================== */

.bottleneck-list {
    margin-bottom: 32px;
}

.bottleneck-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #ffffff;
    margin-bottom: 16px;
    border-radius: 8px;
    box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.2);
}

.bottleneck-card.critical {
    border-left-color: #dc3545;
}

.bottleneck-card.high {
    border-left-color: #ffc107;
}

.bottleneck-card.moderate {
    border-left-color: #17a2b8;
}

.bottleneck-image-wrapper {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
}

.bottleneck-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.bottleneck-info {
    flex: 1;
    min-width: 0;
    text-align: right;
}

.bottleneck-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 8px;
}

.bottleneck-component-type {
    font-size: 14px;
    font-weight: 600;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bottleneck-name {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.bottleneck-limitation {
    font-size: 14px;
    color: #666666;
    margin-bottom: 6px;
    line-height: 1.4;
}

.bottleneck-utilization {
    font-size: 14px;
    color: #999999;
    font-style: italic;
}

.bottleneck-severity-badge {
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    margin-right: 16px;
	padding: 3px;
}

.bottleneck-severity-badge.critical {
    background-color: #dc3545;
    color: #ffffff;
}

.bottleneck-severity-badge.high {
    background-color: #ffc107;
    color: #000000;
}

.bottleneck-severity-badge.moderate {
    background-color: #17a2b8;
    color: #ffffff;
}

/* ==========================================================================
   Results Section - Recommendations
   ========================================================================== */

.recommendation-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.recommendation-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background: #ffffff;
    transition: box-shadow 0.2s ease;
}

.recommendation-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.recommendation-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.recommendation-component-type {
    font-size: 12px;
    text-transform: uppercase;
    color: #666666;
    font-weight: 600;
}

.recommendation-image {
    width: 100%;
    height: 180px;
    object-fit: contain;
    margin-bottom: 16px;
}

.recommendation-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.recommendation-specs {
    font-size: 13px;
    color: #666666;
    margin-bottom: 12px;
    line-height: 1.5;
}

.performance-delta {
    padding: 12px;
    background-color: #fceaff;
    border-left: none;
    border-radius: 4px;
    margin-bottom: 12px;
}

.performance-delta-text {
    font-size: 14px;
    font-weight: 600;
    color: #7d5860;
}

.recommendation-pricing {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    margin-top: 12px;
}

.price-current {
    text-decoration: line-through;
    color: #999999;
    font-size: 14px;
}

.price-recommended {
    font-size: 18px;
    font-weight: 700;
    color: #7d5860;
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */

.recommendation-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.btn-customize-build {
    flex: 1;
    padding: 10px 16px;
    background-color: #7d5860;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.btn-customize-build .btn-icon {
    display: inline-block;
    transition: filter 0.2s ease;
}

.btn-customize-build:hover {
    background-color: #6a4a52;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(125, 88, 96, 0.3);
}

.btn-customize-build:hover .btn-icon {
    filter: brightness(1.3);
}

.btn-reset {
    flex: 1;
    padding: 10px 16px;
    background-color: transparent;
    color: #dc3545;
    border: 2px solid #dc3545;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.btn-reset:hover {
    background-color: #dc3545;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.btn-add-to-cart:hover {
    background-color: #f7ca00;
}

/* ==========================================================================
   Loading and Error States
   ========================================================================== */

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #7d5860;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    padding: 16px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
    margin-bottom: 20px;
}

/* ==========================================================================
   Mobile Responsive Styles
   ========================================================================== */

@media screen and (max-width: 768px) {
    /* Container adjustments */
    .aipcb-upgrade-advisor-container {
        padding: 12px;
    }
    
    .upgrade-advisor-header h2 {
        font-size: 24px;
    }
    
    .upgrade-advisor-description {
        font-size: 14px;
    }
    
    /* Section spacing */
    .upgrade-advisor-section {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .upgrade-advisor-section h3 {
        font-size: 18px;
    }
    
    .upgrade-advisor-section h4 {
        font-size: 16px;
    }
    
    /* Component inputs - Stack vertically */
    .component-inputs-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Component search inputs - Larger touch targets */
    .component-search-input {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 48px;
    }
    
    /* Selected component cards */
    .selected-component-card {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }
    
    .component-selected-image {
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    .component-remove-btn {
        width: 15%;
        min-height: 24px;
        padding: 6px;
        font-size: 14px;
    }
    
    /* Use case selector - Stack vertically */
    .use-case-selector {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .use-case-option {
        padding: 16px;
        min-height: 56px;
        font-size: 16px;
    }
    
    /* Goals checkboxes - Larger touch targets */
    .goals-checkboxes {
        flex-direction: column;
        gap: 12px;
    }
    
    .goal-checkbox-label {
        padding: 8px;
        min-height: 44px;
        font-size: 16px;
    }
    
    .goal-checkbox-label input[type="checkbox"] {
        width: 24px;
        height: 24px;
        margin-right: 12px;
    }
    
    /* Budget input */
    .budget-input-wrapper {
        max-width: 100%;
    }
    
    .budget-input {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 48px;
    }
    
    /* Suggest upgrades button */
    .suggest-upgrades-button {
        width: 100%;
        padding: 16px 32px;
        font-size: 16px;
        min-height: 52px;
    }
    
    /* Bottleneck items */
    .bottleneck-card {
        flex-direction: column;
        text-align: center;
        padding: 16px;
        gap: 16px;
    }
    
    .bottleneck-image-wrapper {
        width: 100px;
        height: 100px;
    }
    
    .bottleneck-info {
        text-align: center;
        width: 100%;
    }
    
    .bottleneck-header {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .bottleneck-severity-badge {
        margin-right: 0;
    }
    
    /* Recommendation cards - Single column */
    .recommendation-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .recommendation-card {
        padding: 16px;
    }
    
    .recommendation-image {
        height: 160px;
    }
    
    /* Recommendation actions - Stack vertically with larger touch targets */
    .recommendation-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-customize-build,
    .btn-add-to-cart {
        width: 100%;
        padding: 14px 16px;
        font-size: 16px;
        min-height: 52px;
    }
    
    /* Component search results */
    .component-search-results {
        max-height: 250px;
    }
    
    .component-result-item {
        padding: 14px 16px;
        min-height: 64px;
    }
    
    .component-result-image {
        width: 48px;
        height: 48px;
    }
    
    .component-result-name {
        font-size: 15px;
    }
    
    .component-result-brand {
        font-size: 13px;
    }
    
    .component-result-price {
        font-size: 15px;
    }
}

/* ==========================================================================
   Accessibility Improvements
   ========================================================================== */

/* Focus indicators for keyboard navigation - WCAG 2.1 AA compliant */
button:focus-visible,
input:focus-visible,
select:focus-visible,
.use-case-option:focus-visible,
.component-result-item:focus-visible,
.goal-checkbox-label:focus-visible {
    outline: 3px solid #7d5860;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(125, 88, 96, 0.25);
}

/* Remove default focus for mouse users, keep for keyboard users */
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
    outline: none;
}

/* Enhanced focus indicators for interactive elements */
.component-search-input:focus-visible,
.budget-input:focus-visible {
    border-color: #7d5860;
    box-shadow: 0 0 0 3px rgba(125, 88, 96, 0.25);
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to content link for keyboard navigation */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #7d5860;
    color: #ffffff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 1000;
}

.skip-to-content:focus {
    top: 0;
}

/* Enhanced color contrast for text - WCAG 2.1 AA (4.5:1) */
.section-description {
    color: #595959; /* Improved from #666666 for better contrast */
}

.field-description {
    color: #6c6c6c; /* Improved from #888888 for better contrast */
}

.component-result-brand {
    color: #595959; /* Improved from #666666 */
}

.component-selected-brand,
.component-selected-specs {
    color: #595959; /* Improved from #666666 */
}

.recommendation-specs,
.upgrade-cost {
    color: #595959; /* Improved from #666666 */
}

/* High contrast for critical information */
.recommendation-component-type {
    color: #595959; /* Improved from #666666 */
    font-weight: 600;
}

/* Ensure adequate contrast for required field indicator */
.required {
    color: #c82333; /* Enhanced from #dc3545 for better contrast */
}

/* Focus trap for modal dialogs (if implemented) */
[aria-modal="true"] {
    position: fixed;
    z-index: 9999;
}

/* Hidden buttons should not be in tab order */
button[style*="display: none"],
button[style*="display:none"] {
    visibility: hidden;
}

/* Keyboard-accessible dropdowns */
.component-search-results[role="listbox"] {
    outline: none;
}

.component-result-item[role="option"] {
    cursor: pointer;
}

.component-result-item[role="option"]:focus {
    background-color: #e6f2ff;
    outline: 2px solid #7d5860;
    outline-offset: -2px;
}

/* ARIA live regions should be visible to screen readers but not visually intrusive */
[role="alert"],
[role="status"] {
    position: relative;
}

/* Fieldset and legend styling for better accessibility */
fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
}

legend {
    padding: 0 8px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Loading indicators should be announced to screen readers */
.spinner[aria-hidden="true"] + .sr-only {
    /* Screen reader text for loading states */
}

/* ==========================================================================
   Form Validation Styles
   ========================================================================== */

/* Validation error highlight for input fields */
.validation-error {
    border-color: #dc3545 !important;
    background-color: #fff5f5;
}

.validation-error:focus {
    border-color: #c82333 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
}

/* Validation error messages */
.validation-error-message {
    color: #dc3545;
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.validation-error-message::before {
    content: "⚠ ";
    margin-right: 4px;
    font-size: 14px;
}

/* Validation error summary */
.validation-error-summary {
    background-color: #f8d7da;
    border: 2px solid #dc3545;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
    color: #721c24;
}

.validation-error-summary strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
}

.validation-error-summary ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.validation-error-summary li {
    margin-bottom: 4px;
    font-size: 14px;
}

/* Use case selector validation */
.use-case-selector.validation-error {
    border: 2px solid #dc3545;
    border-radius: 6px;
    padding: 16px;
    background-color: #fff5f5;
}

/* Goals section validation */
#goals-section.validation-error {
    border: 2px solid #dc3545;
    border-radius: 6px;
    padding: 16px;
    background-color: #fff5f5;
}

/* Budget input validation */
.budget-input.validation-error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.budget-input-wrapper .validation-error-message {
    margin-top: 8px;
}

/* Mobile responsive validation styles */
@media screen and (max-width: 768px) {
    .validation-error-summary {
        padding: 14px;
        font-size: 14px;
    }
    
    .validation-error-summary strong {
        font-size: 15px;
    }
    
    .validation-error-summary li {
        font-size: 13px;
    }
    
    .validation-error-message {
        font-size: 12px;
    }
}


/* ==========================================================================
   Platform Selector Styles
   ========================================================================== */

/* Set accent color for all radio buttons and checkboxes in upgrade advisor */
.aipcb-upgrade-advisor-container input[type="radio"],
.aipcb-upgrade-advisor-container input[type="checkbox"] {
    accent-color: #7d5860;
}

.platform-selector-wrapper {
    margin-bottom: 24px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.platform-selector {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.platform-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 20px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s ease;
    min-width: 120px;
    justify-content: center;
}

.platform-option:hover {
    border-color: #7d5860;
    background-color: #fceaff;
}

.platform-option input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.platform-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #7d5860;
}

.platform-option:has(input[type="radio"]:checked) {
    border-color: #7d5860;
    background-color: #fceaff;
}

/* ==========================================================================
   Validation Error Styles
   ========================================================================== */

.validation-error {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
}

.validation-error-message {
    color: #dc3545;
    font-size: 13px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.validation-error-message::before {
    content: "⚠";
    font-weight: bold;
}

.validation-error-summary {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
    color: #721c24;
}

.validation-error-summary strong {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

.validation-error-summary ul {
    margin: 0;
    padding-left: 20px;
}

.validation-error-summary li {
    margin-bottom: 4px;
}

/* ==========================================================================
   Resolution and Task Options Styles
   ========================================================================== */

.goals-subsection {
    margin-bottom: 20px;
}

.goals-subsection-title {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 12px;
}

.resolution-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.resolution-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 18px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s ease;
    min-width: 100px;
    justify-content: center;
}

.resolution-option:hover {
    border-color: #7d5860;
    background-color: #fceaff;
}

.resolution-option input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.resolution-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #7d5860;
}

.resolution-option:has(input[type="radio"]:checked) {
    border-color: #7d5860;
    background-color: #fceaff;
}

.task-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.task-option,
.workflow-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 14px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.task-option:hover,
.workflow-option:hover {
    border-color: #7d5860;
    background-color: #fceaff;
}

.task-option input[type="checkbox"],
.workflow-option input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.task-option:has(input[type="checkbox"]:checked),
.workflow-option:has(input[type="checkbox"]:checked) {
    border-color: #7d5860;
    background-color: #fceaff;
}

.task-option:has(input[type="checkbox"]:checked) span,
.workflow-option:has(input[type="checkbox"]:checked) span {
    font-weight: 600;
    color: #7d5860;
}

.goal-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.goal-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 14px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.goal-checkbox-label:hover {
    border-color: #7d5860;
    background-color: #fceaff;
}

.goal-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
}

.goal-checkbox-label:has(input[type="checkbox"]:checked) {
    border-color: #7d5860;
    background-color: #fceaff;
}

.goal-checkbox-label:has(input[type="checkbox"]:checked) span {
    font-weight: 600;
    color: #7d5860;
}

/* ==========================================================================
   Component Remove Button Styles
   ========================================================================== */

.component-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    background-color: #7d5860;
    color: #ffffff;
    border-radius: 10%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.component-remove-btn:hover {
    background-color: #7d5860;
    transform: scale(1.1);
}

.component-remove-btn:focus {
    outline: 3px solid rgba(220, 53, 69, 0.5);
    outline-offset: 2px;
}

.component-selected-card {
    position: relative;
    padding-top: 36px; /* Space for remove button */
}

/* ==========================================================================
   Mobile Responsive Updates for New Elements
   ========================================================================== */

@media screen and (max-width: 768px) {
    .platform-selector {
        flex-direction: column;
    }
    
    .platform-option {
        width: 100%;
    }
    
    .resolution-options {
        flex-direction: column;
    }
    
    .resolution-option {
        width: 100%;
    }
    
    .task-options {
        grid-template-columns: 1fr;
    }
    
    .goal-checkboxes {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   Results Display Styles
   ========================================================================== */

.results-container {
    margin-top: 30px;
}

.bottleneck-section,
.budget-section,
.recommendations-section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    position: relative;
}

/* Remove the ::after from individual sections when inside wrapper */
.bottleneck-budget-wrapper .bottleneck-section::after,
.bottleneck-budget-wrapper .budget-section::after {
    display: none;
}

/* Keep ::after for standalone sections */
.bottleneck-section::after,
.budget-section::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background-color: #e0e0e0;
    margin: 30px 0;
}

.recommendations-section::after {
    display: none;
}

/* Heading styles for all result sections */
.bottleneck-section h3,
.budget-section h3,
.recommendations-section h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

/* When inside wrapper, ensure headings align properly */
.bottleneck-budget-wrapper .bottleneck-section h3,
.bottleneck-budget-wrapper .budget-section h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Bottleneck Items */
.bottleneck-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bottleneck-item {
    padding: 16px 0;
    border-radius: 0;
    border-left: none;
    background: transparent;
}

.bottleneck-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.bottleneck-severity-badge.critical,
.bottleneck-severity-badge.high,
.bottleneck-severity-badge.moderate {
    background: #7d5860;
    color: #ffffff;
}

.bottleneck-name {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.bottleneck-limitation {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
}

.bottleneck-utilization {
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Budget Info */
.budget-info {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.budget-info p {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin: 0;
}

/* Recommendation Cards */
.recommendation-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.recommendation-card {
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.recommendation-card:hover {
    box-shadow: none;
    transform: none;
    border-color: #7d5860;
}

.recommendation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.recommendation-component-type {
    font-size: 12px;
    font-weight: 600;
    color: #7d5860;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recommendation-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto auto auto auto;
    gap: 0 20px;
    margin-bottom: 16px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    align-items: start;
}

.current-component {
    position: relative;
    text-align: right;
    display: grid;
    grid-template-rows: auto auto auto auto auto;
    grid-row: 1 / 6;
    align-items: end;
    row-gap: 2px;
}

.recommended-component {
    position: relative;
    text-align: left;
    display: grid;
    grid-template-rows: auto auto auto auto;
    grid-row: 1 / 6;
    align-items: start;
	row-gap: 2pxp;
}

.arrow {
    font-size: 24px;
    color: #7d5860;
    font-weight: bold;
    text-align: center;
    grid-row: 1 / 6;
    align-self: center;
}

.component-label {
    font-size: 10px;
    text-transform: uppercase;
    color: #666;
    margin: 0 0 3px 0;
    font-weight: 600;
    letter-spacing: 0.5px;
    grid-row: 1;
}

.current-component .component-label {
    text-align: right;
}

.recommended-component .component-label {
    text-align: left;
}

/* Current component specific styles */
.current-component-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin: 0 0 3px 0;
    display: block;
    grid-row: 2;
    justify-self: end;
}

.current-image-placeholder {
    width: 100px;
    height: 100px;
    background: #f0f0f0;
    border-radius: 4px;
    margin: 0 0 3px 0;
    display: block;
    grid-row: 2;
    justify-self: end;
}

.current-component-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 2px 0 !important;
    line-height: 1.3;
    text-align: right;
    grid-row: 3;
}

.current-component-price {
    font-size: 14px;
    font-weight: 700;
    color: #7d5860;
    margin: 0 0 0 0 !important;
    text-align: right;
    grid-row: 4;
}

.current-component .btn-view-component {
    grid-row: 5;
    width: 100%;
    max-width: 200px;
    justify-self: end;
    padding: 8px 12px;
    font-size: 12px;
    min-height: 36px;
}

/* Recommended component specific styles */
.recommended-component-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin: 0 0 3px 0;
    display: block;
    grid-row: 2;
    justify-self: start;
}

.recommended-image-placeholder {
    width: 100px;
    height: 100px;
    background: #f0f0f0;
    border-radius: 4px;
    margin: 0 0 3px 0;
    display: block;
    grid-row: 2;
    justify-self: start;
}

.recommended-component-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 2px 0 !important;
    line-height: 1.3;
    text-align: left;
    grid-row: 3;
}

.recommended-component-price {
    font-size: 14px;
    font-weight: 700;
    color: #7d5860;
    margin: 0 0 0 0 !important;
    text-align: left;
    grid-row: 4;
}

.recommended-component .btn-view-component {
    grid-row: 5;
    width: 100%;
    max-width: 200px;
    justify-self: start;
    padding: 8px 12px;
    font-size: 12px;
    min-height: 36px;
}

.arrow {
    font-size: 24px;
    color: #7d5860;
    font-weight: bold;
    text-align: center;
    align-self: center;
}

.performance-delta {
    background: #fceaff;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    border-left: none;
}

.performance-delta strong {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: #7d5860;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.performance-delta p {
    margin: 0;
    font-size: 13px;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
}

.score-cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

.optimization-score {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    font-size: 13px;
    color: #333;
}

.upgrade-cost strong {
    color: #7d5860;
	font-size: 13px;
	font-weight: 600;
}

.score-value {
	padding: 0px 5px;
    border-radius: 4px;
    font-weight: 400;
    font-size: 12px;
	height: 20px;
}

.score-value.score-green,
.score-value.score-yellow,
.score-value.score-red {
    background-color: #7d5860;
    color: #ffffff;
}

.rationale {
    font-size: 13px;
    color: #595959;
    line-height: 1.5;
    margin-bottom: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.recommendation-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-view-component {
    padding: 14px 24px;
    background: transparent;
    color: #7d5860;
    border: 2px solid #7d5860;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
}

.btn-view-component:hover {
    background: #7d5860;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(125, 88, 96, 0.3);
    border: 2px solid #7d5860;
}

.rationale {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 16px;
    padding: 12px;
    background: #f0f0f0;
    border-radius: 4px;
}

.recommendation-actions {
    display: flex;
    gap: 12px;
}

/* Note: Main .btn-view-component styles are defined earlier in the file */

.no-recommendations {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-recommendations p {
    margin: 8px 0;
}

/* Loading Spinner Enhancement */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner p {
    margin-top: 20px;
    font-size: 16px;
    color: #666;
}

/* Mobile Responsive Updates */
@media screen and (max-width: 768px) {
    .recommendation-cards {
        grid-template-columns: 1fr;
    }
    
    .recommendation-comparison {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto auto auto auto auto auto auto;
        gap: 12px 0;
    }
    
    .current-component {
        text-align: center;
        padding: 0;
        grid-row: 1 / 6;
        align-items: center;
        justify-items: center;
    }
    
    .arrow {
        grid-row: 6;
        transform: rotate(90deg);
    }
    
    .recommended-component {
        text-align: center;
        padding: 0;
        grid-row: 7 / 12;
        align-items: center;
        justify-items: center;
    }
    
    .component-label {
        text-align: center !important;
    }
    
    .current-component-image,
    .current-image-placeholder {
        justify-self: center;
    }
    
    .recommended-component-image,
    .recommended-image-placeholder {
        justify-self: center;
    }
    
    .current-component-name,
    .current-component-price,
    .recommended-component-name,
    .recommended-component-price {
        text-align: center !important;
    }
    
    .current-component .btn-view-component,
    .recommended-component .btn-view-component {
        justify-self: center;
        max-width: 100%;
    }
    }
    
    .score-cost-row {
        flex-direction: row;
        align-items: flex-start;
        gap: 8px;
    }
    
    .budget-info {
        flex-direction: column;
        gap: 12px;
    }
}

        flex-direction: column;
    }
    
    .resolution-option {
        width: 100%;
        min-height: 48px;
    }
    
    .task-options,
    .goal-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .task-option,
    .workflow-option,
    .goal-checkbox-label {
        min-height: 48px;
        font-size: 16px;
    }
}

/* ==========================================================================
   Results Display Styles
   ========================================================================== */

.results-container {
    margin-top: 32px;
}

.bottleneck-section,
.budget-section,
.recommendations-section {
    margin-bottom: 32px;
}

.bottleneck-section h3,
.budget-section h3,
.recommendations-section h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.bottleneck-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bottleneck-item {
    padding: 16px 0;
    border-radius: 0;
    background: transparent;
    border-left: none;
    display: block;
}

.bottleneck-item.critical,
.bottleneck-item.high,
.bottleneck-item.moderate {
    border-left: none;
    background: transparent;
}

.bottleneck-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.bottleneck-component-type {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
}

.bottleneck-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.bottleneck-limitation {
    font-size: 14px;
    color: #595959;
    margin-bottom: 6px;
    line-height: 1.5;
}

.bottleneck-utilization {
    font-size: 13px;
    color: #666666;
    font-weight: 500;
}

.budget-section {
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
}

/* When inside wrapper, budget-info is a card with background */
.bottleneck-budget-wrapper .budget-info {
    background: #f0f7ff;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.budget-info p {
    margin: 8px 0;
    font-size: 16px;
    color: #1a1a1a;
}

.budget-info p strong {
    font-weight: 600;
}

.recommendation-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.current-component,
.recommended-component {
    text-align: center;
}

.current-component h5,
.recommended-component h5 {
    font-size: 12px;
    text-transform: uppercase;
    color: #666666;
    font-weight: 600;
}

.rec-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin: 0 auto 12px;
    display: block;
}

.component-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.component-brand {
    font-size: 13px;
    color: #666666;
    margin-bottom: 6px;
}

.component-specs {
    font-size: 12px;
    color: #888888;
    margin-bottom: 8px;
    line-height: 1.4;
}

.component-price {
    font-size: 16px;
    font-weight: 700;
    color: #7d5860;
}

.arrow {
    font-size: 24px;
    color: #7d5860;
    font-weight: bold;
}

.performance-delta strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #7d5860;
}

.performance-delta p {
    margin: 0;
    font-size: 14px;
    color: #7d5860;
    font-weight: 600;
}

.optimization-score {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.score-value.score-green,
.score-value.score-yellow,
.score-value.score-red {
    background-color: #7d5860;
    color: #ffffff;
}

.upgrade-cost {
    font-size: 16px;
    margin-bottom: 12px;
}

.rationale {
    font-size: 13px;
    color: #595959;
    font-style: italic;
    padding: 12px;
    background: transparent;
    border-radius: 0;
    margin-bottom: 12px;
}

/* Note: .btn-view-component styles are defined earlier in the file */

/* ==========================================================================
   Integration Actions Section
   ========================================================================== */

.integration-actions {
    margin-top: 32px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
}

.integration-actions h4 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.action-buttons-section {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    transition: all 0.3s ease;
}

/* Sticky button styles - full-width bar at bottom */
.action-buttons-section.is-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    z-index: 1000;
    background: #7d5860;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    animation: slideInBottomBar 0.3s ease;
    margin-bottom: 0 !important; /* Remove bottom margin when sticky */
}

/* Hide the separator line when button is sticky */
.action-buttons-section.is-sticky::after {
    display: none !important;
}

/* Restyle buttons when in sticky bar - different from original */
.action-buttons-section.is-sticky #suggest-upgrades-btn,
.action-buttons-section.is-sticky #upgrade-advisor-reset-btn,
.action-buttons-section.is-sticky .btn-reset-sticky,
.action-buttons-section.is-sticky #load-in-builder-btn-sticky,
.action-buttons-section.is-sticky .btn-customize-build-sticky {
    margin: 0;
    background: #ffffff;
    color: #7d5860;
    border: 2px solid #7d5860;
}

/* Amazon button in sticky bar keeps its gold styling */
.action-buttons-section.is-sticky #amazon-cart-btn-sticky,
.action-buttons-section.is-sticky .btn-amazon-cart-sticky {
    margin: 0;
    background: #FFD814;
    color: #000;
    border: 2px solid #F7CA00;
}

.action-buttons-section.is-sticky #suggest-upgrades-btn:hover:not(:disabled),
.action-buttons-section.is-sticky #upgrade-advisor-reset-btn:hover,
.action-buttons-section.is-sticky .btn-reset-sticky:hover,
.action-buttons-section.is-sticky #load-in-builder-btn-sticky:hover,
.action-buttons-section.is-sticky .btn-customize-build-sticky:hover {
    background: #7d5860;
    color: #ffffff;
    border: 2px solid #ffffff;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.action-buttons-section.is-sticky #amazon-cart-btn-sticky:hover,
.action-buttons-section.is-sticky .btn-amazon-cart-sticky:hover {
    background: #F7CA00;
    border: 2px solid #7d5860;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.action-buttons-section.is-sticky #suggest-upgrades-btn:disabled {
    background: rgba(255, 255, 255, 0.5);
    color: rgba(125, 88, 96, 0.5);
    border-color: rgba(125, 88, 96, 0.5);
}

/* Show reset button only when sticky and results are visible */
.action-buttons-section.is-sticky #upgrade-advisor-reset-btn {
    display: flex !important;
}

@keyframes slideInBottomBar {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile adjustments - stack buttons vertically */
@media screen and (max-width: 768px) {
    .action-buttons-section.is-sticky {
        padding: 20px 16px;
        flex-direction: column; /* Stack vertically on mobile */
        gap: 12px;
    }
    
    .action-buttons-section.is-sticky #suggest-upgrades-btn,
    .action-buttons-section.is-sticky #upgrade-advisor-reset-btn,
    .action-buttons-section.is-sticky .btn-reset-sticky,
    .action-buttons-section.is-sticky #load-in-builder-btn-sticky,
    .action-buttons-section.is-sticky .btn-customize-build-sticky,
    .action-buttons-section.is-sticky #amazon-cart-btn-sticky,
    .action-buttons-section.is-sticky .btn-amazon-cart-sticky {
        width: 100%; /* Full width on mobile */
        flex: none;
        min-width: unset;
    }
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.btn-primary {
    padding: 14px 24px;
    background: transparent;
    color: #7d5860;
    border: 2px solid #7d5860;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #7d5860;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(125, 88, 96, 0.3);
	border: none;
}

.btn-primary:disabled {
    background: transparent;
    color: #cccccc;
    border-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    padding: 14px 24px;
    background: transparent;
    color: #7d5860;
    border: 1px solid #7d5860;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #7d5860;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(125, 88, 96, 0.3);
}

.btn-amazon {
    padding: 14px 24px;
    background: #FFD814;
    color: #000000;
    border: 2px solid #FFD814;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-amazon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(125, 88, 96, 0.4);
	color: #000;
	background-color: #FFD814;
	border: none;
}

/* ==========================================================================
   Error and Retry Styles
   ========================================================================== */

.error-message {
    padding: 20px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
    text-align: center;
}

.error-message p {
    margin: 0 0 16px 0;
    font-size: 16px;
}

.btn-retry {
    padding: 12px 24px;
    background: #7d5860;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: 44px;
}

.btn-retry:hover {
    background: #7d5860;
}

.no-recommendations {
    padding: 40px 0;
    text-align: center;
    background: transparent;
    border-radius: 0;
    border: none;
}

.no-recommendations p {
    margin: 8px 0;
    font-size: 16px;
    color: #595959;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.search-loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

.loading-spinner p {
    margin-top: 16px;
    font-size: 16px;
    color: #666666;
}

/* ==========================================================================
   Mobile Responsive - Results Section
   ========================================================================== */

@media screen and (max-width: 768px) {
    .results-container {
        margin-top: 24px;
    }
    
    .bottleneck-section h3,
    .budget-section h3,
    .recommendations-section h3 {
        font-size: 20px;
    }
    
    .recommendation-comparison {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .arrow {
        transform: rotate(90deg);
        margin: 8px 0;
    }
    
    .rec-image {
        width: 100px;
        height: 100px;
    }
    
    .integration-actions {
        padding: 16px;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .btn-primary,
    .btn-amazon {
        font-size: 15px;
        padding: 14px 20px;
    }
}

/* ==========================================================================
   Component Optimization Score Display
   ========================================================================== */

.component-optimization-score {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 0;
    background: transparent;
    border-radius: 0;
}

.optimization-label {
    font-size: 13px;
    color: #666666;
}

.optimization-value {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.optimization-value.score-green,
.optimization-value.score-yellow,
.optimization-value.score-red {
    background-color: #7d5860;
    color: #ffffff;
}

/* ==========================================================================
   Search Results Enhancements
   ========================================================================== */

.search-no-results {
    padding: 16px;
    text-align: center;
    color: #666666;
    font-size: 14px;
}

.search-error {
    padding: 16px;
    text-align: center;
    color: #dc3545;
    font-size: 14px;
    background: #fff5f5;
}

/* ==========================================================================
   Additional Utility Classes
   ========================================================================== */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #666666;
}

.font-weight-bold {
    font-weight: 600;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .component-search-input,
    .suggest-upgrades-button,
    .component-remove-btn,
    .btn-customize-build,
    .btn-amazon,
    .btn-view-component,
    .btn-retry {
        display: none;
    }
    
    .recommendation-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .bottleneck-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}


/* ==========================================================================
   Comparison Feature Styles
   ========================================================================== */

/* Compare button at bottom of recommendation card */
.btn-compare-components {
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    color: #7d5860;
    border: 2px solid #7d5860;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-compare-components:hover {
    background: #7d5860;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(125, 88, 96, 0.3);
    border: 2px solid #7d5860;
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
    .btn-compare-components,
    .btn-view-component {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 48px;
    }
}


/* ==========================================================================
   Bottleneck and Budget Flexbox Layout
   ========================================================================== */

/* Wrapper for bottlenecks and budget - side by side on desktop */
.bottleneck-budget-wrapper {
    display: flex;
    gap: 24px;
    margin-bottom: 50px;
    align-items: flex-start;
    position: relative;
}

/* Container-width separator after the wrapper */
.bottleneck-budget-wrapper::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background-color: #e0e0e0;
    position: absolute;
    bottom: 0px;
    left: 0;
}

/* Each section takes equal space */
.bottleneck-budget-wrapper .bottleneck-section,
.bottleneck-budget-wrapper .budget-section {
    flex: 1;
    min-width: 0; /* Prevents overflow */
}

/* Budget section styling - no background on outer container */
.budget-section {
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
}

/* Budget section heading - aligned with bottleneck heading */
.budget-section h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Budget info card - background only on content */
.budget-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f0f7ff;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.budget-info p {
    font-size: 16px;
    color: #333333;
    margin: 0;
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.budget-info p:last-child {
    border-bottom: none;
}

.budget-info p strong {
    font-weight: 700;
    color: #7d5860;
}

/* Mobile: Stack vertically */
@media screen and (max-width: 768px) {
    .bottleneck-budget-wrapper {
        flex-direction: column;
        gap: 24px;
    }
    
    .bottleneck-budget-wrapper .bottleneck-section,
    .bottleneck-budget-wrapper .budget-section {
        width: 100%;
    }
}
