#aipcb-builder {
    max-width: 1200px;
    margin-left: 0px;
    margin-bottom: 20px;
    margin-top: 20px;
    margin-right: 0px;
    font-family: inherit;
}

#aipcb-compatibility-alert {
    padding: 10px;
    margin-bottom: 10px;
    font-weight: bold;
    border-radius: 8px;
}

#aipcb-compatibility-alert.no-issues {
    background-color: #C1949C;
    color: #000000;
	text-align: center;
}

#aipcb-compatibility-alert.issues {
    background-color: #C1949C;
    color: #453035;
}

#aipcb-unavailable-alert {
    padding: 15px;
    margin-bottom: 15px;
    background-color: #fff5f5;
    border: 2px solid #dc3545;
    border-radius: 8px;
    color: #dc3545;
    font-style: italic;
    font-weight: bold;
    text-align: center;
}

#aipcb-unavailable-alert.aipcb-flash-alert {
    animation: flash 2s infinite;
}

#aipcb-budget-alert {
    margin-bottom: 0px !important;
}

#aipcb-build-table, #aipcb-components-table {
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px !important;
    table-layout: fixed;
    width: 100%;
    background-color: #ffffff;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#aipcb-build-table th, #aipcb-components-table th,
#aipcb-build-table td, #aipcb-components-table td {
    border: none;
    padding: 6px 6px;
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

.aipcb-table-container {
    width: 100%;
    margin-bottom: 5px;
    position: relative;
	background-color: #FFFFFF;
}

#aipcb-build-table th, #aipcb-components-table th {
    background-color: #7D5860;
    color: white;
    cursor: pointer;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
}

#aipcb-build-table th:hover, #aipcb-components-table th:hover {
    background-color: #C1949C;
}

#aipcb-build-table tbody tr:nth-child(even) {
    background-color: #FCEAFF;
}

#aipcb-build-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

#aipcb-build-table img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    padding: 4px;
}

#aipcb-build-table .aipcb-product-name {
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.4;
}

#aipcb-build-table td {
    color: #495057;
}

#aipcb-build-table tfoot td {
    background-color: #7D5860;  /* Same as header */
    color: white;               /* High contrast text */
    font-weight: bold;          /* Bold for all footer text */
    font-size: 16px;           /* Readable size */
    border-top: 2px solid #e9ecef; /* Clean separation */
}


#aipcb-build-table tfoot td:nth-child(5) {
    font-weight: 900;
    font-size: 18px;
    text-align: center;
}

/* Column widths for #aipcb-components-table */
#aipcb-components-table th:nth-child(1),
#aipcb-components-table td:nth-child(1) {
    width: 80px; /* Action */
}

#aipcb-components-table th:nth-child(2),
#aipcb-components-table td:nth-child(2) {
    width: 80px; /* Quantity */
}

#aipcb-components-table th:nth-child(3),
#aipcb-components-table td:nth-child(3) {
    width: 100px; /* Component */
}

#aipcb-components-table th:nth-child(4),
#aipcb-components-table td:nth-child(4) {
    width: 80px; /* Image */
}

#aipcb-components-table th:nth-child(5),
#aipcb-components-table td:nth-child(5) {
    width: 205px; /* Product */
}

#aipcb-components-table th:nth-child(6),
#aipcb-components-table td:nth-child(6) {
    width: 100px; /* Brand */
}

#aipcb-components-table th:nth-child(7),
#aipcb-components-table td:nth-child(7) {
    width: 130px; /* Key Specs */
}

#aipcb-components-table th:nth-child(8),
#aipcb-components-table td:nth-child(8) {
    width: 80px; /* Price */
}

#aipcb-components-table th:nth-child(9),
#aipcb-components-table td:nth-child(9) {
    width: 100px; /* Benchmark Score */
}

#aipcb-components-table th:nth-child(10),
#aipcb-components-table td:nth-child(10) {
    width: 120px; /* Product Link */
}

.wp-list-table th {
    background-color: #7D5860;
    color: white;
}

button:not(#aipcb-add-to-cart):not(.aipcb-add-to-cart) {
    color: white;
    border: none;
    padding: 10px 15px;
    margin-right: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 4px;
	font-size: 16px;
}


button:not(#aipcb-add-to-cart):not(.aipcb-add-to-cart):hover {
    color: white;
}

#aipcb-filter.aipcb-filter {
    background-color: #7D5860 !important;
    color: white;
    border: none;
    padding: 5px 10px !important;
    margin-right: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 4px;
/*  width: 50px !important; */
}


/* Add component buttons styling */
.aipcb-add-component-btn {
    background-color: #4CAF50 !important;
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aipcb-add-component-btn:hover {
    background-color: #45a049 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.aipcb-add-component-btn.added {
    background-color: #ff9800 !important;
    color: white;
}

.aipcb-add-component-btn.added:hover {
    background-color: #f57c00 !important;
}

/* Key Specs button styling */
.aipcb-key-specs-btn {
    background-color: #2196F3 !important;
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aipcb-key-specs-btn:hover {
    background-color: #1976D2 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#aipcb-add-selected {
    background-color: #00b029;
}

#aipcb-add-selected:hover {
    background-color: #008020;
}

#aipcb-component-modal {
    position: fixed;
	border-radius: 12px;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding-top: 10px;
	padding-left: 10px;
	padding-right: 10px;
	padding-bottom: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    z-index: 1000;
    width: 100%;
    max-width: 1230px;
    overflow: hidden;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
	max-height: auto;
	height: 94%;
}

#aipcb-component-modal.show {
    opacity: 1;
}

.modal-content {
    display: flex;
    flex-direction: column;
    max-height: 100%;
	height: 100%;
    line-height: 13px;
}

.table-container {
	flex: 1 1 auto;
	min-height: 0;
	height: 70%; /* Restore fixed height so vertical scroll appears on desktop */
	overflow-y: auto;
	overflow-x: auto; /* Allow horizontal scroll for wide tables */
	border-radius: 0;
	position: relative;
}

/* Custom scrollbar for table container */
.table-container::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0;
}

.table-container::-webkit-scrollbar-thumb {
    background: #7D5860;
    border-radius: 5px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #C1949C;
}

#aipcb-components-table thead {
	display: table-header-group; /* Ensure default table header behavior */
}

#aipcb-components-table thead th {
	position: sticky;
	top: 0;
	background-color: #7D5860;
	color: white;
	z-index: 10;
	font-size: 11px;
	border-bottom: 2px solid #7D5860;
}

#aipcb-components-table thead th:hover {
    background-color: #C1949C;
}

#aipcb-close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

/* Styles for the budget section and action buttons */
#aipcb-budget-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

/* Budget input styling */
#aipcb-budget {
    width: 100px !important;
    height: 38px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    line-height: 1.2;
    vertical-align: middle;
}

#aipcb-budget:focus {
    border-color: #7D5860;
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Use case and action buttons container */
#aipcb-use-case-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: #f0f8ff;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
    margin: 5px 0;
}

/* Action buttons container */
#aipcb-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 5px 0;
}

/* Use case dropdown */
#aipcb-main-use-case {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ccc;
    min-width: 150px;
    background-color: white;
    font-size: 14px;
}

/* Responsive layout */
@media (min-width: 768px) {
    /* On larger screens, show use case and buttons in one row */
    #aipcb-budget-section {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    #aipcb-use-case-container {
        margin: 0 15px 0 0;
        padding: 0;
        background: none;
        border: none;
    }
    
    #aipcb-action-buttons {
        margin: 0;
    }
}

/* Mobile layout */
@media (max-width: 767px) {
    #aipcb-use-case-container,
    #aipcb-platform-container,
    #aipcb-gpu-preference-container,
    #aipcb-action-buttons {
        width: 100%;
    }
    
    /* Stack platform select like use case: label above, select full width */
    #aipcb-platform-container label {
        display: block;
        margin-bottom: 5px;
    }
    
    #aipcb-platform,
    #aipcb-gpu-preference {
        width: 100%;
        margin-left: 0;
    }
    
    /* Stack action buttons vertically, full width each (like SET/CLEAR) */
    #aipcb-action-buttons {
        flex-direction: column;
        justify-content: flex-start;
        gap: 10px;
    }
    
    #aipcb-action-buttons button {
        width: 100%;
        justify-content: center;
    }
    
    #aipcb-main-use-case {
        width: 100%;
        margin-left: 0;
    }

    /* Full-width styles for the additional buttons in mobile */
    .aipcb-full-width-mobile {
        width: 100% !important;
        display: block;
        margin-bottom: 10px;
    }

    /* Target specific buttons if they don't have the class (fallback) */
    #aipcb-add-component,
    #aipcb-show-benchmarks-2,
    #aipcb-clear-components-2,
    #aipcb-add-to-cart,
	#aipcb-save-email,
    #aipcb-completed-builds {
        width: 100% !important;
        display: block;
        margin-bottom: 10px;
    }
    
    /* Action buttons in top section (Suggest Build, Add Components, Performance Benchmarks, Clear Components) */
    #aipcb-suggest-build,
    #aipcb-select-components,
    #aipcb-show-benchmarks,
    #aipcb-clear-components {
        width: 100% !important;
        display: block;
        margin-bottom: 10px;
    }

    /* Component modal table container mobile styling */
    #aipcb-component-modal .table-container {
		max-height: calc(70% - 180px); /* Leave more space on mobile for pagination (mobile tweak) */
    }

    /* Component modal footer mobile styling */
    #aipcb-component-modal .modal-footer {
        height: 80px; /* Mobile height */
    }
}

#aipcb-select-components, #aipcb-suggest-build {
    padding: 10px 12px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: normal;
    transition: all 0.3s ease;
}

#aipcb-select-components {
    background-color: #4CAF50 !important;
    color: white;
}

#aipcb-select-components:hover {
    background-color: #45a049 !important;
}

#aipcb-suggest-build {
    background-color: #2196F3 !important;
    color: white;
}

#aipcb-suggest-build:hover {
    background-color: #0b7dda !important;
}

#aipcb-suggest-build:disabled {
    background-color: #cccccc !important;
    cursor: not-allowed;
}

#aipcb-show-benchmarks, #aipcb-show-benchmarks-2 {
    background-color: #9C27B0 !important;
    color: white;
    padding: 10px 12px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#aipcb-show-benchmarks:hover, #aipcb-show-benchmarks-2:hover {
    background-color: #7B1FA2 !important;
}

#aipcb-show-benchmarks:disabled, #aipcb-show-benchmarks-2:disabled {
    background-color: #cccccc !important;
    cursor: not-allowed;
}

#aipcb-component-type {
    margin-top: 0;
    width: 100%;
    padding: 5px;
    margin-bottom: 10px;
	box-sizing: border-box;
}

#aipcb-search {
    width: 100%;
    padding: 5px !important;
    margin-bottom: 10px;
	box-sizing: border-box;
}

.aipcb-build-component-thumbnail {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 4px;
    background: #f5f5f5;
}

/* Thumbnail images - make them clickable */
.aipcb-thumbnail {
    cursor: pointer !important;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.aipcb-thumbnail:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.aipcb-close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #7D5860;
    color: white;
    width: 24px;
    height: 24px;
    font-size: 16px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1001;
}

.aipcb-close-button:hover {
    background: #7D5860;
}

#aipcb-add-to-cart {
    background-color: #FFD814 !important;
    color: #111111;
    padding: 10px 20px;
    text-decoration: none;
    cursor: pointer;
    margin-right: 5px;
    margin-bottom: 10px;
    line-height: 1em;
    height: 36px !Important;
	border-radius: 4px;
	font-size: 16px;
}

.aipcb-add-to-cart {
    background-color: #FFD814 !important;
    color: #111111;
    padding: 10px 20px;
    text-decoration: none;
    cursor: pointer;
    margin-right: 10px;
    margin-left: 5px;
    margin-bottom: 5px;
    line-height: 0.8;
    text-align: center;
    width: 100%;
    border-radius: 5px;
}

#aipcb-add-to-cart:hover, .aipcb-add-to-cart:hover {
    background-color: #FFCE12 !important;
    color: #111111;
}

#aipcb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#aipcb-modal-overlay.show {
    opacity: 1;
}

#aipcb-success-message {
    color: green;
    font-weight: bold;
    text-align: left;
    padding: 10px;
}

/* Harmonized SAVE BUILD Modal Styles - Add to ai-pc-builder.css */

/* Overlay - Harmonized with flex centering for better alignment */
.aipcb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    opacity: 0;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease-in-out;
}

.aipcb-modal-overlay.show {
    display: flex;
    opacity: 1;
}

/* Modal - Enhanced with border-radius, max-width, overflow, and modern font. Position absolute for centering inside overlay. */
.aipcb-share-modal {
    background: white;
    border-radius: 12px;
    padding: 30px 45px 30px 30px; /* Added more right padding to make room for scrollbar */
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: absolute;
    text-align: left;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    overflow: auto;
}

/* Custom scrollbar for the share modal */
.aipcb-share-modal::-webkit-scrollbar {
    width: 12px;
}

.aipcb-share-modal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 12px 12px 0;
    margin: 30px 0;
}

.aipcb-share-modal::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
    border: 3px solid transparent;
    background-clip: content-box;
}

.aipcb-share-modal::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.aipcb-share-modal.show {
    opacity: 1;
    transform: scale(1);
}

/* Title - Specific styling for the modal header */
.aipcb-share-modal > p:first-child {
    margin-bottom: 5px;
	color: #333;
    text-align: center;
}

/* Labels - Consistent styling */
.aipcb-share-modal label {
    display: block;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

/* Inputs, Textarea, Selects - Unified with focus states and padding */
.aipcb-share-modal input[type="text"],
.aipcb-share-modal input[type="email"],
.aipcb-share-modal textarea,
.aipcb-share-modal select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.aipcb-share-modal input[type="text"]:focus,
.aipcb-share-modal input[type="email"]:focus,
.aipcb-share-modal textarea:focus,
.aipcb-share-modal select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

/* Email Modal Specific Styling */
.aipcb-email-modal {
    max-width: 450px !important;
}

.aipcb-email-modal-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin-bottom: 20px !important;
    text-align: center !important;
}

.aipcb-email-input {
    margin-bottom: 15px !important;
}

.aipcb-privacy-notice {
    font-size: 12px !important;
    color: #666 !important;
    text-align: center !important;
    margin: 15px 0 20px 0 !important;
    line-height: 1.5 !important;
}

.aipcb-privacy-notice a {
    color: #007cba !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

.aipcb-privacy-notice a:hover {
    text-decoration: underline !important;
}

.aipcb-modal-buttons {
    display: flex !important;
    gap: 10px !important;
    justify-content: flex-end !important;
    margin-top: 20px !important;
}

.aipcb-modal-buttons .cancel-btn,
.aipcb-modal-buttons .save-btn {
    margin: 0 !important;
    float: none !important;
    flex: 0 0 auto !important;
}

.aipcb-share-modal textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
    font-family: inherit;
}

/* Tip - Enhanced styling */
.aipcb-share-modal .tip {
    background-color: #f8f9fa;
    border-left: 4px solid #7D5860;
    padding: 12px;
    margin: 15px 0;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

.aipcb-share-modal .tip::before {
    content: "💡 ";
    font-size: 16px;
}

/* Use Case and Platform Container - Inline/flex layout */
.aipcb-share-modal .use-case-platform-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.aipcb-share-modal .use-case-platform-container > div {
    flex: 1;
}

.aipcb-share-modal .use-case-platform-container label {
    margin-top: 0;
    margin-bottom: 5px;
}

/* Buttons - Improved with colors, hover, and layout */
.aipcb-share-modal .save-btn,
.aipcb-share-modal .cancel-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 25px;
}

.aipcb-share-modal .save-btn {
    background-color: #7d5860;
    color: white;
    float: right;
}

.aipcb-share-modal .save-btn:hover {
    background-color: #5d4248;
}

.aipcb-share-modal .cancel-btn {
    background-color: #7d5860;
    color: white;
    margin-right: 10px;
}

.aipcb-share-modal .cancel-btn:hover {
    background-color: #5d4248;
}

/* Clear floats for buttons */
.aipcb-share-modal::after {
    content: "";
    display: table;
    clear: both;
}

/* Links - Retained from existing */
.aipcb-share-modal a {
    color: blue;
    text-decoration: underline;
}

/* Responsive - Mobile adjustments */
@media (max-width: 600px) {
    .aipcb-share-modal {
        padding: 20px;
        width: 95%;
    }
    
    .aipcb-share-modal .use-case-platform-container {
        flex-direction: column;
        gap: 0;
    }
    
    .aipcb-share-modal .save-btn,
    .aipcb-share-modal .cancel-btn {
        width: 100%;
        margin-top: 10px;
        float: none;
    }
    
    .aipcb-share-modal .cancel-btn {
        margin-right: 0;
        order: 1;
    }
    
    .aipcb-share-modal .save-btn {
        order: 2;
    }
}

/* SEO Label - Enhanced */
.aipcb-share-modal label[for="description"] {
    color: #7d5860;
    font-size: 15px;
}

.aipcb-share-modal label[for="description"]::after {
    content: " [SEO!] ⭐";
    font-size: 12px;
    color: #f39c12;
}

/* Image Modal - Retained as-is */
/* Image Modal - Fixed z-index hierarchy */
#aipcb-image-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#aipcb-image-modal-overlay.show {
    opacity: 1;
    display: block;
}

#aipcb-image-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: white;
    z-index: 10002;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    border-radius: 10px;
}

#aipcb-image-modal.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    display: block !important;
}

.aipcb-image-modal-content {
    position: relative;
    text-align: center;
    width: 100%;
    height: 100%;
}

#aipcb-modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
	border-radius: 10px;
    border: 1px #000;
    PADDING: 20px;
}

.aipcb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 2px solid white !important;
    padding: 10px;
    cursor: pointer;
    font-size: 24px;
    display: none;
    transition: opacity 0.3s ease;
}

#aipcb-prev-image {
    left: 10px;
}

#aipcb-next-image {
    right: 10px;
}

#aipcb-close-image-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#aipcb-image-modal:hover #aipcb-close-image-modal {
    opacity: 1;
}

#aipcb-component-modal .aipcb-quantity {
    width: 50px;
    border: 1px solid #c1949c;
    border-radius: 4px;
    padding: 4px;
    text-align: center;
}

#aipcb-components-table {
	border-collapse: separate; /* Needed for reliable sticky headers */
	border-spacing: 0;
	margin-bottom: 20px !important;
	table-layout: fixed;
	width: 100%;
	min-width: 900px; /* Force horizontal scroll on narrow/mobile view */
	background-color: #ffffff;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	font-size: 14px;
}

#aipcb-components-table th,
#aipcb-components-table td {
    border: none;
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
}

#aipcb-components-table th {
    background-color: #7D5860;
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
}

#aipcb-components-table th:hover {
    background-color: #C1949C;
}

#aipcb-components-table tbody tr:nth-child(even) {
    background-color: #fceaff;
}

#aipcb-components-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

#aipcb-components-table img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    padding: 4px;
}

#aipcb-components-table .aipcb-product-name {
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.4;
}

#aipcb-components-table td {
    color: #495057;
}

#aipcb-components-table td:first-child {
    font-weight: 600;
    color: #7D5860;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.modal-header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 11;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
	height: 100%;
    border-radius: 12px 12px 0 0;
}

.modal-header-2 {
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 11;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
	margin-bottom: 15px;
}

.modal-footer {
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 11;
    padding-top: 10px;
	padding-bottom: 10px;
    border-top: 1px solid #ddd;
	height: 80px; /* Desktop height */
    border-radius: 0 0 12px 12px;
}

.aipcb-custom-tooltip {
    position: fixed;
    background-color: #7D5860;
    color: white;
    padding: 5px;
    border-radius: 3px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1001;
    display: none;
}

.modal-header {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    padding: 10px;
}

.aipcb-filters {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
	flex-direction: row;
    flex-wrap: nowrap;
}

@media (max-width: 768px) {
    .aipcb-filters {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
    }
    .aipcb-filters > * {
        flex-shrink: 0; /* Prevent children from shrinking */
    }
}

.aipcb-guide-tooltip {
    position: absolute;
    background-color: #7D5860;
    color: white;
    padding: 5px;
    border-radius: 3px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1001;
    display: none;
}

.aipcb-guide-tooltip.blinking {
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.aipcb-social-share {
    margin-top: 0px;
    padding-top: 10px !important;
}

.aipcb-share-btn {
    display: inline-block;
    margin-right: 10px;
    font-size: 24px;
    transition: color 0.3s;
}

#aipcb-builder h3 {
    margin: 20px 0 10px;
    font-size: 1.5em;
    color: #333;
    text-align: left;
}

.aipcb-share-divider {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 0 auto 0px;
    width: 100%;
}

.aipcb-share-btn.facebook {
    color: #3b5998;
}
.aipcb-share-btn.x {
    color: #1da1f2;
}
.aipcb-share-btn.reddit {
    color: #ff4500;
}
.aipcb-share-btn.whatsapp {
    color: #25d366;
}
.aipcb-share-btn.tiktok {
    color: #000000;
}
.aipcb-share-btn.gametree {
    color: #00cc00;
}
.aipcb-share-btn.discord {
    color: #7289da;
}

.aipcb-share-btn:hover {
    opacity: 0.8;
}

#aipcb-add-component.pulsate {
    animation: pulsate 1.5s infinite ease-in-out;
}

@keyframes pulsate {
    0% {
        box-shadow: 0 0 5px #7D5860, 0 0 10px #7D5860;
    }
    50% {
        box-shadow: 0 0 15px #7D5860, 0 0 30px #7D5860;
    }
    100% {
        box-shadow: 0 0 5px #7D5860, 0 0 10px #7D5860;
    }
}

.added-to-build {
    background-color: #00B029;
    color: white;
}

@media only screen and (max-width: 768px) {
    #aipcb-image-modal {
        width: 100vw;
        max-width: 100vw;
    }
    .aipcb-table-container {
        width: 100%;
        margin-bottom: 30px;
        position: relative;
        overflow-x: auto;
        overflow-y: hidden;
    }

    /* Custom scrollbar styling for webkit browsers */
    .aipcb-table-container::-webkit-scrollbar {
        height: 8px;
        background-color: #f1f1f1;
        border-radius: 4px;
    }

    .aipcb-table-container::-webkit-scrollbar-track {
        background-color: #f1f1f1;
        border-radius: 4px;
    }

    .aipcb-table-container::-webkit-scrollbar-thumb {
        background-color: #7D5860;
        border-radius: 4px;
        border: 1px solid #f1f1f1;
    }

    .aipcb-table-container::-webkit-scrollbar-thumb:hover {
        background-color: #C1949C;
    }

    /* Add visual scroll indicators */
    .aipcb-table-container {
        position: relative;
    }

    .aipcb-table-container::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 20px;
        height: 100%;
        background: linear-gradient(to left, rgba(255,255,255,0.8), transparent);
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .aipcb-table-container.scroll-active::after {
        opacity: 1;
    }

    /* Component selection modal mobile styling */
    #aipcb-search,
    #aipcb-component-type {
        width: 100% !important;
        margin-bottom: 10px;
        max-width: none;
    }

    /* Adjust modal header layout for mobile */
    .modal-header-2 {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        padding-bottom: 15px;
		margin-bottom: 15px;
    }

    .aipcb-modal-header-search {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .aipcb-modal-header-search select,
    .aipcb-modal-header-search input {
        width: 100%;
        max-width: none;
    }

    .aipcb-budget-widget {
        margin-left: 0;
        margin-top: 0;
        align-self: stretch;
        min-width: auto;
    }
}

.aipcb-pcie-warning {
    color: #ffcc00;
    cursor: help;
    margin-left: 5px;
    font-size: 1.2em;
}

.aipcb-custom-tooltip.flashing {
    animation: flash 1s infinite;
}

@keyframes flash {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.aipcb-builds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.aipcb-build-item {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

.aipcb-build-item h3 {
    margin: 0 0 10px;
}

.aipcb-build-item a {
    color: #7D5860;
    text-decoration: none;
}

.aipcb-build-item a:hover {
    text-decoration: underline;
}

.aipcb-button {
    background-color: #7D5860 !important;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.aipcb-button:hover {
    background-color: #C1949C !important;
	color: white;
}

/* VIEW BUILD button on completed builds page */
.aipcb-view-build {
    background-color: #7D5860 !important;
    color: white !important;
    border: none;
    padding: 3px 20px !important;
    margin: 5px;
    cursor: pointer;
    text-decoration: none !important;
    display: inline-block;
    text-align: center;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.aipcb-view-build:hover {
    background-color: #C1949C !important;
}

#aipcb-total-price {
    font-weight: 600;
	text-align: center;
	font-size: 18px;
}

#aipcb-builder h1 {
    margin-bottom: 30px !important;
}

#aipcb-build-table td:nth-child(3),
#aipcb-build-table td:nth-child(5) {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#aipcb-components-table td:nth-child(5),
#aipcb-components-table td:nth-child(7) {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.aipcb-build-actions {
    margin-top: 10px;
    margin-left: 15px;
}

#aipcb-public-builds {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5px;
    width: 100%;
    box-sizing: border-box;
}

.aipcb-public-builds-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

.aipcb-build-card-outer {
    width: 100%;
}

@media (max-width: 768px) {
    .aipcb-public-builds-grid {
        grid-template-columns: 1fr;
    }
}

.aipcb-build-card {
    background-color: #fff;
    border: 1px solid rgb(221, 221, 221);
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    width: 300px;
    box-sizing: border-box;
    margin: 0 auto;
    display: block;
    position: relative;
}

.aipcb-build-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.aipcb-build-title-single-page {
    font-size: 2em !important;
    color: #ffffff !important;
    display: block !important;
    line-height: 1;
    flex: 1;
    margin: 0;
}

.aipcb-build-nickname {
    font-size: 0.5em;
    color: #ffffff;
    font-weight: 400;
}

.aipcb-by {
    font-style: italic;
    font-size: 0.5em;
    font-weight: 300;
    color: #e8ecf1 !important;
}

.aipcb-nickname {
    font-weight: bold;
    color: #7D5860;
}

/* Responsive design */
@media (max-width: 768px) {
    .aipcb-build-header {
        flex-direction: column;
    }
    
    .aipcb-build-details {
        align-items: flex-start;
        width: 100%;
    }
    
    .aipcb-build-title-single-page {
        font-size: 1.5em !important;
    }
}

.aipcb-build-thumbnail {
	width: 50%;
    border-radius: 5px !important;
    margin-bottom: 15px !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

.aipcb-build-thumbnail img {
	width: 100%;
	height: auto !important;
	max-height: 200px !important;
	object-fit: contain;
	border-radius: 5px;
}

.aipcb-component-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.aipcb-component-list li {
    padding: 5px 0;
    border-bottom: 1px solid #c7c7c7;
    font-size: 0.9em;
}

@media (max-width: 600px) {
    .aipcb-public-builds-grid {
        grid-template-columns: 1fr;
    }
}

.aipcb-guide-message {
    background-color: #7D5860;
    color: #FFFFFF;
    border-radius: 8px;
    border-left: 4px solid #7D5860;
    padding: 15px;
    margin: 10px auto;
    max-width: 90%;
    text-align: center;
    font-size: 1em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
	line-height: 23px;
}

.aipcb-build-title {
    font-size: 1em !important;
    font-weight: bold;
    margin: 0 0 5px;
	text-align: center;
    color: #7D5860 !important;
}

.aipcb-component-list-container {
    margin: 15px 0;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgb(221, 221, 221);
    border-radius: 6px;
}

.aipcb-component-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aipcb-component-item {
    display: flex;
 //* padding: 6px 10px; *//
//* border-bottom: 1px solid #f5f5f5; *//
    transition: background-color 0.2s;
    position: relative;
    align-items: center;
}

.aipcb-component-item.has-image {
    padding-left: 0x; /* Remove extra padding since thumbnail is now first */
}

.aipcb-component-image {
    width: 48px;
    height: 48px;
    margin-right: 10px; /* Space between thumbnail and details */
    margin-left: 10px;
	flex-shrink: 0;
}

.aipcb-component-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.aipcb-component-details {
    flex: 1;
    min-width: 0;
}

.aipcb-component-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.aipcb-component-type {
    font-size: 0.8em;
    font-weight: 600;
    color: #7D5860;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f0e6e8;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    line-height: 1.3;
}

.aipcb-component-name {
    font-weight: 500;
    color: #333;
//* margin: 4px 0;  *//
    font-size: 16px;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
}

.aipcb-component-spec {
    color: #666;
    font-size: 0.8em;
    margin: 3px 0;
    line-height: 1.4;
    opacity: 0.9;
}

.aipcb-component-price {
    font-weight: 700;
    font-size: 0.7em;
    white-space: nowrap;
    margin-left: 10px;
}

.aipcb-component-quantity {
    display: inline-block;
    font-size: 0.8em;
    color: #666;
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 3px;
    margin-top: 4px;
}

@media only screen and (max-width: 768px) {
    .aipcb-component-item {
        flex-wrap: wrap;
        padding: 10px;
    }

    .aipcb-component-image {
        margin-right: 10px;
    }

    .aipcb-component-details {
        flex-basis: 100%;
    }
}

.aipcb-no-components {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.aipcb-build-price {
    font-size: 1em;
    font-weight: bold;
    color: #7D5860;
    margin-bottom: 15px !important;
    margin-top: 10px !important;
    text-align: center;
}

.aipcb-build-metadata {
    display: flex;
    gap: 5px;
    margin: 8px 0;
    font-size: 0.9em;
    color: #666;
	justify-content: center;
}

.aipcb-build-use-case,
.aipcb-build-platform {
    font-weight: 500;
}

.aipcb-build-use-case {
    color: #7D5860;
}

.aipcb-build-platform {
    color: #5B7FA6;
}

.aipcb-pagination {
    text-align: center;
    margin-top: 20px;
}

.aipcb-pagination a {
    color: #7D5860;
    padding: 5px 10px;
    text-decoration: none;
    border: 1.5px solid #7D5860;
    margin: 0 4px;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
    line-height: 25px;
}

.aipcb-pagination a:hover {
    background-color: #7D5860;
    color: white;
}

/* reCAPTCHA Modal Styles */
.aipcb-recaptcha-modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: white !important;
    padding: 20px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    z-index: 999999 !important;
    display: none;
    min-width: 320px !important;
    max-width: 90vw !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.aipcb-recaptcha-modal.show {
    display: block !important;
    opacity: 1 !important;
}

.aipcb-recaptcha-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 999998 !important;
    display: none !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.aipcb-recaptcha-overlay.show {
    display: block !important;
    opacity: 1 !important;
}

.aipcb-recaptcha-content {
    text-align: center !important;
    position: relative !important;
}

.aipcb-recaptcha-content h3 {
    margin: 0 0 20px 0 !important;
    color: #7D5860 !important;
    font-size: 18px !important;
}

.aipcb-close-btn {
    position: absolute !important;
    top: -10px !important;
    right: -10px !important;
    background: #7D5860 !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 30px !important;
    height: 30px !important;
    font-size: 18px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.2s !important;
    z-index: 999999 !important;
}

.aipcb-close-btn:hover {
    background: #C1949C !important;
}

/* Ensure reCAPTCHA widget container is visible */
#aipcb-recaptcha,
#aipcb-recaptcha-container {
    margin: 20px 0 !important;
    display: block !important;
}

/* Force visibility override */
body .aipcb-recaptcha-modal.show,
html .aipcb-recaptcha-modal.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

body .aipcb-recaptcha-overlay.show,
html .aipcb-recaptcha-overlay.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#aipcb-build-search {
    width: 100%;
    padding: 10px;
    margin-bottom: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

#aipcb-build-search:focus {
    border-color: #7D5860;
    outline: none;
    box-shadow: 0 0 5px rgba(204, 0, 0, 0.3);
}

#aipcb-build-search::placeholder {
    color: #999;
}

@media only screen and (max-width: 1024px) {
    .aipcb-public-builds-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media only screen and (max-width: 768px) {
    .aipcb-public-builds-grid {
        grid-template-columns: 1fr;
    }

    #aipcb-build-search {
        max-width: 85vw !important;
        width: 80vw !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        box-sizing: border-box !important;
    }

    #aipcb-builder {
        padding: 0 10px;
    }

    .aipcb-build-card {
        padding: 10px;
    }

    .aipcb-component-type {
        flex: 0 0 40%;
    }

    .aipcb-component-price {
        flex: 0 0 25%;
    }
}

@media only screen and (max-width: 480px) {
    .aipcb-build-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .aipcb-button {
        width: 100%;
        text-align: center;
    }

    .aipcb-share-modal {
        width: 90%;
    }

    /* Component selection modal mobile styling for smaller screens */
    #aipcb-search,
    #aipcb-component-type {
        width: 100% !important;
        margin-bottom: 10px;
        max-width: none;
    }

    .modal-header-2 {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        padding: 10px 12px;
		margin-bottom: 15px;
    }

    .aipcb-modal-header-search {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .aipcb-modal-header-search select,
    .aipcb-modal-header-search input {
        width: 100%;
        max-width: none;
    }

    .aipcb-budget-widget {
        margin-left: 0;
        margin-top: 0;
        min-width: auto;
    }

    /* Tablet breakpoint for modal header */
    @media only screen and (max-width: 1024px) and (min-width: 769px) {
        .modal-header-2 {
            padding-bottom: 12px;
            gap: 12px;
        }

        .aipcb-modal-header-search {
            gap: 10px;
        }

        .aipcb-modal-header-search select,
        .aipcb-modal-header-search input {
            min-height: 38px;
            font-size: 13px;
        }

        .aipcb-budget-widget {
            min-width: 110px;
            padding: 10px 14px;
        }

        .aipcb-remaining-budget {
            font-size: 15px;
        }

        .aipcb-budget-status {
            font-size: 10px;
        }
    }
}

.aipcb-build-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 25px;
    background: #7D5860;
    border-radius: 8px;
    gap: 20px;
}

.aipcb-build-components {
	margin-top: 0px !Important;
}

.aipcb-comment-link {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s ease;
	margin-top: 5px;
	margin-left: auto;
    margin-right: auto;
}

.aipcb-comment-link a:hover {
    color: #2271b1;
    text-decoration: underline;
}

#aipcb-comments-section {
    margin-top: 40px;
}

#aipcb-image-modal.single-image .aipcb-arrow {
    display: none !important;
}

.animate-attention {
    animation: pulsate 0.5s infinite;
}

.aipcb-modal-budget-alert {
    margin-bottom: 10px;
    padding: 5px;
    font-weight: normal;
    font-size: 1em;
    text-align: center;
    line-height: 20px;
}

.aipcb-modal-budget-alert.exceeded {
    background-color: #ffcccc;
    color: #000;
    animation: flash 1s infinite;
    border-radius: 12px;
}


/* Ensure tooltips are styled consistently */
.aipcb-help-icon[data-tooltip]:hover:after {
    content: attr(data-tooltip);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #333;
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    white-space: pre;
    z-index: 10000;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.5;
    max-width: auto;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Styles for benchmark guide page */
.aipcb-benchmark-guide {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.aipcb-section {
    margin-bottom: 40px;
}

.aipcb-section h2 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #333;
}

.aipcb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.aipcb-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.aipcb-card h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #0073aa;
}

.aipcb-table-wrapper {
    overflow-x: auto;
}

.aipcb-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.aipcb-table th,
.aipcb-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.aipcb-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.aipcb-table tr:last-child td {
    border-bottom: none;
}

.aipcb-chart-wrapper {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.aipcb-chart-canvas {
    max-height: 300px;
}

.aipcb-faq > div {
    margin-bottom: 20px;
}

.aipcb-faq h3 {
    font-size: 1.1em;
    margin-bottom: 8px;
    color: #333;
}

.aipcb-list {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 20px;
}

.aipcb-list li {
    margin-bottom: 8px;
}

.aipcb-cta {
    text-align: center;
}

.aipcb-button {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 3px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 400;
}

.aipcb-button:hover {
    background: #005b82;
}

.aipcb-note {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
}

.aipcb-help-link {
    text-align: right;
	margin-top: 12px;
	font-size: 15px;
}

.aipcb-budget-widget {
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(125, 88, 96, 0.95);
    transition: all 0.2s ease;
    min-width: 120px;
    flex-shrink: 0;
	margin-top: -10px;
}

.aipcb-budget-widget:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(125, 88, 96, 0.2);
}

.aipcb-budget-display {
    text-align: center;
    color: white;
}

.aipcb-remaining-budget {
    font-size: 16px;
    font-weight: 600;
    display: block;
    line-height: 1.2;
}

.aipcb-budget-status {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 2px;
    display: block;
    color: #7D5860;
}
	
#aipcb-recaptcha-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    z-index: 1001;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

#aipcb-recaptcha-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#aipcb-recaptcha-modal.show {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

#aipcb-recaptcha-overlay.show {
    display: block;
    opacity: 1;
}

.aipcb-components-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.aipcb-components-table th,
.aipcb-components-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.aipcb-components-table th {
    background: #f8f8f8;
    font-weight: 600;
}

.aipcb-components-table tr:hover {
    background: #f9f9f9;
}

.aipcb-components-table .component {
    width: 150px;
}

.aipcb-components-table .image {
    width: 80px;
}

.aipcb-components-table .product {
    width: 250px;
}

.aipcb-components-table .quantity {
    width: 80px;
}

.aipcb-components-table .price {
    width: 100px;
}

.aipcb-components-table .link {
    width: 120px;
}

.aipcb-component-type {
    font-weight: bold;
}

.aipcb-component-image img {
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
    border-radius: 4px;
    background: #f5f5f5;
}

.aipcb-build-date {
    font-size: 0.45em;
    color: #FFFFFF;
    font-weight: 300;
	text-align: center;
}

/* Build Meta Container */
.aipcb-build-meta {
    text-align: center;
    margin-bottom: 25px;
    padding-right: 10px;
}

.aipcb-comment-link a {
    color: #7D5860;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s ease;
}

.aipcb-comment-link a:hover {
    color: #4a6685;
    text-decoration: underline;
}

#aipcb-clear-components {
	font-weight: normal;
}

.aipcb-custom-tooltip {
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    z-index: 1000;
    max-width: 300px;
    word-wrap: break-word;
    display: none;
    font-size: 12px;
    line-height: 1.4;
}

#aipcb-key-specs-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: 80000 !important;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#aipcb-key-specs-modal-overlay.show {
    display: block;
    opacity: 1;
}

#aipcb-key-specs-modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.95) !important;
    background: white !important;
    padding: 20px !important;
    z-index: 80001 !important;
    max-width: 80vw;
    max-height: 80vh;
    overflow-y: auto;
    display: none;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out !important;
    min-height: 100px;
}

@media (max-width: 768px) {
    #aipcb-key-specs-modal {
        width: 85vw !important;
        max-width: 85vw !important;
    }
}

#aipcb-key-specs-modal.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) !important;
}

.aipcb-key-specs-modal-content {
    text-align: left;
}

#aipcb-key-specs-content {
    margin-top: 10px;
}

#aipcb-key-specs-modal .aipcb-close-button {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#aipcb-key-specs-modal:hover .aipcb-close-button {
    opacity: 1;
}

/* Guided Tour Styles */

/* Overlay for the entire page during tour */
#aipcb-tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000; /* Below highlight and tooltip */
    display: none;
    pointer-events: none; /* Allow clicks through to highlighted elements if needed */
}

/* Highlight for the current waypoint */
.aipcb-tour-highlight {
    position: relative;
    z-index: 10020; /* Above overlay, below tooltip */
    border-radius: 4px;
    pointer-events: auto; /* Allow interaction with highlighted element */
}

/* Tooltip for tour steps (Material Design inspired) */
.aipcb-tour-tooltip {
    position: absolute;
    background-color: #7D5860; /* Main color */
    color: #FFF; /* Secondary color for text */
    border: 2px solid #fff; /* White outline */
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); /* Material shadow */
    z-index: 10050 !Important; /* Above highlight and overlay */
    max-width: 300px;
    font-family: 'Roboto', sans-serif; /* Material font */
    display: none;
}

.aipcb-tour-tooltip::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
}

.aipcb-tour-tooltip.top::after {
    bottom: -20px;
    left: 50%;
    border-top-color: #7D5860;
    margin-left: -10px;
}

.aipcb-tour-tooltip.bottom::after {
    top: -20px;
    left: 50%;
    border-bottom-color: #7D5860;
    margin-left: -10px;
}

.aipcb-tour-tooltip.left::after {
    right: -20px;
    top: 50%;
    border-left-color: #7D5860;
    margin-top: -10px;
}

.aipcb-tour-tooltip.right::after {
    left: -20px;
    top: 50%;
    border-right-color: #7D5860;
    margin-top: -10px;
}

@media (max-width: 768px) {
    .aipcb-tour-tooltip {
        max-width: 90vw; /* Use 90% of viewport width to prevent overflow */
        padding: 12px; /* Slightly reduce padding for compactness */
        font-size: 14px; /* Smaller font for better fit */
    }
    
    .aipcb-tour-button {
        padding: 6px 12px; /* Adjust button size for mobile */
        font-size: 13px;
    }
}

/* Buttons in tooltip (Material Design buttons) */
.aipcb-tour-button {
    background-color: #C1949C; /* Secondary color */
    color: #fff;
    padding: 8px 16px;
    margin: 4px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-transform: uppercase;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); /* Material shadow */
}

.aipcb-tour-button:hover {
    background-color: #a77b82; /* Darken secondary color on hover */
}

.aipcb-tour-skip {
    background-color: transparent;
    color: #C1949C; /* Match text color */
    text-decoration: underline;
    box-shadow: none;
}

/* Tour Widget Styles */
#aipcb-tour-widget {
    position: fixed;
    right: 20px;
    top: 40%;
    transform: translateY(-50%);
    background-color: #7D5860; /* Main color */
    color: #fff;
    padding: 10px;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26); /* Material shadow */
    z-index: 10060; /* Above everything */
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#aipcb-tour-widget:hover {
    background-color: #C1949C; /* Secondary color on hover */
    width: 65px;
	height: 65px; /* Expand slightly on hover */
}

#aipcb-tour-widget i {
    font-size: 24px;
}

.aipcb-decrease {
    background-color: #7D5860 !important;
    color: white;
    border: none;
    padding: 4px 10px !important;
    margin-right: 5px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 4px;
}

.aipcb-increase {
    background-color: #7D5860 !important;
    color: white;
    border: none;
    padding: 4px 8px !important;
    margin-right: 5px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 4px;
}


.aipcb-decrease:hover, .aipcb-increase:hover {
    background-color: #5C3F46 !important; /* Slightly darker shade for hover effect */
}

.aipcb-build-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.aipcb-modal-header-search {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.aipcb-modal-header-search select,
.aipcb-modal-header-search input {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
    transition: all 0.2s ease;
    min-height: 40px;
}

.aipcb-modal-header-search select:focus,
.aipcb-modal-header-search input:focus {
    outline: none;
    border-color: #7D5860;
    box-shadow: 0 0 0 3px rgba(125, 88, 96, 0.1);
}

.aipcb-modal-header-search select:hover,
.aipcb-modal-header-search input:hover {
    border-color: #9ca3af;
}

.aipcb-build-meta-tags {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    align-items: center;
}

.aipcb-build-description {
    font-style: italic;
    line-height: 1.6;
    padding: 0;
    background-color: transparent;
    border: none;
    color: #000000;
    font-size: 15px;
}

.aipcb-build-description-wrapper {
    margin-bottom: 5px;
}

.aipcb-build-description-wrapper h3 {
    margin: 0 0 5px 0;
    color: #000000;
    font-size: 18px;
    font-weight: 600;
}

.aipcb-build-use-case,
.aipcb-build-platform {
    background-color: rgb(252 233 255 / 95%);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #495057;
    white-space: nowrap;
}

.aipcb-build-use-case strong,
.aipcb-build-platform strong {
    font-weight: 600;
    color: #333;
}

.aipcb-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.aipcb-filters input[type="text"],
.aipcb-filters select,
.aipcb-filters button {
    height: 40px; /* Set uniform height */
    padding: 5px 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.aipcb-filters input[type="text"] {
    flex: 2; /* Wider search bar */
}

.aipcb-filters select {
    flex: 1;
}

/*
.aipcb-filters button {
    background-color: #6c757d;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.aipcb-filters button:hover {
    background-color: #545b62;
}
*/

/* Single Page Modal Overlay */
.aipcb-single-page-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aipcb-single-page-modal-overlay.active {
    opacity: 1;
}

/* Single Page Share Modal */
.aipcb-single-page-share-modal {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
	z-index: 10000 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
    position: relative;
	margin: auto;
}

.aipcb-single-page-share-modal.active {
    transform: scale(1);
    opacity: 1;
}

/* Single Page Modal Header */
.aipcb-single-page-modal-header {
    margin: 0 0 15px 0;
    color: #5B7FA6;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

/* Single Page Modal Description */
.aipcb-single-page-modal-description {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 15px;
    text-align: center;
}

/* Single Page URL Container */
.aipcb-single-page-url-container {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    word-break: break-all;
}

.aipcb-single-page-share-link {
    color: #5B7FA6;
    text-decoration: none;
    font-size: 14px;
    display: block;
    transition: color 0.3s ease;
}

.aipcb-single-page-share-link:hover {
    color: #4a6685;
    text-decoration: underline;
}

/* Single Page Hidden Input */
.aipcb-single-page-hidden-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

/* Single Page Modal Buttons */
.aipcb-single-page-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.aipcb-single-page-copy-btn,
.aipcb-single-page-close-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.aipcb-single-page-copy-btn {
    background: linear-gradient(135deg, #5B7FA6 0%, #7B94B3 100%);
    color: #ffffff;
    flex: 1;
}

.aipcb-single-page-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 127, 166, 0.4);
}

.aipcb-single-page-copy-btn.copied {
    background: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
}

.aipcb-single-page-close-btn {
    background: #e9ecef;
    color: #495057;
    flex: 0.5;
}

.aipcb-single-page-close-btn:hover {
    background: #dee2e6;
    transform: translateY(-2px);
}

/* Share Build Button */
#aipcb-share-build.aipcb-button {
    background: linear-gradient(135deg, #5B7FA6 0%, #7B94B3 100%);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Single Build Share Modal Styles */
#aipcb-share-overlay-999 {
    position: fixed !important;
    top: 0px !important;
    left: 0px !important;
    right: 0px !important;
    bottom: 0px !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: 10003 !important;
    display: table !important;
    margin: 0 !important;
    padding: 0 !important;
}

#aipcb-share-modal-999 {
    display: inline-block !important;
    background: white !important;
    border-radius: 12px !important;
    padding: 30px !important;
    max-width: 600px !important;
    width: 90% !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    text-align: left !important;
    position: relative !important;
    margin: 0 auto !important;
}

/* Mobile Responsive Styles for Single Build Share Modal */
@media (max-width: 768px) {
    #aipcb-share-modal-999 {
        width: 95% !important;
        max-width: 95vw !important;
        padding: 20px !important;
        margin: 10px auto !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }

    #aipcb-share-modal-999 h3 {
        font-size: 20px !important;
        margin-bottom: 10px !important;
    }

    #aipcb-share-modal-999 p {
        font-size: 14px !important;
        margin-bottom: 15px !important;
    }

    #aipcb-share-modal-999 .aipcb-share-buttons {
        flex-direction: column !important;
        gap: 8px !important;
    }

    #aipcb-copy-btn-999,
    #aipcb-close-btn-999 {
        width: 100% !important;
        padding: 10px 16px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 480px) {
    #aipcb-share-modal-999 {
        width: 98% !important;
        max-width: 98vw !important;
        padding: 15px !important;
        margin: 5px auto !important;
    }

    #aipcb-share-modal-999 h3 {
        font-size: 18px !important;
    }

    #aipcb-share-modal-999 p {
        font-size: 13px !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .aipcb-single-page-share-modal {
        width: 95%;
        padding: 20px;
    }
    
    .aipcb-single-page-modal-header {
        font-size: 20px;
    }
    
    .aipcb-single-page-modal-buttons {
        flex-direction: column;
    }
    
    .aipcb-single-page-copy-btn,
    .aipcb-single-page-close-btn {
        flex: 1;
    }
}

/* Build Rating System Styles */
.aipcb-build-rating-widget {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.aipcb-build-rating-widget h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.aipcb-rating-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.aipcb-rating-btn {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 25px;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #666;
}

.aipcb-rating-btn:hover {
    border-color: #007cba;
    background: #f0f8ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.2);
}

.aipcb-rating-btn.voted {
    color: #fff;
    font-weight: 600;
}

.aipcb-upvote-btn.voted {
    background: #f1c40f;
    border-color: #f1c40f;
    color: #fff;
}

.aipcb-downvote-btn.voted {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}

.aipcb-rating-btn i {
    font-size: 16px;
}

.aipcb-upvote-btn i {
    color: #f1c40f;
}

.aipcb-downvote-btn i {
    color: #e74c3c;
}

.aipcb-rating-btn.voted i {
    color: inherit;
}

.aipcb-rating-count {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.aipcb-rating-feedback {
    color: #27ae60;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aipcb-rating-feedback.show {
    opacity: 1;
}

/* Small rating display for build cards */
.aipcb-build-rating-small {
	margin-bottom: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.aipcb-rating-display {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 12px;
    color: #666;
}

.aipcb-upvote-display,
.aipcb-downvote-display {
    display: flex;
    align-items: center;
    gap: 3px;
}

.aipcb-upvote-display i {
    color: #f1c40f;
}

.aipcb-downvote-display i {
    color: #e74c3c;
}

/* Responsive design for rating widgets */
@media (max-width: 768px) {
    .aipcb-rating-buttons {
        gap: 15px;
    }

    .aipcb-rating-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .aipcb-rating-display {
        gap: 10px;
    }
}

/* Animation for vote feedback */
@keyframes ratingFeedback {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    20% {
        opacity: 1;
        transform: translateY(0);
    }
    80% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-5px);
    }
}

.aipcb-rating-feedback.show {
    animation: ratingFeedback 3s ease-in-out;
}

/* Key SPECS buttons styling - Main build table */
#aipcb-build-table button[class*="specs"],
#aipcb-build-table button[class*="key-specs"],
#aipcb-build-table .aipcb-key-specs-btn,
#aipcb-build-table .key-specs-button {
    padding: 6px !important;
    margin: 2px !important;
    border: 1px solid #7D5860 !important;
    border-radius: 4px !important;
    background-color: #7D5860 !important;
    color: white !important;
    font-size: 12px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    min-height: 28px !important;
    box-sizing: border-box !important;
}

#aipcb-build-table button[class*="specs"]:hover,
#aipcb-build-table button[class*="key-specs"]:hover,
#aipcb-build-table .aipcb-key-specs-btn:hover,
#aipcb-build-table .key-specs-button:hover {
    background-color: #C1949C !important;
    border-color: #C1949C !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(125, 88, 96, 0.2) !important;
}

/* Component selection modal table container - consolidated and improved */
#aipcb-component-modal .table-container {
    position: relative;
    padding-bottom: 20px; /* Ensure space so pagination appears above sticky footer */
    border-radius: 8px;
}

/* Key SPECS buttons styling - Component selection modal */
#aipcb-components-table button[class*="specs"],
#aipcb-components-table button[class*="key-specs"],
#aipcb-components-table .aipcb-key-specs-btn,
#aipcb-components-table .key-specs-button {
    padding: 6px !important;
    margin: 2px !important;
    border: 1px solid #7D5860 !important;
    border-radius: 4px !important;
    background-color: #7D5860 !important;
    color: white !important;
    font-size: 12px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    min-height: 28px !important;
    box-sizing: border-box !important;
}

#aipcb-components-table button[class*="specs"]:hover,
#aipcb-components-table button[class*="key-specs"]:hover,
#aipcb-components-table .aipcb-key-specs-btn:hover,
#aipcb-components-table .key-specs-button:hover {
    background-color: #C1949C !important;
    border-color: #C1949C !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(125, 88, 96, 0.2) !important;
}

/* Custom scrollbar for component selection modal table */
#aipcb-component-modal .table-container::-webkit-scrollbar {
    width: 8px !important;
    background-color: #f1f1f1 !important;
    border-radius: 4px !important;
}

#aipcb-component-modal .table-container::-webkit-scrollbar-track {
    background-color: #f1f1f1 !important;
    border-radius: 4px !important;
}

#aipcb-component-modal .table-container::-webkit-scrollbar-thumb {
    background-color: #7D5860 !important;
    border-radius: 4px !important;
    border: 1px solid #f1f1f1 !important;
}

#aipcb-component-modal .table-container::-webkit-scrollbar-thumb:hover {
    background-color: #C1949C !important;
}

/* Single Build Page Styles */
.aipcb-single-build-components {
    margin-top: 0px;
    overflow: visible;
    max-height: none;
    height: auto;
}

.aipcb-single-build-table-wrapper {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    -webkit-overflow-scrolling: touch;
}

#aipcb-single-build-table {
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0 !important;
    table-layout: fixed;
    width: 100%;
    min-width: 900px;
    background-color: #ffffff;
    border-radius: 12px;
}

#aipcb-single-build-table thead th {
    background-color: #7D5860;
    color: white;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
    border: none;
}

#aipcb-single-build-table thead th:first-child {
    border-top-left-radius: 12px;
}

#aipcb-single-build-table thead th:last-child {
    border-top-right-radius: 12px;
}

#aipcb-single-build-table tbody td {
    border: none;
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

#aipcb-single-build-table tbody tr:nth-child(even) {
    background-color: #fceaff;
}

#aipcb-single-build-table tbody tr:hover {
    background-color: #f5f5f5;
}

#aipcb-single-build-table tfoot td {
    background-color: #7D5860;
    color: white;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
    border: none;
}

#aipcb-single-build-table tfoot tr td:first-child {
    border-bottom-left-radius: 12px;
}

#aipcb-single-build-table tfoot tr td:last-child {
    border-bottom-right-radius: 12px;
}

/* Custom horizontal scrollbar for single build table - Desktop (hidden) */
@media (min-width: 901px) {
    .aipcb-single-build-table-wrapper::-webkit-scrollbar {
        display: none;
    }
    
    .aipcb-single-build-table-wrapper {
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }
}

/* Custom horizontal scrollbar for single build table - Mobile (visible) */
@media (max-width: 900px) {
    .aipcb-single-build-table-wrapper::-webkit-scrollbar {
        height: 10px;
        background-color: #f1f1f1;
        border-radius: 0 0 12px 12px;
    }

    .aipcb-single-build-table-wrapper::-webkit-scrollbar-track {
        background-color: #f1f1f1;
        border-radius: 0 0 12px 12px;
    }

    .aipcb-single-build-table-wrapper::-webkit-scrollbar-thumb {
        background-color: #7D5860;
        border-radius: 5px;
        border: 1px solid #f1f1f1;
    }

    .aipcb-single-build-table-wrapper::-webkit-scrollbar-thumb:hover {
        background-color: #C1949C;
    }
}

/* Performance Benchmarks Section */
#aipcb-performance-benchmarks {
    width: 100%;
    box-sizing: border-box;
}

#aipcb-performance-benchmarks h3 {
    margin: 30px 0 15px 0;
    font-size: 24px;
    font-weight: 600;
}

#aipcb-performance-content {
    width: 100%;
    box-sizing: border-box;
}

/* Mobile Responsive for Performance Benchmarks */
@media (max-width: 768px) {
    #aipcb-performance-benchmarks {
        margin: 20px 0 !important;
    }
    
    #aipcb-performance-benchmarks h3 {
        font-size: 20px !important;
        margin-bottom: 12px !important;
    }
    
    #aipcb-performance-content {
        padding: 20px 15px !important;
        border-radius: 8px !important;
    }
    
    #aipcb-performance-content h4 {
        font-size: 18px !important;
        flex-wrap: wrap !important;
    }
    
    #aipcb-performance-content h5 {
        font-size: 16px !important;
        margin: 15px 0 10px 0 !important;
    }
    
    /* Make grids single column on mobile */
    #aipcb-performance-content div[style*="grid-template-columns"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    #aipcb-performance-content > div > div {
        min-width: 100% !important;
    }
}

@media (max-width: 480px) {
    #aipcb-performance-benchmarks h3 {
        font-size: 18px !important;
    }
    
    #aipcb-performance-content {
        padding: 15px 12px !important;
    }
    
    #aipcb-performance-content h4 {
        font-size: 16px !important;
    }
    
    #aipcb-performance-content h5 {
        font-size: 15px !important;
    }
}


/* ============================================================== */
/* Budget Finetuning panel                                        */
/* ============================================================== */

#aipcb-finetuning-container {
    /* Span the full builder width on desktop. Inside #aipcb-budget-section
       which is flex-direction: row from 768px+, this forces the panel to
       wrap to its own line and stretch to the full row width — matching
       the build table that sits below it. */
    flex: 1 1 100%;
    width: 100%;
    margin-top: 12px;
    border: 1px solid #e6dada;
    border-radius: 0;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.aipcb-finetuning-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    background: #7D5860;
    border: 0;
    cursor: pointer;
    text-align: left;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    gap: 10px;
    transition: background 0.2s ease;
}
.aipcb-finetuning-toggle:hover { background: #6a484f; }
.aipcb-finetuning-toggle:focus { outline: 2px solid #ffffff44; outline-offset: -4px; }
.aipcb-finetuning-toggle .aipcb-ft-icon {
    /* Force text-style (non-emoji) rendering of the gear glyph so it
       inherits the parent color (#ffffff) instead of the OS emoji palette. */
    font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols",
                 "DejaVu Sans", "Lucida Sans Unicode", sans-serif;
    color: #ffffff;
    font-size: 18px;
    line-height: 1;
}
.aipcb-finetuning-toggle .aipcb-ft-title { color: #ffffff; }
.aipcb-finetuning-toggle .aipcb-ft-hint {
    font-size: 12px;
    color: #f0e0e2;
    font-weight: 400;
    margin-left: 4px;
}
.aipcb-finetuning-toggle .aipcb-ft-chevron {
    margin-left: auto;
    transition: transform 0.25s ease;
    color: #ffffff;
    font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols",
                 "DejaVu Sans", "Lucida Sans Unicode", sans-serif;
}
.aipcb-finetuning-toggle.open .aipcb-ft-chevron { transform: rotate(180deg); }

.aipcb-ft-body {
    padding: 16px;
    border-top: 1px solid #efe5e5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
    gap: 18px;
}

/* Presets bar spans full width */
.aipcb-ft-presets {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px dashed #efe5e5;
}
/* Force these styles so theme/admin button defaults can't repaint our chips */
.aipcb-ft-presets .aipcb-ft-preset,
.aipcb-ft-presets .aipcb-ft-reset,
.aipcb-ft-presets .aipcb-ft-save,
.aipcb-ft-presets .aipcb-ft-load {
    background: #ffffff !important;
    color: #5a484c !important;
    border: 1px solid #e6dada !important;
    padding: 5px 9px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    transition: all 0.15s ease;
    box-shadow: none;
    text-shadow: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1.2;
    white-space: nowrap;
}
/* Default icon color matches the theme primary; flips to white on hover */
.aipcb-ft-presets .aipcb-ft-preset .aipcb-ft-presetico,
.aipcb-ft-presets .aipcb-ft-reset .aipcb-ft-presetico,
.aipcb-ft-presets .aipcb-ft-save .aipcb-ft-presetico,
.aipcb-ft-presets .aipcb-ft-load .aipcb-ft-presetico {
    color: #7D5860;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s ease;
}
.aipcb-ft-presets .aipcb-ft-preset:hover,
.aipcb-ft-presets .aipcb-ft-reset:hover,
.aipcb-ft-presets .aipcb-ft-save:hover,
.aipcb-ft-presets .aipcb-ft-load:not(:disabled):hover {
    background: #7D5860 !important;
    color: #ffffff !important;
    border-color: #7D5860 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(125, 88, 96, 0.12);
}
.aipcb-ft-presets .aipcb-ft-preset:hover .aipcb-ft-presetico,
.aipcb-ft-presets .aipcb-ft-reset:hover .aipcb-ft-presetico,
.aipcb-ft-presets .aipcb-ft-save:hover .aipcb-ft-presetico,
.aipcb-ft-presets .aipcb-ft-load:not(:disabled):hover .aipcb-ft-presetico {
    color: #ffffff;
}
.aipcb-ft-presets .aipcb-ft-preset.active {
    background: #7D5860 !important;
    color: #ffffff !important;
    border-color: #7D5860 !important;
}
.aipcb-ft-presets .aipcb-ft-preset.active .aipcb-ft-presetico {
    color: #ffffff;
}
.aipcb-ft-presets .aipcb-ft-reset {
    /* Sits inline at the end of the row instead of being pushed to its own line. */
}
.aipcb-ft-presets .aipcb-ft-reset .aipcb-ft-presetico {
    color: #888;
}
.aipcb-ft-presets .aipcb-ft-reset:hover .aipcb-ft-presetico {
    color: #ffffff;
}
/* Disabled Load (no saved snapshot for current use case) reads as muted */
.aipcb-ft-presets .aipcb-ft-load:disabled,
.aipcb-ft-presets .aipcb-ft-load[aria-disabled="true"] {
    color: #b3a8aa !important;
    border-color: #efe5e5 !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.aipcb-ft-presets .aipcb-ft-load:disabled .aipcb-ft-presetico,
.aipcb-ft-presets .aipcb-ft-load[aria-disabled="true"] .aipcb-ft-presetico {
    color: #c4b3b6;
}
/* Brief feedback flash when Save/Load is triggered */
.aipcb-ft-presets .aipcb-ft-flash {
    background: #1f6649 !important;
    color: #ffffff !important;
    border-color: #1f6649 !important;
}
.aipcb-ft-presets .aipcb-ft-flash .aipcb-ft-presetico {
    color: #ffffff;
}

/* Force text-style rendering of any inline gear/symbol icon inside chips so
   it inherits the parent color rather than rendering as a colored emoji. */
.aipcb-ft-preset-icon,
.aipcb-ft-chip .aipcb-ft-text-icon {
    font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols",
                 "DejaVu Sans", "Lucida Sans Unicode", sans-serif;
}

/* Dial column (left) */
.aipcb-ft-dials {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.aipcb-ft-dial {
    background: #fff;
    border: 1px solid #efe5e5;
    border-radius: 8px;
    padding: 12px 14px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.aipcb-ft-dial:hover {
    border-color: #d4bfc3;
    box-shadow: 0 2px 8px rgba(125, 88, 96, 0.08);
}
.aipcb-ft-dial-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.aipcb-ft-edited-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #7D5860;
    background: #f4e7ea;
    border: 1px solid #d8b8bf;
    border-radius: 10px;
    padding: 2px 6px;
}
.aipcb-ft-dial.aipcb-ft-dial-user-edited {
    border-color: #d8b8bf;
    box-shadow: 0 1px 5px rgba(125, 88, 96, 0.12);
}
.aipcb-ft-dial.aipcb-ft-dial-user-edited .aipcb-ft-dial-name::after {
    content: ' *';
    color: #7D5860;
    font-weight: 700;
}
.aipcb-ft-dial-name {
    font-weight: 600;
    color: #4a3a3d;
    font-size: 14px;
    flex: 0 0 auto;
    min-width: 90px;
}
.aipcb-ft-lock {
    background: transparent !important;
    border: 0 !important;
    cursor: pointer;
    padding: 4px !important;
    border-radius: 4px !important;
    transition: background 0.15s ease, color 0.15s ease;
    color: #7D5860 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: none;
    text-shadow: none;
}
.aipcb-ft-lock:hover {
    background: #7D5860 !important;
    color: #ffffff !important;
}
.aipcb-ft-lock.locked { color: #7D5860 !important; }
.aipcb-ft-lock.locked:hover { color: #ffffff !important; }

/* Turbo toggle — lifts the dial's normal cap so users can push past it for
   shortage-priced parts. Inactive: outline-style like the lock. Active:
   filled with the secondary palette color (#C1949C) and the dial card
   gets a left-edge accent so a turbo'd dial pops in the grid. */
.aipcb-ft-turbo {
    background: transparent !important;
    border: 0 !important;
    cursor: pointer;
    padding: 4px !important;
    border-radius: 4px !important;
    transition: background 0.15s ease, color 0.15s ease;
    color: #7D5860 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: none;
    text-shadow: none;
}
.aipcb-ft-turbo:hover {
    background: #7D5860 !important;
    color: #ffffff !important;
}
.aipcb-ft-turbo.on {
    background: #C1949C !important;
    color: #ffffff !important;
}
.aipcb-ft-turbo.on:hover {
    background: #ad7e87 !important;
    color: #ffffff !important;
}

/* When Turbo is engaged on a dial, accent the whole row so the user knows
   the cap rules have changed for it. */
.aipcb-ft-dial.turbo {
    border-left: 3px solid #C1949C;
    box-shadow: 0 1px 6px rgba(193, 148, 156, 0.25);
}
.aipcb-ft-dial.turbo .aipcb-ft-dial-name::after {
    content: '⚡';
    margin-left: 6px;
    color: #C1949C;
    font-size: 12px;
    vertical-align: 1px;
}

.aipcb-ft-dial-tier {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 10px;
    background: #f1ebec;
    color: #998a8d;
}
.aipcb-ft-dial-tier[data-tier="entry"]      { background: #f1ebec; color: #6b5b5e; }
.aipcb-ft-dial-tier[data-tier="mid"]        { background: #C1949C; color: #4a2b32; }
.aipcb-ft-dial-tier[data-tier="high"]       { background: #d4ebe2; color: #1f6649; }
.aipcb-ft-dial-tier[data-tier="enthusiast"] {
    background: #7D5860;
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(125, 88, 96, 0.3);
}

.aipcb-ft-dial-body {
    display: grid;
    grid-template-columns: 1fr 130px;
    gap: 12px;
    align-items: center;
}
.aipcb-ft-dial-readout {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
    gap: 4px;
}
.aipcb-ft-dial-money {
    font-weight: 700;
    color: #7D5860;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}
.aipcb-ft-dial-pct {
    font-size: 12px;
    color: #998a8d;
    font-variant-numeric: tabular-nums;
}
.aipcb-ft-dial-money-edit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border-radius: 6px;
}
.aipcb-ft-dial-money-prefix {
    font-size: 12px;
    color: #7D5860;
    font-weight: 700;
}
.aipcb-ft-money-input {
    width: 88px;
    border: 0;
    outline: none;
    background: transparent;
    color: #4a2b32;
    font-size: 12px;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Range slider — solid fill up to the thumb, solid track after */
.aipcb-ft-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 999px;
    /* Hard color stop at --ft-fill: solid #7D5860 before, solid #efe5e5 after.
       No color blending = no gradient appearance. */
    background:
        linear-gradient(to right,
            #7D5860 0%,
            #7D5860 var(--ft-fill, 0%),
            #efe5e5 var(--ft-fill, 0%),
            #efe5e5 100%);
    outline: none;
    cursor: pointer;
}
.aipcb-ft-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #7D5860;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(125, 88, 96, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.aipcb-ft-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.2);
    box-shadow: 0 4px 10px rgba(125, 88, 96, 0.4);
}
.aipcb-ft-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #7D5860;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(125, 88, 96, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.aipcb-ft-slider::-moz-range-thumb:active {
    cursor: grabbing;
    transform: scale(1.2);
}

/* Donut + legend column (right) */
.aipcb-ft-pool {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #efe5e5;
    border-radius: 8px;
}
.aipcb-ft-donut {
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
    aspect-ratio: 1;
    display: block;
}
.aipcb-ft-donut-track {
    fill: none;
    stroke: #f5eded;
    stroke-width: 12;
}
.aipcb-ft-donut-slice {
    transition: stroke-dasharray 0.4s ease, transform 0.4s ease;
}
.aipcb-ft-donut-amount {
    font-size: 12px;
    font-weight: 700;
    fill: #7D5860;
}
.aipcb-ft-donut-label {
    font-size: 4px;
    fill: #998a8d;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.aipcb-ft-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.aipcb-ft-legend-item {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #4a3a3d;
}
.aipcb-ft-legend-item:hover { background: #faf3f4; }
.aipcb-ft-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex: 0 0 auto;
}
.aipcb-ft-legend-label { color: #6b5b5e; }
.aipcb-ft-legend-value {
    font-variant-numeric: tabular-nums;
    color: #7D5860;
    font-weight: 600;
}
.aipcb-ft-legend-other .aipcb-ft-legend-value { color: #998a8d; }

/* Achievements strip */
.aipcb-ft-achievements {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px dashed #efe5e5;
}
.aipcb-ft-chip {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ffffff;
    color: #7D5860;
    border: 1px solid #7D5860;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1.2;
}
.aipcb-ft-chip .aipcb-ft-chip-ico {
    display: inline-flex;
    align-items: center;
    color: inherit;
}
.aipcb-ft-chip.locked {
    color: #998a8d;
    border-color: #e6dada;
    background: #f7eef0;
}
.aipcb-ft-chip.unlocked {
    background: #7D5860;
    color: #ffffff;
    border-color: #7D5860;
    animation: aipcb-ft-pop 0.4s ease;
    box-shadow: 0 1px 4px rgba(125, 88, 96, 0.25);
}
.aipcb-ft-chip:hover {
    background: #7D5860;
    color: #ffffff;
    border-color: #7D5860;
    cursor: default;
}
@keyframes aipcb-ft-pop {
    0%   { transform: scale(0.85); opacity: 0.4; }
    60%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Floor warning banner */
.aipcb-ft-warning {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding: 10px 12px;
    background: #fff5f5;
    border: 1px solid #f5cccc;
    border-left: 4px solid #cc3333;
    border-radius: 6px;
    color: #7a2222;
    font-size: 13px;
}

/* "Tuned by you" badge in the budget alert */
.aipcb-tuned-badge {
    display: inline-block;
    background: #7D5860;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.3px;
}

/* Mobile / narrow viewports — stack columns and shrink donut */
@media (max-width: 720px) {
    .aipcb-ft-body {
        grid-template-columns: 1fr;
    }
    .aipcb-ft-pool {
        order: -1; /* show donut first on mobile */
    }
    .aipcb-ft-donut { max-width: 180px; }
    .aipcb-ft-dial-body {
        grid-template-columns: 1fr 110px;
    }
    .aipcb-ft-dial-name { min-width: 70px; font-size: 13px; }
    .aipcb-ft-presets { gap: 6px; }
    .aipcb-ft-preset, .aipcb-ft-reset {
        padding: 5px 10px;
        font-size: 12px;
    }
    .aipcb-ft-reset { margin-left: 0; }
}


/* ============================================================== */
/* Suggest Build flow harmonization                                */
/* ------------------------------------------------------------- */
/* The suggest-build flow now has a clear visual identity: the    */
/* primary brand color #7D5860. The "Suggest a Build" CTA is the  */
/* one strong action; sibling buttons step back to a secondary    */
/* outline aesthetic so the eye lands on the primary path.        */
/* ============================================================== */

/* Budget input - swap green focus ring for primary tint */
#aipcb-budget:focus {
    border-color: #7D5860 !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(125, 88, 96, 0.2) !important;
}

/* Use Case + Platform - inline controls, no card chrome */
#aipcb-use-case-container,
#aipcb-platform-container,
#aipcb-gpu-preference-container {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 6px 0 !important;
}

/* Set Budget / Clear Budget — match the family */
#aipcb-set-budget,
#aipcb-clear-budget {
    background-color: #7D5860 !important;
    color: #ffffff !important;
    border: 1px solid #7D5860 !important;
    border-radius: 5px;
    height: 38px;
    padding: 0 14px;
    box-sizing: border-box;
    line-height: 1;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
}
#aipcb-set-budget:hover,
#aipcb-clear-budget:hover {
    background-color: #6a484f !important;
    border-color: #6a484f !important;
    color: #ffffff !important;
}
/* Clear Budget rendered in outline style at rest */
#aipcb-clear-budget {
    background-color: #ffffff !important;
    color: #7D5860 !important;
}
/* …but its hover matches every other secondary button: solid primary fill */
#aipcb-clear-budget:hover {
    background-color: #7D5860 !important;
    border-color: #7D5860 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(125, 88, 96, 0.18);
}

/* PRIMARY action: Suggest a Build. Promoted to brand color. */
#aipcb-suggest-build {
    background-color: #7D5860 !important;
    color: #ffffff !important;
    border: 1px solid #7D5860 !important;
    box-shadow: 0 2px 6px rgba(125, 88, 96, 0.18);
    font-weight: 600;
}
#aipcb-suggest-build:hover {
    background-color: #6a484f !important;
    border-color: #6a484f !important;
    box-shadow: 0 3px 10px rgba(125, 88, 96, 0.28);
}
#aipcb-suggest-build:disabled {
    background-color: #c4b3b6 !important;
    border-color: #c4b3b6 !important;
    color: #ffffff !important;
    cursor: not-allowed;
    box-shadow: none;
}

/* SECONDARY actions in the top action bar — outline style */
#aipcb-select-components,
#aipcb-show-benchmarks,
#aipcb-clear-components {
    background-color: #ffffff !important;
    color: #7D5860 !important;
    border: 1px solid #7D5860 !important;
    border-radius: 5px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}
#aipcb-select-components:hover,
#aipcb-show-benchmarks:hover,
#aipcb-clear-components:hover {
    background-color: #7D5860 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(125, 88, 96, 0.18);
}

/* SECONDARY actions below the build table — same outline style */
#aipcb-add-component,
#aipcb-show-benchmarks-2,
#aipcb-clear-components-2 {
    background-color: #ffffff !important;
    color: #7D5860 !important;
    border: 1px solid #7D5860 !important;
    border-radius: 5px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-right: 6px;
}
#aipcb-add-component:hover,
#aipcb-show-benchmarks-2:hover,
#aipcb-clear-components-2:hover {
    background-color: #7D5860 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(125, 88, 96, 0.18);
}

/* Budget alert: positive state uses our family's deep green tier color */
#aipcb-budget-alert {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
}

/* The "Tuned by you" badge is in the alert message - already primary, leave alone */


/* Utilization badge in the budget alert (e.g. "$2,580 / $3,000 (86%)") */
.aipcb-util-badge {
    display: inline-block;
    background: #ffffff;
    color: #1f6649;
    border: 1px solid #1f6649;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.2px;
    font-variant-numeric: tabular-nums;
}


/* Tertiary action row below the build table — Save/Email, Completed, Compare.
   These were previously each their own color; harmonize with the rest of
   the secondary outline buttons. The Add to Amazon Cart button keeps its
   distinctive yellow because it has functional/branding meaning. */
#aipcb-save-email,
#aipcb-completed-builds,
#aipcb-compare-builds {
    background-color: #ffffff !important;
    color: #7D5860 !important;
    border: 1px solid #7D5860 !important;
    border-radius: 5px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-right: 6px;
}
#aipcb-save-email:hover,
#aipcb-completed-builds:hover,
#aipcb-compare-builds:hover {
    background-color: #7D5860 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(125, 88, 96, 0.18);
}


/* Generic icon span used inside themed buttons. Uses fill="currentColor"
   on the SVG so the glyph follows the button's text color, naturally
   flipping from #7D5860 at rest to #ffffff on hover. */
.aipcb-btn-ico {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    line-height: 1;
    color: inherit;
}
#aipcb-compare-builds {
    display: inline-flex;
    align-items: center;
}


/* ============================================================== */
/* Inline-select harmonization                                     */
/* Use Case + Platform + Graphics Type all share one size + font   */
/* on desktop so they line up cleanly next to the budget input.    */
/* ============================================================== */
#aipcb-main-use-case,
#aipcb-platform,
#aipcb-gpu-preference {
    height: 38px;
    line-height: 1.2;
    padding: 6px 10px 6px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #ffffff;
    color: #4a3a3d;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: menulist;
    appearance: menulist;
}
/* Tight, predictable widths so all three controls fit on a single row
   alongside the budget input on desktop. */
#aipcb-main-use-case  { width: 140px; min-width: 140px; }
#aipcb-platform       { width: 125px; min-width: 125px; }
#aipcb-gpu-preference { width: 245px; min-width: 245px; }
#aipcb-main-use-case:focus,
#aipcb-platform:focus,
#aipcb-gpu-preference:focus {
    border-color: #7D5860;
    outline: none;
    box-shadow: 0 0 0 2px rgba(125, 88, 96, 0.2);
}


/* ============================================================== */
/* Benchmarks toast — appears next to Suggest a Build on subsequent */
/* re-rolls so the user is nudged toward the panel without their    */
/* scroll position being yanked every time.                         */
/* ============================================================== */
.aipcb-benchmarks-toast {
    position: absolute;
    background: #7D5860;
    color: #ffffff;
    padding: 10px 36px 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 6px 18px rgba(125, 88, 96, 0.35);
    cursor: pointer;
    user-select: none;
    max-width: 360px;
    line-height: 1.4;
    animation: aipcb-toast-in 0.25s ease;
    border: 1px solid #6a484f;
}
.aipcb-benchmarks-toast::before {
    /* Small upward-pointing notch so the toast feels attached to the
       Suggest a Build button above it. */
    content: '';
    position: absolute;
    top: -6px;
    left: 18px;
    width: 10px;
    height: 10px;
    background: #7D5860;
    border-left: 1px solid #6a484f;
    border-top: 1px solid #6a484f;
    transform: rotate(45deg);
}
.aipcb-benchmarks-toast:hover {
    background: #6a484f;
}
.aipcb-benchmarks-toast:hover::before {
    background: #6a484f;
}
.aipcb-benchmarks-toast-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: transparent;
    color: #ffffff;
    border: 0;
    font-size: 18px;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}
.aipcb-benchmarks-toast-close:hover {
    opacity: 1;
}
@keyframes aipcb-toast-in {
    from { transform: translateY(-4px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
@media (max-width: 767px) {
    .aipcb-benchmarks-toast {
        max-width: calc(100vw - 32px);
        font-size: 12px;
    }
}


/* ============================================================== */
/* Mobile fixes — shortcode.php builder UI                        */
/* ============================================================== */
@media (max-width: 767px) {

    /* Tour widget: move to bottom-right corner (FAB style) so it
       doesn't float over the build table mid-page. Shrink slightly. */
    #aipcb-tour-widget {
        top: auto !important;
        bottom: 80px !important;
        right: 16px !important;
        transform: none !important;
        width: 48px !important;
        height: 48px !important;
    }
    #aipcb-tour-widget:hover {
        width: 52px !important;
        height: 52px !important;
    }
    #aipcb-tour-widget i {
        font-size: 18px;
    }

    /* Use Case, Platform, Graphics — full width on mobile, overriding
       the fixed pixel widths set in the desktop harmonization block. */
    #aipcb-main-use-case,
    #aipcb-platform,
    #aipcb-gpu-preference {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin-left: 0 !important;
    }

    /* Bottom action buttons — force full-width stacked layout and
       override the desktop inline-flex / margin-right rules from the
       harmonization block so nothing bleeds past the viewport edge. */
    #aipcb-add-component,
    #aipcb-show-benchmarks-2,
    #aipcb-clear-components-2,
    #aipcb-add-to-cart,
    #aipcb-save-email,
    #aipcb-completed-builds,
    #aipcb-compare-builds {
        width: 100% !important;
        display: block !important;
        margin-right: 0 !important;
        margin-bottom: 10px !important;
        box-sizing: border-box !important;
    }

    /* Util / tuned badges in the budget alert — wrap gracefully */
    .aipcb-util-badge,
    .aipcb-tuned-badge {
        display: inline-block;
        margin-top: 4px;
    }
}

/* ============================================================
   Unavailable component icon (modal + build table)
   ============================================================ */
.aipcb-unavail-icon {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 4px;
    flex-shrink: 0;
    cursor: help;
    opacity: 0.9;
}
.aipcb-unavail-icon:hover {
    opacity: 1;
}

/* ============================================================
   Budget donut slice hover tooltip
   ============================================================ */
.aipcb-ft-slice-tooltip {
    position: fixed;
    z-index: 99999;
    display: none;
    background: rgba(50, 30, 34, 0.92);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 11px;
    border-radius: 6px;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
    line-height: 1.5;
}

/* Widen donut slice hit area on hover so the tooltip is easy to trigger */
.aipcb-ft-donut-slice {
    transition: stroke-dasharray 0.4s ease, transform 0.4s ease, stroke-width 0.15s ease;
}
.aipcb-ft-donut-slice:hover {
    stroke-width: 15;
}
