* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #414e5b;
    --color-focus-form: #86b7fe;
    --color-btn-primary: #2cacba;
    --color-border: #ced4da;
    --color-link: #1091a0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
    background-color: #f0f4f8;
    color: var(--color-primary);
}

h1 {
    color: var(--color-primary);
    margin-bottom: 30px;
    font-size: 2em;
    text-shadow: 0 2px 2px rgba(0, 70, 116, 0.1);
}

h2 {
    color: var(--color-primary);
    margin-bottom: 15px;
    font-size: 1.5rem;
    text-shadow: 0 2px 2px rgba(0, 70, 116, 0.1);
}

a {
    text-decoration: none;
    color: var(--color-primary);
    margin-right: 15px;
}

.input-group {
    margin-bottom: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 70, 116, 0.15);
}

.input-group.accordion-empty {
    margin: 10px;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--color-primary);
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    margin-bottom: 10px;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--color-primary);
    transition: border-color 0.3s ease;
    background-color: white;
}
input::placeholder {
    opacity: 0.5;
    color: rgb(128, 128, 128);
}
input[type="number"],
input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    font-size: 1em;
    color: var(--color-primary);
    transition: border-color 0.3s ease;
    background-color: white;
}

textarea:focus,
input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--color-focus-form);
    box-shadow: 0 0 0 2px rgba(84, 216, 163, 0.2);
}

button {
    padding: 12px 24px;
    background: var(--color-btn-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: transform 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 3px 6px rgba(0, 70, 116, 0.2);
    position: relative;
    overflow: hidden;
}

button:hover {
    background: #003557;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 70, 116, 0.25);
}

.diagnoses {
    margin-top: 30px;
}

.diagnoses-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 70, 116, 0.15);
    overflow: hidden;
}

.recommended-services-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px 15px rgba(0, 70, 116, 0.15);
    overflow: hidden;
}

.recommended-services-table.alternative {
    margin-top: 10px;
    box-shadow: unset;
}

.recommended-services-table th,
.recommended-services-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.recommended-services-table td:nth-child(2),
.recommended-services-table td:nth-child(3) {
    text-align: center;
}

.recommended-services-table th {
    background-color: #e3f2fd;
    font-weight: 600;
    color: var(--color-primary);
    border-bottom: 2px solid #004674;
    font-size: 18px;
}

.recommended-services-table td {
    vertical-align: middle;
}

#recommendation-name {
  word-wrap: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
  word-break: break-word;
  padding: 8px;
}

.recommended-services-table tr:nth-child(even) {
    background-color: #f8fafb;
}

.recommended-services-table tbody tr:hover {
    background-color: #e3f2fd !important;
}

.hidden-row {
    text-decoration: line-through;
    color: grey;
}

.diagnoses-table th,
.diagnoses-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.diagnoses-table th {
    background-color: #e3f2fd;
    font-weight: 600;
    color: var(--color-primary);;
    border-bottom: 2px solid #004674;
}

.diagnoses-table td {
    vertical-align: middle;
}

.diagnoses-table tr:nth-child(even) {
    background-color: #f8fafb;
}

.diagnoses-table tbody tr:hover {
    background-color: #e3f2fd !important;
}

.diagnoses-table td:last-child {
    text-align: center;
}

.analyze-button {
    padding: 10px 20px;
    background-color: var(--color-btn-primary);
    color: white;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
    min-width: 120px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.analyze-button:hover {
    background-color: #003557;
}

.analyze-button.active {
    background-color: #54d8a3;
    color: #004674;
    border-color: #004674;
}

.diagnoses-list {
    list-style-position: inside;
    padding: 0;
}

.diagnoses-list li {
    margin-bottom: 15px;
}

.diagnosis-info {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 70, 116, 0.1);
    width: calc(100% - 30px);
    margin-left: 10px;
}

.diagnosis-toggle {
    margin: 0;
    background: white;
    border: 1px solid #54d8a3;
    color: #004674;
    min-width: 300px;
    text-align: left;
}

.diagnosis-toggle:hover {
    background: #f0fff8;
}

.diagnosis-toggle.active {
    background: #004674;
    border-color: #004674;
    color: white;
}

.icd-code,
.confidence {
    color: #004674;
    font-size: 0.9em;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #54d8a3;
}

.highlighted {
    padding: 3px 5px;
    border-radius: 4px;
    display: inline;
    transition: background-color 0.3s ease;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.text-display-container {
    margin-top: 15px;
    background: white;
    padding: 15px 20px 15px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 70, 116, 0.1);
    border: 2px solid #e3f2fd;
}

.text-display-label {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-primary);
}

.text-display {
    background: white;
    padding: 20px;
    border-radius: 6px;
    margin: 15px 0;
    white-space: pre-wrap;
    border: 2px solid var(--color-border);
    color: var(--color-primary);
    line-height: 1.5;
}

.text-display.with-highlighted {
    line-height: 2;
    word-wrap: break-word;
}

.speciality-block {
    display: flex;
    justify-content: end;
    margin-bottom: 1rem;
}

.speciality-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.actions {
    text-align: end;
    margin-bottom: 1rem;
}

.fields-container {
    display: flex;
    gap: 20px;
    align-items: center;
}

.remove-btn {
    background: transparent;
    padding: 0;
    box-shadow: inherit;
    transition: transform 0.2s ease;
    top: 8px;
}

.remove-btn:hover {
    background: transparent;
    box-shadow: inherit;
}

#required::after{
    content: " *";
    color: red;
}

#load-container {
    display: none;
    text-align: center;
}

#load {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-primary);
    border-bottom-color: #FF3D00;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    }

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

.nav-item:hover {
    color: var(--color-link);
    transition: color 0.3s ease;
}

.nav-item.active {
    background: red;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.logo-image {
    width: 300px;
    height: 100%;
    object-fit: contain;
}

.forward-wrapper {
    margin-top: 16px;
    text-align: end;
}

.forward {
    margin-right: 0;
}

.forward:hover {
    color: var(--color-link);
}

#summary-block {
    display: none
}

.accordion {
    overflow: hidden;
    margin-bottom: 12px;
    border-radius: 10px;
}

.accordion-header {
    border-radius: 10px;
    width: 100%;
    padding: 12px 15px;
    text-align: left;
    background: #f7f9fa;
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, .125);
}

.accordion-header.nested {
    font-size: 18px;
}
     
.accordion-header:hover {
    background: #e0e0e0;
}
       
.accordion-header::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s;
}
    
.accordion-header.active::after {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    background: #fff;
}
     
.accordion-content.open {
    max-height: 100%;
}
 
.nested-accordion {
    margin: 10px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease
}

.modal-wrapper {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: 95vh;
    max-width: 95vw;
    overflow: auto;
    position: relative;
    transform: translate(-20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-close-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 30px;
    height: 30px;
    cursor: pointer;
}

.modal-close-btn img {
    margin: 3px;
    width: 24px;
    height: 24px;
}

.modal-boby {
    position: relative;
}

.no-data-message__wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.no-data-message__block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.no-data-message__text {
    font-size: 15px;
    margin-top: 8px;
    color: #818c99;
}

.vertical-resize-only {
    resize: vertical;
}

#hide-recommendation {
    text-align: center;
}

.hide-icon {
    cursor: pointer;
    filter: opacity(0.5);
}

.hide-icon:hover {
    filter: opacity(0.8);
}

.action-modal__body {
    text-align: center;
}

.action-modal__header {
    margin-bottom: 12px;
}

button[type="confirm"] {
    width: 200px;
    height: 50px;
    padding: 4px 35px;
    background: #01DB9D;
}

button[type="cancel"] {
    width: 200px;
    height: 50px;
    padding: 4px 35px;
    background: #FF5A60;
}

.action-modal__control-btns {
    display: flex;
    justify-content: space-between;
    margin-top: 28px;
}