﻿/* Single Test Styles - Responsive Design */

/* Container Styles */
.single-test-basic-info,
.single-test-bmi {
    background: #fff;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.single-test-basic-info:hover,
.single-test-bmi:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Form Header with Title and Button on Same Line */
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #0073aa;
    padding-bottom: 12px;
    margin-bottom: 25px;
    gap: 15px;
}

.form-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.6rem;
    font-weight: 600;
    flex: 1;
}

.form-header button,
.form-header input[type="submit"] {
    flex-shrink: 0;
}

.single-test-basic-info h3,
.single-test-bmi h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.6rem;
    font-weight: 600;
}

/* Form Grid Layout */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
    width: 100%;
}

.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.form-field label {
    font-weight: 600;
    color: #555;
    font-size: 0.95rem;
    margin: 0;
}

/* Form Table Styles - Legacy Support */
.basic-info-table,
.bmi-form table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    display: none; /* Hidden if using new grid layout */
}

.basic-info-table tr,
.bmi-form table tr {
    border-bottom: 1px solid #e5e5e5;
}

.basic-info-table th,
.bmi-form table th {
    text-align: left;
    padding: 15px 10px;
    font-weight: 600;
    color: #555;
    width: 30%;
    vertical-align: top;
}

.basic-info-table td,
.bmi-form table td {
    padding: 15px 10px;
}

/* Input Styles */
.basic-info-table input[type="date"],
.basic-info-table select,
.bmi-form input[type="number"],
.form-field input[type="date"],
.form-field select,
.form-field input[type="number"] {
    width: 100%;
    max-width: 100%;
    padding: 12px 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    line-height: 1.5;
    height: 48px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: #fafafa;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Add custom arrow for select dropdowns */
.form-field select,
.basic-info-table select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
}

.basic-info-table input[type="date"]:hover,
.basic-info-table select:hover,
.bmi-form input[type="number"]:hover,
.form-field input[type="date"]:hover,
.form-field select:hover,
.form-field input[type="number"]:hover {
    border-color: #0073aa;
    background: #fff;
}

.basic-info-table input[type="date"]:focus,
.basic-info-table select:focus,
.bmi-form input[type="number"]:focus,
.form-field input[type="date"]:focus,
.form-field select:focus,
.form-field input[type="number"]:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    background: #fff;
}

.bmi-form input[type="number"]::placeholder,
.form-field input[type="number"]::placeholder {
    color: #999;
    font-style: italic;
    opacity: 0.8;
}

.form-field input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.form-field input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Range Slider Styles */
input[type="range"] {
    width: 100%;
    max-width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #ff69b4 0%, #4169e1 100%);
    border-radius: 4px;
    outline: none;
    margin-top: 8px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #0073aa;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #0073aa;
    cursor: pointer;
}

#gender-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

#gender-labels p {
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

/* Button Styles */
.button,
.button-primary,
.bmi-form button,
.form-header button,
.form-header input[type="submit"] {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3);
    white-space: nowrap;
}

.button:hover,
.button-primary:hover,
.bmi-form button:hover,
.form-header button:hover,
.form-header input[type="submit"]:hover {
    background: linear-gradient(135deg, #005a87 0%, #004466 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.4);
}

.button:active,
.button-primary:active,
.bmi-form button:active,
.form-header button:active,
.form-header input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 115, 170, 0.3);
}

.submit {
    margin-top: 10px;
    display: none; /* Hidden when using form-header layout */
}

/* BMI Result Styles */
.bmi-result {
    background: #f0f9ff;
    border-left: 4px solid #0073aa;
    padding: 25px;
    margin-top: 25px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.bmi-result h4 {
    margin-top: 0;
    color: #0073aa;
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.bmi-result p {
    margin: 10px 0;
    font-size: 1.1rem;
    line-height: 1.6;
}

.bmi-result strong {
    color: #333;
}

.bmi-result ul {
    margin: 10px 0;
}

.bmi-result ul li {
    line-height: 1.8;
}

/* Responsive Design - Tablet */
@media screen and (max-width: 768px) {
    .single-test-basic-info,
    .single-test-bmi {
        padding: 20px;
    }
    
    .form-header {
        flex-direction: row;
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .form-header h3 {
        font-size: 1.4rem;
        flex: 1;
        min-width: 200px;
    }
    
    .form-header button,
    .form-header input[type="submit"] {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
    
    .form-row-2col {
        gap: 18px;
    }
    
    .form-grid {
        gap: 18px;
    }
    
    .basic-info-table th,
    .bmi-form table th {
        width: 40%;
        font-size: 0.95rem;
    }
    
    .basic-info-table td,
    .bmi-form table td {
        font-size: 0.95rem;
    }
}

/* Responsive Design - Small Tablet */
@media screen and (max-width: 600px) {
    .form-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .form-header button,
    .form-header input[type="submit"] {
        width: 100%;
    }
}

/* Responsive Design - Mobile */
@media screen and (max-width: 480px) {
    .single-test-basic-info,
    .single-test-bmi {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 6px;
    }
    
    .form-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .form-header h3 {
        font-size: 1.3rem;
    }
    
    .form-header button,
    .form-header input[type="submit"] {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
    }
    
    .form-row-2col {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-grid {
        gap: 20px;
    }
    
    .form-field {
        width: 100%;
    }
    
    .basic-info-table input[type="date"],
    .basic-info-table select,
    .bmi-form input[type="number"],
    .form-field input[type="date"],
    .form-field select,
    .form-field input[type="number"] {
        width: 100%;
        max-width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px;
        height: 52px;
    }
    
    .form-field label {
        font-size: 0.9rem;
    }
    
    .button,
    .button-primary,
    .bmi-form button {
        width: 100%;
        padding: 16px;
        font-size: 1.1rem;
    }
    
    .bmi-result {
        padding: 18px;
    }
    
    .bmi-result h4 {
        font-size: 1.2rem;
    }
    
    .bmi-result p {
        font-size: 1rem;
    }
}

/* Extra Small Devices */
@media screen and (max-width: 360px) {
    .single-test-basic-info h3,
    .single-test-bmi h3,
    .form-header h3 {
        font-size: 1.15rem;
    }
    
    .form-header button,
    .form-header input[type="submit"] {
        font-size: 0.9rem;
        padding: 12px;
    }
    
    .bmi-result ul li {
        font-size: 0.85rem;
    }
}

/* Accessibility Improvements */
label {
    cursor: pointer;
}

input:focus,
select:focus,
button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.single-test-basic-info,
.single-test-bmi {
    animation: fadeIn 0.5s ease-out;
}

.bmi-result {
    animation: fadeIn 0.6s ease-out;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Success Message */
.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    color: #155724;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-out;
}

/* Error Message */
.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-out;
}

.success-message p,
.error-message p {
    margin: 0;
    font-weight: 500;
}

/* Required Field Indicator */
.basic-info-table label[for]:after,
.bmi-form label[for]:after,
.form-field label:after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
    margin-left: 2px;
}

/* Form Validation Styles */
input:invalid:not(:placeholder-shown),
select:invalid:not(:placeholder-shown) {
    border-color: #dc3545;
}

input:valid:not(:placeholder-shown),
select:valid:not(:placeholder-shown) {
    border-color: #28a745;
}

/* Print Styles */
@media print {
    .single-test-basic-info form,
    .bmi-form button,
    .button,
    .button-primary,
    .form-header button,
    .form-header input[type="submit"] {
        display: none;
    }
    
    .form-header {
        border-bottom: 2px solid #333;
    }
    
    .single-test-basic-info,
    .single-test-bmi {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #0073aa;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #0073aa;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#gender-labels {
    display: flex;
    justify-content: space-between;
    max-width: 100%3aa;
    cursor: pointer;
}

#gender-labels {
    display: flex;
    justify-content: space-between;
    max-width: 300px;
    margin-bottom: 5px;
}

#gender-labels p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

/* Required Field Indicator */
.basic-info-table label[for]:after,
.bmi-form label[for]:after,
.form-field label:after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
    margin-left: 2px;
}

/* Form Validation Styles */
input:invalid:not(:placeholder-shown),
select:invalid:not(:placeholder-shown) {
    border-color: #dc3545;
}

input:valid:not(:placeholder-shown),
select:valid:not(:placeholder-shown) {
    border-color: #28a745;
}

/* Print Styles */
@media print {
    .single-test-basic-info form,
    .bmi-form button,
    .button,
    .button-primary,
    .form-header button,
    .form-header input[type="submit"] {
        display: none;
    }
    
    .form-header {
        border-bottom: 2px solid #333;
    }
    
    .single-test-basic-info,
    .single-test-bmi {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Button Styles */
.button,
.button-primary,
.bmi-form button,
.form-header button,
.form-header input[type="submit"] {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3);
    white-space: nowrap;
}

.button:hover,
.button-primary:hover,
.bmi-form button:hover,
.form-header button:hover,
.form-header input[type="submit"]:hover {
    background: linear-gradient(135deg, #005a87 0%, #004466 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.4);
}

.button:active,
.button-primary:active,
.bmi-form button:active,
.form-header button:active,
.form-header input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 115, 170, 0.3);
}

.submit {
    margin-top: 10px;
    display: none; /* Hidden when using form-header layout */
}

/* BMI Result Styles */
.bmi-result {
    background: #f0f9ff;
    border-left: 4px solid #0073aa;
    padding: 25px;
    margin-top: 25px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.bmi-result h4 {
    margin-top: 0;
    color: #0073aa;
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.bmi-result p {
    margin: 10px 0;
    font-size: 1.1rem;
    line-height: 1.6;
}

.bmi-result strong {
    color: #333;
}

.bmi-result ul {
    margin: 10px 0;
}

.bmi-result ul li {
    line-height: 20px;
    }
    
    .form-header {
        flex-direction: row;
        gap: 10px;
    }
    
    .form-header h3 {
        font-size: 1.4rem;
    }
    
    .form-header button,
    .form-header input[type="submit"] {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .form-row-2col {
        gap: 1.8;
}

/* Responsive Design - Tablet */
@media screen and (max-width: 768px) {
    .single-test-basic-info,
    .single-test-bmi {
        padding: 15px;
    }
    
    .basic-info-table th,
    .bmi-form table th {
        width: 40%;
     form-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .form-header h3 {
        font-size: 1.3rem;
    }
    
    .form-header button,
    .form-header input[type="submit"] {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
    }
    
    .form-row-2col {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-grid {
        gap: 15px;
    }
    
    .single-test-basic-info h3,
    .single-test-bmi h3 {
        font-size: 1.3rem;
        padding-bottom: 10px;
        margin-bottom: 18px;
    }
    
    .basic-info-table,
    .bmi-form table {
        display: block;
    }
    
    .basic-info-table tr,
    .bmi-form table tr {
        display: flex;
        flex-direction: column;
        margin-bottom: 15px;
        border-bottom: 2px solid #e5e5e5;
        padding-bottom: 12px;
    }
    
    .basic-info-table th,
    .basic-info-table td,
    .bmi-form table th,
    .bmi-form table td {
        display: block;
        width: 100%;
        padding: 8px 0;
        text-align: left;
    }
    
    .basic-info-table th,
    .bmi-form table th {
        font-size: 0.95rem;
        padding-bottom: 8px;
    }
    
    .basic-info-table input[type="date"],
    .basic-info-table select,
    .bmi-form input[type="number"],
    .form-field input[type="date"],
    .form-field select,
    .form-field table tr {
        display: flex;
        flex-direction: column;
        margin-bottom: 15px;
        border-bottom: 2px solid #e5e5e5;
        padding-bottom: 12px;
    }
    
    .basic-info-table th,
    .basic-info-table td,
    .bmi-form table th,
    .bmi-form table td {
        display: block;
        width: 100%;
        padding: 8px 0;
        text-align: left;
    }
    
    .basic-info-table th,
    .bmi-form table th {
        font-size: 0.95rem;
        padding-bottom: 8px;
    }
    
    .basic-info-table input[type="date"],
    .basic-info-table select,
    .bmi-form input[type="number"] {
        max-width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .button,
    .button-primary,
    .bmi-form button {
        width: 100%;
        padding: 16px;
        font-size: 1.1rem;
    }
    
    .bmi-result {
        padding: 18px;
    }
    
    .bmi-result h4 {
        font-size: 1.2rem;
    }
    
    .bmi-result p {
        font-size: 1rem;
    }
    
    #gender-labels {
        max-width: 100%;
    }
}

/* Extra Small Devices */
@media screen and (max-width: 360px) {
    .single-test-basic-info h3,
    .single-test-bmi h3,
    .form-header h3 {
        font-size: 1.15rem;
    }
    
    .form-header button,
    .form-header input[type="submit"] {
        font-size: 0.9rem;
        padding: 12px;
    }
    
    .bmi-result ul li {
        font-size: 0.85rem;
    }
}

/* Accessibility Improvements */
label {
    cursor: pointer;
}

input:focus,
select:focus,
button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.single-test-basic-info,
.single-test-bmi {
    animation: fadeIn 0.5s ease-out;
}

.bmi-result {
    animation: fadeIn 0.6s ease-out;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Success Message */
.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    color: #155724;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-out;
}

/* Error Message */
.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-out;
}

.success-message p,
.error-message p {
    margin: 0;
    font-weight: 500;
}

}