/* Base styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    margin: 0;
    padding: 0;
}

/* Navigation */
.topnav {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 1.5rem;
    position: relative;
    height: 48px; /* Fixed height to prevent shifting */
}

.nav-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
    grid-column: 2;
    width: 300px; /* Fixed width for consistent spacing */
}

/* Add a placeholder for the reset button on pages where it doesn't exist */
.nav-container::after {
    content: "";
    width: 32px;
    height: 32px;
    visibility: hidden;
}

.topnav a {
    color: #666;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

.topnav a:hover {
    color: #333;
    background-color: #f5f7fa;
}

.topnav a.active {
    color: #2563eb;
    font-weight: 500;
}

.topnav .reset-button {
    position: absolute;
    right: 1.5rem;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.topnav .reset-button:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #4b5563;
    transform: rotate(-180deg);
}

.topnav .reset-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Main container */
.main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
}

h2 {
    text-align: center;
    color: #1f2937;
    margin-bottom: 2rem;
    font-size: 1.75rem;
}

/* Forms */
form {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.p-title {
    color: #1f2937;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.form-control {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background-color: #f8fafc;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.form-control:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    background-color: #f1f5f9;
}

.label-name {
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 500;
    padding-right: 0.5rem;
    border-right: 1px solid #e5e7eb;
}

/* Input fields */
input[type="number"],
input[type="text"],
select {
    width: 100px;
    padding: 0.4rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9rem;
    background-color: #fff;
    transition: all 0.2s ease;
    margin: 0 auto;
    display: block;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

input[type="number"]:hover,
input[type="text"]:hover,
select:hover {
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Radio groups */
.radio-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #4b5563;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
    background-color: #fff;
    min-width: 70px;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.radio-group label:hover {
    color: #2563eb;
    border-color: #94a3b8;
    background-color: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.radio-group input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid #9ca3af;
    border-radius: 50%;
    margin: 0;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    background-color: #fff;
}

.radio-group input[type="radio"]:checked {
    border-color: #2563eb;
    background-color: #fff;
}

.radio-group input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.6rem;
    height: 0.6rem;
    background-color: #2563eb;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.radio-group input[type="radio"]:hover {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.radio-group input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.radio-group label:has(input[type="radio"]:checked) {
    background-color: #f8fafc;
    color: #2563eb;
    border-color: #2563eb;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

/* Button container */
.button-container {
    display: flex;
    justify-content: center;
    margin: 2rem auto;
    max-width: 800px;
    padding: 0 1.5rem;
}

/* Button */
button {
    display: block;
    width: 100%;
    padding: 1rem 2rem;
    background-color: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    position: relative;
    overflow: hidden;
}

button:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

/* Reset button */
.reset-button {
    background-color: #ef4444;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.reset-button:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
}

.reset-button:active {
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.reset-button:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

/* References section */
.div-references {
    background-color: #f8fafc;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Results wrapper */
.results-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

/* Results section */
#results-form {
    animation: fadeIn 0.5s ease-in-out;
    width: 100%;
    padding: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

.results-title {
    text-align: center;
    color: #1f2937;
    font-size: 1.25rem;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    width: 100%;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background-color: #f8fafc;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.result-item:hover {
    background-color: #f1f5f9;
    transform: translateX(3px);
}

.result-item .label-name {
    min-width: 180px;
    margin: 0;
    flex-shrink: 0;
    font-size: 0.9rem;
    text-align: right;
    padding-right: 1rem;
}

.result-item p {
    margin: 0;
    font-weight: 600;
    color: #2563eb;
    font-size: 1rem;
    flex-grow: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Results section */
#dipss, #dipss-plus, #mips, #mips-plus, #mtss {
    font-weight: 500;
    color: #2563eb;
}

/* GDPR Banner */
.gdpr-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    padding: 1rem;
    z-index: 1000;
    display: none; /* Hide by default */
}

.gdpr-banner.show {
    display: block; /* Show when the 'show' class is added */
}

.gdpr-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.gdpr-text {
    margin: 0;
    font-size: 0.9rem;
    color: #4b5563;
}

.gdpr-buttons {
    display: flex;
    gap: 1rem;
}

.gdpr-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.accept-button {
    background-color: #2563eb;
    color: #fff;
}

.accept-button:hover {
    background-color: #1d4ed8;
}

.reject-button {
    background-color: #f3f4f6;
    color: #4b5563;
}

.reject-button:hover {
    background-color: #e5e7eb;
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        padding: 0.5rem;
    }
    
    .topnav a {
        width: 100%;
        text-align: center;
        padding: 0.75rem;
    }
    
    .form-control {
        grid-template-columns: 1fr;
    }
    
    .main-container {
        padding: 1rem;
    }
    
    button {
        width: 100%;
    }

    .gdpr-content {
        flex-direction: column;
        text-align: center;
    }

    .gdpr-buttons {
        width: 100%;
        justify-content: center;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .result-item .label-name {
        min-width: auto;
    }
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Focus styles for better accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (forced-colors: active) {
    .topnav a {
        border: 1px solid currentColor;
    }
}

/* Loading state */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #2563eb;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Results table */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.results-table th,
.results-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.results-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #1f2937;
}

.results-table tr:last-child td {
    border-bottom: none;
}

.results-table td:first-child {
    font-weight: 500;
    color: #4b5563;
}

.results-table td:last-child {
    color: #2563eb;
    font-weight: 600;
}

.results-table tr:hover {
    background-color: #f8fafc;
}

/* Export button */
.export-button {
    display: block;
    width: 200px;
    margin: 2rem auto 0;
    padding: 0.75rem 1.5rem;
    background-color: #10b981;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.export-button:hover {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}

.export-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.export-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

/* Remove old header container styles */
.header-container {
    display: none;
}

/* Content Card */
.content-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.page-title {
    color: #1f2937;
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin: 0 0 2rem 0;
    padding: 0;
    line-height: 1.2;
}

.page-subtitle {
    color: #4b5563;
    font-size: 1.5rem;
    font-weight: 500;
    margin-top: -1rem;
    margin-bottom: 1rem;
    text-align: center;
    font-style: italic;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.subtitle-grey-italic {
  font-style: italic;
  color: #888;
}

/* About Page Styles */
.about-content {
    max-width: 700px;
    margin: 0 auto;
}

.about-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f8fafc;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.about-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.about-section h2 {
    color: #2563eb;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: left;
    border-bottom: none;
}

.about-section p {
    color: #4b5563;
    line-height: 1.7;
    margin: 0;
}

.contact-link, .developer-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.contact-link:hover, .developer-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* References Page Styles */
.references-content {
    max-width: 700px;
    margin: 0 auto;
}

.reference-item {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background-color: #f8fafc;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.reference-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.reference-text {
    margin: 0;
    line-height: 1.7;
}

.reference-text .authors {
    color: #1f2937;
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.reference-text .title {
    color: #4b5563;
    display: block;
    margin-bottom: 0.5rem;
}

.reference-text .journal {
    color: #6b7280;
    font-style: italic;
    margin-right: 0.5rem;
}

.reference-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.reference-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .content-card {
        padding: 1.5rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .about-section, .reference-item {
        padding: 1rem;
    }

    .about-section h2 {
        font-size: 1.25rem;
    }
}