/* GENERAL STYLES */
.lab-calculator {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    font-family: 'Inter', sans-serif;
    color: #000;
    box-sizing: border-box;
}

.lab-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}
.lab-logo {
    width: 150px;
}
.lab-title {
    font-size: 28px;
    margin: 0;
    color: #ff0000;
}
.lab-subtitle {
    font-size: 14px;
    margin: 0;
    color: #333;
}

.lab-content {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.lab-tests,
.summary-box {
    min-width: 0;
}

/* LEFT SIDE */
.lab-tests {
    flex: 3 1 0;
    min-width: 0;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #ddd;
    box-sizing: border-box;
}

.search-box {
    width: 100%;
    padding: 12px;
    margin: 15px 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    color: #000;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.search-box:focus {
    outline: none;
    border-color: #ff0000;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

/* Category Header */
.category-header {
    margin: 15px 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff0000;
}

.category-title {
    font-size: 1.1em;
    color: #333;
    margin: 0;
    font-weight: 600;
}

/* Category Drop-down - FIXED */
.simple-category-select {
    width: 100%;
    max-width: 300px;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    margin: 20px 0;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.3s ease;
    color: #000; /* Ensure text is black by default */
}

.simple-category-select:focus {
    outline: none;
    border-color: #ff0000;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

.simple-category-select:hover {
    border-color: #ff0000;
}

/* Fix for selected option - ensure text is visible */
.simple-category-select option {
    color: #000;
    background: #fff;
    padding: 8px;
}

.simple-category-select option:checked {
    background: linear-gradient(90deg, #ff0000, #aa0000);
    color: red !important;
}

/* Additional fix for Firefox */
.simple-category-select:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 #000;
}

.simple-category-select option:checked {
    background: linear-gradient(90deg, #ff0000, #aa0000) !important;
    color: red !important;
}

/* Fix for Chrome/Safari */
.simple-category-select option:checked {
    background: linear-gradient(90deg, #ff0000, #aa0000);
    color: red;
}

/* TEST CARDS */
.test-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.test-card {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
    box-sizing: border-box;
    position: relative;
}

.test-card:hover {
    border-color: #ff0000;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.1);
    transform: translateY(-2px);
}

.test-card input {
    margin-right: 10px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #ff0000;
}

.test-card > div {
    width: 100%;
}

.test-card h3 {
    font-size: 16px;
    margin: 0 0 8px 0;
    color: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.test-card h3 span:first-child {
    flex: 1;
}

.test-card p {
    margin: 4px 0 8px 0;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.price {
    color: #ff0000;
    font-weight: bold;
    font-size: 16px;
    display: inline-block;
}

/* Details Button */
.details-btn {
    background: none;
    border: 1px solid #ff0000;
    color: #ff0000;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.details-btn:hover {
    background: linear-gradient(90deg, #ff0000, #aa0000);
    color: white;
    border-color: transparent;
}

/* No Results Message */
.no-results-message {
    text-align: center;
    padding: 40px;
    color: #666;
    grid-column: 1 / -1;
}

.no-results-message p:first-child {
    font-size: 16px;
    margin-bottom: 10px;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.page-btn:hover {
    background: #f8f8f8;
    border-color: #ff0000;
    color: #ff0000;
}

.page-btn.active {
    background: linear-gradient(90deg, #ff0000, #aa0000);
    color: #fff;
    border-color: transparent;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading:after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #ff0000;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* OPTIONS SECTION */
.options-title {
    margin-top: 30px;
    font-size: 18px;
    color: #000;
}

.options-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.option-card {
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    position: relative;
    border: 1px solid #ddd;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.option-card:hover {
    border-color: #ff0000;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.1);
}

.option-card p {
    margin: 0;
    font-weight: bold;
    color: #000;
}

.option-card span {
    display: block;
    font-size: 13px;
    color: #555;
}

.price.free {
    color: #28a745;
}

/* TOGGLE SWITCH */
.switch {
    position: absolute;
    top: 15px;
    right: 15px;
    display: inline-block;
    width: 40px;
    height: 20px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: black;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background: linear-gradient(90deg, #ff0000, #aa0000);
}
input:checked + .slider:before {
    transform: translateX(20px);
    background-color: white;
}

/* RIGHT SIDE */
.summary-box {
    flex: 1 1 0;
    min-width: 0;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #ddd;
    margin-top: 0;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.summary-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff0000, #aa0000);
}

.no-tests {
    color: #777;
    margin: 15px 0;
}

/* Summary Rows Container */
.summary-rows-container {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.summary-row,
.summary-total {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
}

.summary-row {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    cursor: help;
    transition: all 0.2s ease;
}

.summary-row:hover {
    background: linear-gradient(90deg, rgba(255, 0, 0, 0.05), rgba(170, 0, 0, 0.05));
    padding-left: 5px;
    padding-right: 5px;
}

.summary-row small {
    font-size: 11px;
    color: #999;
}

.summary-total {
    font-size: 18px;
    font-weight: bold;
    background: linear-gradient(90deg, #ff0000, #aa0000);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-top: 10px;
    border-top: 2px solid #e0e0e0;
    margin-top: 10px;
}

.order-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(90deg, #ff0000, #aa0000);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.order-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.2);
}

.order-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.note {
    font-size: 12px;
    color: #777;
    margin-top: 10px;
}

/* PRODUCT MODAL - ALL RED GRADIENT COLORS */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal-container {
    position: relative;
    background: white;
    max-width: 600px;
    width: 90%;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: modalSlideIn 0.3s ease;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(90deg, #ff0000, #aa0000);
    border-bottom: none;
}

.modal-title {
    margin: 0;
    color: white;
    font-size: 1.4em;
    font-weight: bold;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-price {
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(90deg, #ff0000, #aa0000);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    display: inline-block;
}

.modal-description {
    line-height: 1.6;
    color: #555;
    font-size: 15px;
}

.modal-description p {
    margin-bottom: 15px;
}

.modal-description ul, 
.modal-description ol {
    margin: 10px 0 10px 20px;
}

.modal-description h1, 
.modal-description h2, 
.modal-description h3, 
.modal-description h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

.modal-description strong {
    color: #ff0000;
}

.modal-description a {
    color: #ff0000;
    text-decoration: none;
    transition: color 0.3s ease;
}

.modal-description a:hover {
    color: #aa0000;
    text-decoration: underline;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-select-btn {
    background: linear-gradient(90deg, #ff0000, #aa0000);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.modal-select-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.modal-select-btn:active {
    transform: translateY(0);
}

.modal-cancel-btn {
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.modal-cancel-btn:hover {
    background: #e0e0e0;
    border-color: #ff0000;
    color: #ff0000;
}

/* Modal Scrollbar - Red Gradient */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #ff0000, #aa0000);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #aa0000, #ff0000);
}

/* Modal Container Gradient Border */
.modal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff0000, #aa0000);
    z-index: 1;
}

/* Summary Box Scrollbar - Red Gradient */
.summary-rows-container::-webkit-scrollbar {
    width: 8px;
}

.summary-rows-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.summary-rows-container::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #ff0000, #aa0000);
    border-radius: 10px;
}

.summary-rows-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #aa0000, #ff0000);
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .lab-calculator {
        width: 95%;
        padding: 15px;
    }
    
    .lab-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .test-cards {
        grid-template-columns: 1fr;
    }
    
    .options-cards {
        grid-template-columns: 1fr;
    }
    
    .modal-container {
        width: 95%;
        margin: 20px;
    }
    
    .modal-body {
        padding: 20px;
        max-height: 50vh;
    }
    
    .modal-price {
        font-size: 20px;
    }
    
    .page-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .simple-category-select {
        max-width: 100%;
    }
    
    .summary-rows-container {
        max-height: 250px;
    }
    
    .summary-box {
        flex: 0
    }
}

@media (max-width: 480px) {
    .lab-calculator {
        width: 100%;
        padding: 10px;
    }
    
    .lab-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .lab-title {
        font-size: 24px;
    }
    
    .test-card h3 {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .details-btn {
        margin-top: 5px;
        width: 100%;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-select-btn,
    .modal-cancel-btn {
        width: 100%;
    }
}