/* CSS Document - Rhesus Genotype Analysis */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    display: flex;
    flex-direction: column;
	height: auto;
    /*min-height: 100vh;*/
    text-align: center;
    padding-top: 60px; /* Account for fixed nav */
}

/* Navigation Styles */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #2c3e50;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 100%;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo a {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    transition: color 0.3s ease;
}

.nav-logo a:hover {
    color: #4e90d2;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-menu > li {
    position: relative;
    margin: 0 10px;
    list-style: none;
}

.nav-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    padding: 10px 5px;
    transition: color 0.3s ease;
    display: block;
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #4e90d2;
}

/* Dropdown Menu Styles */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    display: flex !important;
    align-items: center;
    gap: 5px;
}

.dropdown-toggle .arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.dropdown-toggle.active .arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #34495e;
    min-width: 250px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: none;
    margin-top: 10px;
    border-radius: 4px;
    padding: 0;
    list-style: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu li {
    margin: 0;
    list-style: none;
}

.dropdown-menu a {
    padding: 12px 20px;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    color: #fff;
}

.dropdown-menu a:hover {
    background-color: #2c3e50;
    color: #4e90d2;
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    width: 35px;
    height: 35px;
    justify-content: center;
    align-items: center;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 3px 0;
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Container */
.container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    margin: 20px auto;
    flex: 1;
}

/* Typography */
h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

h2 {
    font-size: 1.1rem;
    font-weight: normal;
    color: #555;
    margin-bottom: 30px;
}

/* Form Styles */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.label-button-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 15px;
}

label {
    font-size: 1rem;
    margin-right: 10px;
    text-align: left;
    width: 30px;
    font-weight: bold;
}

.button-container {
    display: inline-flex;
    gap: 10px;
}

/* Button Styles */
.button-container button,
input[type="submit"] {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
}

.button-container button {
    width: 35px;
    height: 35px;
    padding: 8px;
    font-size: 1.2rem;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
}

.button-container button:hover {
    background-color: #e2e2e2;
    box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.3);
}

.button-container button.selected {
    background-color: #4e90d2;
    color: white;
    border-color: #4e90d2;
}

/* Focus states for accessibility */
.button-container button:focus {
    outline: 2px solid #4e90d2;
    outline-offset: 2px;
}

.button-container button:focus:not(:focus-visible) {
    outline: none;
}

/* Submit Button */
input[type="submit"] {
    background-color: #4e90d2;
    color: white;
    font-weight: bold;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    width: 100%;
    margin-top: 10px;
}

input[type="submit"]:hover {
    background-color: #357ab7;
    box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.3);
}

input[type="submit"]:focus {
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
}

/* Loading Message */
.loading-message {
    color: #4e90d2;
    font-weight: bold;
    margin-top: 10px;
}

/* Result Styles */
.result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    font-size: 1.1rem;
}

.result.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.result.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.result p {
    margin: 10px 0 5px 0;
    font-size: 0.9rem;
    font-weight: normal;
}

.result a {
    color: #4e90d2;
    text-decoration: none;
}

.result a:hover {
    text-decoration: underline;
}

/* Footer */
.footer-basic {
    padding: 40px 0;
    color: #4b4c4d;
    width: 100%;
    background-color: #fff;
    margin-top: auto;
}

.footer-basic .copyright {
    margin-top: 15px;
    text-align: center;
    font-size: 10px;
    color: #aaa;
    margin-bottom: 0;
}

.footer-basic a[href^="mailto:"] {
    color: #aaa;
    text-decoration: none;
}

.footer-basic a[href^="mailto:"]:hover {
    color: #4e90d2;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background-color: #2c3e50;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 20px 0;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu > li {
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        width: 100%;
    }

    .nav-menu a {
        padding: 15px 20px;
        font-size: 1.1rem;
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        background-color: #1e2b3a;
        margin: 0;
        border-radius: 0;
        width: 100%;
    }

    .dropdown-menu.show {
        display: block;
    }

    .dropdown-menu a {
        padding-left: 40px;
        font-size: 1rem;
    }

    .dropdown-toggle {
        justify-content: space-between;
        width: 100%;
    }

    .dropdown-toggle .arrow {
        margin-left: auto;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    
    h2 {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    .button-container button {
        width: 50px;
        height: 35px;
        font-size: 1rem;
    }
    
    .label-button-container {
        margin-bottom: 12px;
    }
    
    input[type="submit"] {
        padding: 10px 16px;
        font-size: 0.95rem;
    }
    
    .result {
        font-size: 1rem;
        padding: 12px;
    }
    
    .result p {
        font-size: 0.85rem;
    }
}

/* Print Styles */
@media print {
    body {
        background-color: white;
        padding-top: 0;
    }

    .main-nav {
        display: none;
    }
    
    .container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .button-container button {
        border: 2px solid #333;
    }
    
    .button-container button.selected {
        background-color: #333 !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    input[type="submit"],
    .loading-message {
        display: none;
    }
    
    .footer-basic {
        display: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .button-container button {
        border-width: 2px;
    }
    
    .button-container button.selected {
        background-color: #000;
        color: #fff;
        border-color: #000;
    }
    
    input[type="submit"] {
        background-color: #000;
        color: #fff;
    }

    .main-nav {
        border-bottom: 2px solid #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
