body {
    font-family: Arial, sans-serif;
}

.container {
    width: 80%;
    margin: auto;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.logo {
    height: 50px;
}

.main-header h1 {
    margin-left: 20px;
}

.filter-bar {
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

#filter-form { 
    flex-direction: row;
    width: 100%;
}

.search-bar, .filter-select, .filter-button {
    margin-right: 10px;
    padding: 10px;
    font-size: 16px;
}

.search-bar {
    flex:3;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.filter-select {
    flex:2;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.filter-button {
    flex:1;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.filter-button:hover {
    background-color: #2980b9;
}

.parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.part-item {
    border: 1px solid #ddd;
    padding: 15px;
    text-align: center;
}

.part-item h3 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* .quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
} */

.quantity-input {
    width: 40px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px;
}

.added-to-cart {
    background-color: #28a745 !important; /* Green color */
    transition: background-color 0.3s ease;
}

a.info-button {
    color: black;
    text-decoration: none;
}

a.info-button:hover {
    text-decoration: underline;
}

.part-item img {
    max-width: 100%;
    height: auto;
}

#part-img {
    max-width: 100%;
    height: auto;
}

.request-button {
    margin-top: 10px;
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.quantity-buttons {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #3498db;
    color: white;
}

.request-button:hover {
    background-color: #2980b9;
}


/* Form styles */
form {
    display: flex;
}

form label {
    margin-bottom: 5px;
    font-weight: bold;
}

form a {
    text-decoration: underline;

}

form input, .g-recaptcha, form button {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    width: 100%; /* Full width on mobile */
}

form .checkbox {
    width: 30px; /* Full width on mobile */

}

form button {
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-request {
    margin-top: 15px;

}

form button:hover {
    background-color: #2980b9;
}

/* Spinner Styles */
.spinner {
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top: 4px solid #3498db;
    width: 30px;
    height: 30px;
    animation: spin 2s linear infinite;
    margin-top: 10px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Response Message */

#request-form, #edit-form, #add-part-form { 
    flex-direction: column;
}

#request-form,#edit-form, #add-part-form input { 
    margin-bottom: 15px;
}



/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100vw; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #f0f8ff;
    margin: 10% auto;
    padding: 30px;
    width: 100%; /* Increased size */
    max-width: 500px; /* Constrain the width on larger screens */
    box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.2);
    border-radius: 8px;
}

.close, .rules-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus,
.rules-close:hover,
.rules-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
    }

    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-bar form {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .filter-bar .search-bar,
    .filter-bar .filter-select,
    .filter-bar .filter-button {
        width: 100%;
        margin-right: 0;
    }

    .modal-content {
        width: 80%;
    }
}

.spinner {
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top: 4px solid #3498db;
    width: 30px;
    height: 30px;
    animation: spin 2s linear infinite;
    margin-top: 10px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#request-response {
    margin-top: 10px;
    color: green;
    font-weight: bold;
    text-align: center;
}


#requests-flexbox {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header-row, .request-row {
    display: flex;
    justify-content: space-between;
    background-color: #f5f5f5;
    padding: 10px;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
}

.request-row {
    background-color: #fff;
    font-weight: normal;
}

.request-item {
    flex: 1;
    padding: 10px;
}

.request-item form {
    display: flex;
    gap: 10px;
}

.request-item select, .request-item button {
    padding: 5px;
}

.request-item select {
    width: 100%;
}


/* Tab Container */
.tab-container {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.tab-button:hover {
    background-color: #2980b9;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

option.selected {
    background-color: #2980b9;
}