:root {
    --bg-color: #0A0A0A; /* Dark background */
    --text-color: #FFFFFF; /* White text */
    --accent-cyan: #31cee7;
    --accent-pink: #FF007F;
    --secondary-text: #B3B3B3;
    --grid-gap: 16px; /* Define gap explicitly if not already defined */
}
#notification {
    position: fixed;
    top: 20px; /* Position at the top */
    left: 50%;
    transform: translateX(-50%); /* Center horizontally */
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
    font-weight: bold;
    color: white;
    background: linear-gradient(45deg, var(--accent-cyan), var(--accent-pink));
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    z-index: 1000;
}

#notification.visible {
    opacity: 1;
    visibility: visible;
}
.container {
    padding: 20px; /* Smaller padding */
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 8px; /* Smaller border radius */
    margin: 20px; /* Smaller margin */
    max-width: auto;
    text-align: left; /* Ensure content is left-aligned */
}

/* Action buttons container - positioning buttons on opposite sides */
.action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}
/* Contact button styling */
.contact-build-button {
    background-color: #5e3cc4;
    color: var(--text-color);
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.contact-build-button:hover {
    background-color: #4a2ea0;
}

/* Mobile responsiveness */
@media (max-width: 1060px) {
    .contact-build-button {
        margin-right: 15px;
        margin-bottom: 10px;
    }
}

.status-container {
    display: flex; /* Align compatibility and wattage boxes horizontally */
    margin-bottom: 16px; /* Smaller margin */
    align-items: stretch; /* Make boxes equal height */
}

.compatibility-box {
    padding: 8px 12px; /* Smaller padding */
    background-color: rgb(29, 150, 0); /* Default green background */
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); /* Depth effect */
    font-size: 14px; /* Smaller font size */
    width: 100%; /* Ensure it takes up the available space */
    box-sizing: border-box; /* Include border in width calculation */
}
.purchase-button.return-button {
    margin-left: 0;
    margin-right: auto;
}

/* Adjust the container for return button */
.total-section:has(.return-button) {
    justify-content: flex-start;
}

.compatibility-text {
    color: var(--text-color);
}

.compatibility-status {
    color: var(--text-color);
}

/* Red background for incompatibility */
.compatibility-box.incompatible {
    background-color: rgb(255, 0, 0, 0.9); /* Red background */
}

.wattage-box {
    padding: 8px 12px; /* Smaller padding */
    background-color: rgba(44, 135, 195, 0.9); /* Wattage box background */
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); /* Depth effect */
    font-size: 14px; /* Smaller font size */
    white-space: nowrap; /* Prevent text from wrapping */
    box-sizing: border-box; /* Include border in width calculation */
}
.wattage-text {
    color: var(--text-color);
}

.wattage-value {
    color: var(--text-color);
}
.component-info {
    width: 100%;
    display: grid;
    grid-template-columns: 
        100px                 /* Fixed width first column */
        minmax(280px, 1fr)    /* Selection: min width with flexible growth */
        150px                 /* Increased width for price column */
        100px                 /* Fixed width for location */
        50px;                 /* Fixed width for remove button */
    gap: var(--grid-gap);
    align-items: center;
    padding: 10px;
}

/* Component info header styling */
.component-info span {
    font-weight: 600;
    color: var(--text-color);
    padding: 5px;
    text-align: center;
    align-self: center; /* Ensure vertical alignment */
    grid-row: 1;
    position: relative; /* Add position context */
    white-space: nowrap; /* Prevent text wrapping */
}

/* Position component-name in the first column */
.component-info span.component-name {
    text-align: left;
    grid-column: 1;
    justify-self: start;
}

/* Position component-selection in the second column */
.component-info span.component-selection {
    text-align: left;
    grid-column: 2; /* Change to column 2 */
    justify-self: start;
    padding-left: 62px; /* Add extra padding on the left side */
}

/* Adjust other header columns */
.component-info span.component-price {
    grid-column: 3; /* Shift to column 3 */
    padding-right: 80px;
    text-align: left; /* Right-align the text */
}

.component-info span.component-location {
    grid-column: 4; /* Shift to column 4 */
    padding-right: 80px;
}

.component-info span.component-remove {
    grid-column: 5; /* Shift to column 5 */
    text-align: right;
    padding-left: 20px;
}

.category {
    position: relative; /* Needed for the pseudo-element */
    padding: 16px; /* Smaller padding */
    margin-bottom: 16px; /* Smaller margin */
    text-align: left; /* Left-align category content */
    display: flex; /* Use flexbox for horizontal layout */
    align-items: center; /* Change from baseline to center for vertical alignment */
    gap: 16px; /* Consistent gap between h2 and button */
}

.category h2 {
    font-size: 16px; /* Smaller font size */
    margin: 0; /* Remove default margin */
    line-height: 1.2; /* Consistent line height */
    width: 150px; /* Fixed width for h2 to create a "block of nothing" */
    flex-shrink: 0; /* Prevent h2 from shrinking */
}

.category button {
    font-weight: 600;
    background: linear-gradient(45deg, var(--accent-cyan), var(--accent-pink));
    color: var(--text-color);
    border: none;
    padding: 8px 16px; /* Smaller padding */
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 13px; /* Smaller font size */
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.2s, box-shadow 0.4s ease-in-out;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5), 0 0 10px rgba(255, 0, 127, 0.5);
}

.category::before {
    content: "";
    position: absolute;
    top: 0;
    left: -16px; /* Smaller extension */
    right: -16px; /* Smaller extension */
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.2); /* Shadow box background */
    border: 2px solid var(--accent-cyan); /* Shadow box border */
    border-radius: 8px; /* Smaller border radius */
    z-index: -1; /* Place the shadow box behind the content */
}

.category button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), 0 0 20px rgba(255, 0, 127, 0.8);
}

.total-section {
    display: flex;
    justify-content: flex-end; /* Align to the right */
    align-items: center; /* Vertically center the text and button */
    margin-top: 16px; /* Smaller margin */
    padding: 8px 12px; /* Smaller padding */
}

.total-text {
    font-size: 16px; /* Smaller font size */
    font-weight: 600;
    margin-right: 16px; /* Smaller margin */
    color: var(--text-color);
}

.purchase-button {
    font-weight: 600;
    background: linear-gradient(45deg, var(--accent-cyan), var(--accent-pink));
    color: var(--text-color);
    border: none;
    padding: 8px 16px; /* Smaller padding */
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px; /* Smaller font size */
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.2s, box-shadow 0.4s ease-in-out;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5), 0 0 10px rgba(255, 0, 127, 0.5);
}
.components-wrapper{
    padding-right: 18px;    
    
}

/* Update selected-component grid to match the new 5-column layout */
.selected-component {
    width: 100%;
    display: grid;
    grid-template-columns: 
        100px                 /* Fixed width first column */
        minmax(280px, 1fr)    /* Selection: min width with flexible growth */
        150px                 /* Increased width for price column */
        100px                 /* Fixed width for location */ 
        50px;                 /* Fixed width for remove button */
    gap: var(--grid-gap);
    align-items: center;
    padding: 10px;
}
/* Type is in first column */

/* Make selection container span across the first two columns */
.selected-component .product-header {
    grid-column: 1 / 3 !important; /* Span columns 1 and 2 */
    display: flex;
    align-items: center;
    gap: 15px; /* Increase the gap between image and text */
    justify-self: flex-start !important;
}

/* Component Image */
.selected-component .component-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 0;
    background: none;
    padding: 0;
}

.selected-component .component-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 16px;
    margin: 0;
}

/* Adjust other element columns */
.selected-component .component-price {
    grid-column: 3 !important; /* Move to column 3 */
    justify-self: center !important;
    align-self: center;
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
    text-align: right;
    padding-right: 40px;
}

/* Buy Container is in third column */
.component-buy-container {
    grid-column: 4 !important; /* Move to column 4 */
    justify-self: center !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Location Text */
.location-text {
    font-size: 12px;
    color: var(--accent-cyan);
    margin-bottom: 5px;
    font-weight: bold;
}

/* Buy Button */
.buy-component {
    font-weight: 600;
    background: linear-gradient(45deg, var(--accent-cyan), var(--accent-pink));
    color: var(--text-color);
    border: none;
    padding: 6px 12px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 13px;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.2s, box-shadow 0.4s ease-in-out;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5), 0 0 10px rgba(255, 0, 127, 0.5);
    white-space: nowrap;
}

.buy-component:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), 0 0 20px rgba(255, 0, 127, 0.8);
}
/* Close container is in fourth column */
.close-container {
    grid-column: 5 !important; /* Move to column 5 */
    justify-self: center !important;
    align-self: center;
    position: relative;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.leftright,
.rightleft {
    height: 4px;
    width: 30px; /* Reduced width */
    position: absolute;
    background-color: var(--accent-cyan); /* Default color */
    transform: rotate(45deg);
    transition: all 0.3s ease-in;
}

.rightleft {
transform: rotate(-45deg);
}

.close-container:hover .leftright,
.close-container:hover .rightleft {
background-color: var(--accent-pink); /* Hover color */
transform: rotate(0deg);
}

.close-container:hover .leftright {
transform: rotate(-45deg);
}

.close-container:hover .rightleft {
transform: rotate(45deg);
}


.purchase-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), 0 0 20px rgba(255, 0, 127, 0.8);
}


.see-details {
    color: var(--text-color);
    text-decoration: underline;
    margin-left: 8px;
    font-weight: bold;
    transition: color 0.3s ease;
}


/* Compatibility issues section styling */
.compatibility-issues {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 20px;
    margin: 20px auto;
    max-width: 1200px;
}

.compatibility-issues h3 {
    color: var(--text-color);
    font-weight: 600;
    margin-top: 0;
    font-size: 1.2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    padding-bottom: 8px;
}

.compatibility-issues h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
}

.issues-list {
    color: var(--text-color);
}

.issues-list p {
    margin: 8px 0;
    padding: 10px;
    background-color: rgba(255, 0, 0, 0.2);
}

.hidden {
    display: none;
}

/* Compatibility box hover effect */
.compatibility-box.incompatible {
    cursor: pointer;
}


/* Maintain category borders on mobile */
@media (max-width: 768px) {
    .category {
        position: relative;
    }
    
    .category::before {
        content: "";
        position: absolute;
        top: 0;
        left: -16px;
        right: -16px;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.2);
        border: 2px solid var(--accent-cyan);
        border-radius: 8px;
        z-index: -1;
    }
}

/* Stack grids only below 648px */
@media (max-width: 648px) {
    .status-container {
        flex-direction: column;
    }
    
    .compatibility-box {
        margin-bottom: 0;
    }
    
    .wattage-box {
        width: 100%;
        white-space: normal;
    }
}

/* Mobile Layout for screens below 1044px */
@media (max-width: 1060px) {
    /* Prevent horizontal scrolling */
    body, html {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    /* Full-width container without margins */
    .container {
        width: 100%;
        margin: 0;
        padding: 10px;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* Full-width container without margins */
    .container {
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        background-color: transparent;
    }

    /* Hide column headers */
    .component-info {
        display: none;
    }

    /* Convert categories to vertical layout */
    .category {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        margin: 15px 10px;
        width: calc(100% - 20px);
    }

    .category h2 {
        width: 100%;
        margin-bottom: 10px;
    }

    /* Card-based layout for selected components */
    .selected-component {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto auto auto auto;
        gap: 10px;
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 8px;
        padding: 12px;
        margin: 15px 10px;
        width: calc(100% - 20px);
        box-sizing: border-box;
    }

    /* Product header spanning full width */
    .selected-component .product-header {
        grid-column: 1 / -1 !important;
        grid-row: 1;
        display: flex;
        align-items: center;
        gap: 15px;
        padding-bottom: 10px;
        margin-bottom: 8px;
    }

    /* Reset all positioning for mobile */
    .selected-component .component-price,
    .component-buy-container,
    .close-container {
        grid-column: auto !important;
        justify-self: start !important;
    }

    /* Remove data-position styling from general selector and only apply to price */
    .selected-component .component-price {
        margin: 0;
        padding: 0;
        grid-column: 1;
        grid-row: 2;
        /* Add price-specific styling */
        color: var(--text-color);
        font-weight: 600;
    }

    /* Clear all specific data-position rules */
    .selected-component *[data-position="3"],
    .selected-component *[data-position="4"],
    .selected-component *[data-position="5"],
    .selected-component *[data-position="6"],
    .selected-component *[data-position="7"],
    .selected-component *[data-position="8"] {
        /* Reset these rules */
        grid-column: auto;
        grid-row: auto;
    }

    /* Product header positioning (image and name) */
    .selected-component .product-header {
        grid-column: 1 / -1 !important;
        grid-row: 1;
        display: flex;
        align-items: center;
        gap: 15px;
        padding-bottom: 10px;
        margin-bottom: 8px;
    }

    /* Buy button container positioning */
    .component-buy-container {
        grid-column: 2 !important;
        grid-row: 2;
        justify-self: center !important;
    }

    /* Close/remove button positioning */
    .close-container {
        grid-column: 3 !important;
        grid-row: 2;
        justify-self: end !important;
    }

    /* Only price element should show label */
    .selected-component .component-price::before {
        content: var(--label-text, "Prix");
        display: block;
        color: var(--accent-cyan);
        font-size: 12px;
        margin-bottom: 4px;
        font-weight: 600;
    }

    /* Adjust buy button for mobile */
    .buy-component {
        padding: 5px 10px;
        font-size: 15px;
    }

/* Very small screens adjustments */
@media (max-width: 488px) {
    .selected-component {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Reposition 3rd item to maintain 2 columns */
    .selected-component *[data-position="5"] {
        grid-column: 1;
        grid-row: 3;
    }
    
    /* Shift 2nd row items down */
    .selected-component *[data-position="6"] {
        grid-column: 2;
        grid-row: 3;
    }
    
    .selected-component *[data-position="7"] {
        grid-column: 1;
        grid-row: 4;
    }
    
    /* Adjust remove button position */
    .selected-component *[data-position="8"] {
        grid-column: 2;
        grid-row: 4;
    }
    .close-container{
        display: none;
    }
}
}

/* Small screen adjustments */
@media (max-width: 600px) {
    .selected-component {
        padding: 10px;
        gap: 6px;
    }
    
    .product-header {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }
    
    .component-image {
        width: 40px;
        height: 40px;
    }
    
    .component-name {
        font-size: 14px;
    }
}

/* Very small screens - consolidated 488px media queries */
@media (max-width: 488px) {
    .action-buttons {
        flex-direction: column;
        align-items: flex-start; /* Left-align buttons horizontally */
        padding: 0 15px;
    }
    
    /* Position the share button at the top */
    .share-build-button {
        width: auto; /* Keep original width */
        margin-bottom: 10px;
        margin-left: 15px; /* Consistent left margin */
        order: 1;
    }
    
    /* Position the contact button directly below the share button */
    .contact-build-button {
        width: auto; /* Keep original width */
        margin-top: 0;
        margin-right: 0;
        margin-left: 15px; /* Match the share button's left margin */
        margin-bottom: 15px;
        order: 2;
    }
    /* Switch to 2-column layout */
    .selected-component {
        grid-template-columns: repeat(2, 1fr);
        padding: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Constrain any images or media */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Price element - left side */
    .selected-component *[data-position="3"] {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
    }
    
    /* Buy button container - right side */
    .component-buy-container {
        grid-column: 2 !important;
        grid-row: 2;
        justify-self: end !important; /* Right-align the button */
    }
    
    /* Delete button - center */
    .selected-component *[data-position="5"] {
        grid-column: 1 / -1;
        grid-row: 3;
        justify-self: center;
        margin-top: 10px;
    }
    
    /* Hide X button on small screens */
    .close-container {
        display: none;
    }
    
    /* Show the mobile delete button */
    .delete-component {
        display: inline-block;
        grid-column: 1 / -1 !important; /* Span across columns */
        grid-row: 3;
        justify-self: center;
        margin-top: 10px;
    }
    
    /* Reposition grid items for 2-column layout */
    .selected-component {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Reposition 3rd item to maintain 2 columns */
    .selected-component *[data-position="5"] {
        grid-column: 1;
        grid-row: 3;
    }
    
    /* Shift 2nd row items down */
    .selected-component *[data-position="6"] {
        grid-column: 2;
        grid-row: 3;
    }
    
    .selected-component *[data-position="7"] {
        grid-column: 1;
        grid-row: 4;
    }
    
    /* Adjust remove button position */
    .selected-component *[data-position="8"] {
        grid-column: 2;
        grid-row: 4;
    }
}

/* Styles for the mobile delete button */
.delete-component {
    font-weight: 600;
    background: linear-gradient(45deg, var(--accent-cyan),var(--accent-pink));
    color: var(--text-color);
    border: none;
    padding: 6px 12px;
    text-align: center;
    text-decoration: none;
    display: none; /* Hidden by default */
    font-size: 13px;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.2s, box-shadow 0.4s ease-in-out;
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.5), 0 0 10px rgba(0, 255, 255, 0.5);
    white-space: nowrap;
}

.delete-component:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.8), 0 0 20px rgba(0, 255, 255, 0.8);
}

/* Only show delete button on very small screens */
@media (max-width: 488px) {
    .delete-component {
        display: inline-block; /* Show button */
        grid-column: 1 / -1 !important; /* Span across columns */
        grid-row: 3;
        justify-self: center;
        margin-top: 10px;
    }
    
    /* Keep this rule to hide the X button */
    .close-container {
        display: none;
    }
}

/* Share button and modal styles */
.share-build-button {
    background-color: #5e3cc4;
    color: var(--text-color);
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.share-build-button:hover {
    background-color: #4a2ea0;
}

.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.share-modal-content {
    background-color: rgb(18, 18, 18);
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.share-link-container {
    display: flex;
    margin: 15px 0;
}

.share-url-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--secondary-text);
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.copy-link-button {
    background-color: #5e3cc4;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.close-modal-button {
    background-color: rgb(0,0,0,0.6);
    border: none;
    color: var(--text-color);
    padding: 10px 15px;
    border-radius: 4px;
    width: 100%;
    margin-top: 10px;
    cursor: pointer;
}

.shared-build-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #5e3cc4;
    color: rgb(18, 18, 18);
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: opacity 0.5s;
}
#shareUrlInput{
    background-color: rgb(18, 18, 18);
    color: var(--secondary-text);
}

@media (max-width: 1060px) {
    .share-build-button{
        margin-left: 15px;
        margin-bottom: 10px;
    }
}