/* This file is separated into sections, written in order of how they appear on
   the screen (top to bottom) */

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, sans-serif;
    background: #fbfcfd;
}

textarea {
    font-family: inherit;
    font-size: 14px;
    width: 100%;
    min-height: 124px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
}

button {
    transition: all 0.2s ease;
    background: #193cb8;
    font-size: 14px;
    font-weight: 500;
}

a {
    transition: all 0.2s ease;
}

/* Header */

header {
    background: white;
    border-bottom: 1px solid lightgrey;
}

nav {
    display: flex;
    justify-content: space-between;
    max-width: 1000px;
    margin: 0 auto;
    /* padding: 20px; */
}

#header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

#website-title {
    display: inline-block;
    font-weight: bold;
    font-size: 20px;
    color: #193cb8;
    text-decoration: none;
    padding: 20px;
}

a.nav-link {
    padding-inline: 10px;
    padding-block: 20px;
}

a.nav-link:hover {
    transform: translateY(-1px);
}

a.nav-link:active {
    transform: translateY(0px);
}

/* Newsletter (from style_index.css) */

.newsletter-bar {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
    border-bottom: 1px solid rgba(21, 47, 163, 0.1);
    padding: 12px 0;
    margin-bottom: 24px;
    max-width: 1000px;
    margin: auto;
}

.newsletter-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.newsletter-text {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.newsletter-icon {
    font-size: 18px;
    color: #152FA3;
}

.newsletter-message {
    font-size: 14px;
    font-weight: 500;
    color: #152FA3;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .newsletter-message {
        white-space: normal;
        text-align: center;
        line-height: 1.4;
    }
}

.newsletter-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.newsletter-input {
    padding: 8px 12px;
    border: 1px solid rgba(21, 47, 163, 0.2);
    border-radius: 6px;
    font-size: 14px;
    width: 200px;
    background-color: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.newsletter-input:focus {
    outline: none;
    border-color: #152FA3;
    box-shadow: 0 0 0 2px rgba(21, 47, 163, 0.1);
}

.newsletter-input::placeholder {
    color: #9ca3af;
    font-size: 14px;
}

.newsletter-btn {
    padding: 8px 16px;
    background-color: #152FA3;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.newsletter-btn:hover {
    background-color: #0d1f6b;
    transform: translateY(-1px);
}

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

/* Responsive design for newsletter bar */
@media (max-width: 768px) {
    .newsletter-content {
        flex-direction: column;
        gap: 12px;
        padding: 0 16px;
    }

    .newsletter-text {
        justify-content: center;
    }

    .newsletter-message {
        font-size: 11px;
    }

    .newsletter-form {
        width: 100%;
        justify-content: center;
    }

    .newsletter-input {
        flex: 1;
        max-width: 250px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .newsletter-bar {
        padding: 10px 0;
    }

    .newsletter-content {
        padding: 0 12px;
        gap: 10px;
    }

    .newsletter-message {
        font-size: 12px;
        text-align: center;
    }

    .newsletter-form {
        /* flex-direction: column; */
        width: 100%;
        gap: 8px;
    }

    .newsletter-input {
        width: 100%;
        max-width: none;
    }

    .newsletter-btn {
        /* width: 100%; */
        padding: 10px 16px;
    }
}

/* Title */

div#title {
    margin-top: 30px;
}

div#title > h1 {
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
}

div#title > p {
    text-align: center;
}

/* Main section */

.form-card {
    max-width: 800px;
    margin-top: 24px;
    margin-inline: auto;
    background: white;
    box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(150, 150, 150, 0.25);
    border-radius: 16px;
    padding: 20px;
}

.form-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
}

.sub-heading {
    margin-top: 16px;
    color: #314158;
    font-weight: 600;
    font-size: 14px;
}

.main-button-row {
    display: flex;
    margin-top: 12px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 6px;
}

.main-button-row > button {
    flex: 1;
    padding: 6px;
    border: none;
    background: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.main-button-row > button:not(:last-child) {
    border-right: 1px solid;
    border-color: #cad5e2;
}

.accordion-body-button > button:hover {
    background: #0d1f6b !important;
    border-color: #0d1f6b !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(21, 47, 163, 0.3);
}

.accordion-body-button > button:active {
    transform: translateY(0);
}

.main-button-row > button:hover,
.main-button-row > button:active {
    color: #0f172a !important;
    background: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(21, 47, 163, 0.3);
}

.main-button-row > button.selected {
    color: #0f172a !important;
    background: white !important;
    box-shadow: 0 2px 4px rgba(21, 47, 163, 0.3);
}

.main-button-row > button:active {
    transform: translateY(0);
}

/* Output area */

#output-container {
    /* color: #62748e; */
    color: #0f172a;
    background: #f8fafc;
    border-radius: 6px;
    margin-block: 20px;
    font-size: 14px;
    border: 1px solid lightgrey;
}

#output-placeholder {
    padding: 16px;
}

.btn-large, .btn-large:focus {
    width: 100%;
    padding: 8px 16px;
    background: #152FA3;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}

.btn-large:hover {
    background: #0d1f6b !important;
    color: white !important;
    transform: translateY(-1px);
}

.btn-large:active {
    background: #0d1f6b !important;
    color: white !important;
    transform: translateY(0);
}

#output-disclaimer {
    padding: 0 16px 20px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #62748e;
}

#disclaimer {
    padding: 16px 16px 0 16px;
    font-size: 14px;
    font-weight: 400;
    font-style: italic;
    color: #62748e;
}

#disclaimer a {
    font-weight: 500;
    text-decoration: none;
}

#disclaimer a:hover {
    text-decoration: underline;
}

#print-icon {
    float: right;
    margin: 6px;
    cursor: pointer;
    padding: 6px;
    width: 42px;
    height: 42px;
    text-align: center;
    font-size: 18px;
    border-radius: 6px;
    border: 1px solid lightgrey;
    background: white;
    transition: all 0.2s ease;
}

#print-icon:hover {
    box-shadow: 0 4px 8px rgba(21, 47, 163, 0.3);
    transform: translateY(-1px);
}

#print-icon:active {
    transform: translateY(0);
}

/* Loader */

.loader {
    display: none;
    margin-top: 16px;
}

.loader-spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #152FA3;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    margin: 0 auto 15px auto;
    animation: spin 1.5s linear infinite;
}

.loader-text {
    font-size: 16px;
    color: #152FA3;
    font-weight: 500;
    margin-block: 14px;
    text-align: center;
}

.loader-dots {
    display: inline-block;
}

.loader-dots::after {
    content: '';
    animation: loader-dots 1.5s infinite;
}

@keyframes loader-dots {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
    100% { content: '.'; }
}

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

/* Accordion */

.accordion-item {
    display: none;
    background: #f8fafc;
    margin: 16px;
    border-top: 0;
    border-right: 0;
    border-bottom: 1px solid #dee2e6 !important;
    border-left: 0;
}

.accordion-flush.example .collapsed {
    font-weight: normal;
    font-style: italic;
    color: rgb(110, 110, 110);
    filter: saturate(0.75);
}

.accordion-collapse {
    font-size: 14px;
    padding: 8px 0 16px 0;
    max-height: 400px;
    overflow-y: auto;
}

.accordion-collapse:not(.show) {
    display: none;
}

.accordion-body-button {
    display: flex;
    margin-top: 12px;
    gap: 8px;
}

.accordion-body-button > button {
    flex: 1;
    background: #193cb8;
    font-size: 14px;
}

.accordion-header {
    border-color: white;
    background: #f8fafc;
}

.accordion-button {
    background: #f8fafc;
    color: #1d293d;
    border-color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 0 0 16px 0;
    border: 0;
    border-bottom: 10px;
    text-decoration: none;
}

.accordion-button::after {
    --bs-accordion-btn-icon-width: 0.85rem;
}

.accordion-button:hover:not(:disabled) {
    text-decoration: underline;
}

.accordion-button:not(.collapsed) {
    font-weight: 700;
}

.accordion-button:focus,
.accordion-button:active,
.accordion-button:not(.collapsed) {
    background: #f8fafc;
    color: #1d293d;
    border-color: white;
    outline: none;
    box-shadow: none;
}

.collapsing {
  transition: none !important; 
}

.badge {
    display: inline-block;
    color: white;
    padding: 5px 9px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

.badge.most-likely {
    /* background: #4F6CE1; */
    background: #152FA3;
}

.badge.possible {
    /* background: #6E7BC4; */
    background: #4F6CE1;
}

.badge.nice {
    color: #007a55;
    background: #ecfdf5;
    font-size: 10px;
    border: 1px solid #d0fae5;
    margin-left: 0;
    margin-right: 10px;
    width: 42px;
}

.badge.web {
    color: #6b6b00;
    background: #fbff60;
    font-size: 10px;
    border: 1px solid #ebedb3;
    margin-left: 0;
    margin-right: 10px;
    min-width: 42px;
}

.spacer {
    margin-right: 10px;
    width: 42px;
}

/* BNF Guide */

.bnf-drug-container {
    background: white;
    /* border-radius: 9px; */
    border: 1px solid rgba(150, 150, 150, 0.25);
    box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px -1px rgba(0, 0, 0, 0.1);
    /* margin-inline: 8px; */
    /* margin-bottom: 8px; */
    font-size: 14px;
}

.bnf-drug-container b {
    font-weight: 500;
}

.bnf-drug-container .top {
    display: flex;
    align-items: start;
    background: #f1f5f9;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid rgba(150, 150, 150, 0.25);
    padding: 8px;
}

.bnf-drug-container .badge.num-badge {
    font-size: 16px;
    border-radius: 100%;
    aspect-ratio: 1;
    height: 28px;
    padding: 5px 0;
    margin-left: 0px;
    margin-right: 12px;
    background: #4F6CE1;
    /* background: #152FA3; */
}

.bnf-drug-container .content {
    display: flex;
    padding: 8px 12px;
}

.bnf-drug-container .drug-name {
    font-weight: 600;
    padding-right: 12px;
}

.bnf-drug-container .dosage {
    border-left: 1px solid rgba(150, 150, 150, 0.5);
    padding-left: 12px;
}

.bnf-drug-container .warning {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%);
    border: 1px solid #ffeeba;
    border-radius: 6px;
    margin: 0 8px 8px 8px;
    padding: 2px 4px;
    font-size: 13px;
    font-weight: 500;
    font-style: italic;
}

.bnf-drug-container .warning > * {
    padding-block: 4px;
}

.bnf-drug-container .warning .logo {
    color: #856404;
    font-size: 14px;
    margin-right: 12px;
}

#referral-container h4 {
    padding: 16px 16px 4px 16px;
}

#referral-text {
    padding: 16px;
}

#referral-text h3 {
    font-size: 22px;
}

#referral-text h2 {
    font-size: 26px;
}

#referral-text h1 {
    font-size: 30px;
}

/* Info cards */

#info-cards {
    margin-top: 50px;
    margin-inline: auto;
    padding-inline: 25px;
    max-width: 800px;
    color: #1c398e;
    display: flex;
    justify-content: space-between;
    text-align: center;
    align-items: stretch;
    gap: 24px;
    font-size: 18px;
}

.info-card {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    flex-basis: 0;
    gap: 12px;
    justify-content: center;
    padding: 16px 24px;
    background: white;
    box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(150, 150, 150, 0.25);
    border-radius: 9px;
    transition: all 0.2s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(21, 47, 163, 0.18);
}

.info-card-title {
    font-size: 18px;
}

/* FAQ section */

#faq-section {
    max-width: 800px;
    margin: 50px auto;
}

#faq-title {
    /* color: #1c398e; */
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
}

#faq-section .accordion-item {
    border-radius: 9px;
    background: white;
    border: 1px solid rgba(150, 150, 150, 0.25);
    box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px -1px rgba(0, 0, 0, 0.1);
    margin: 12px 9px;
}

#faq-section .accordion-header {
    background: none;
}

#faq-section .accordion-button {
    background: none;
    padding: 18px;
    color: #1c398e;
}

#faq-section .accordion-collapse {
    padding: 0;
}

#faq-section .accordion-body {
    border-top: 1px solid lightgrey;
    padding: 15px 18px 18px 18px;
}

#faq-section .accordion-body p:last-child {
    margin-bottom: 0;
}

#faq-section .accordion-body b {
    font-weight: 600;
}

/* Footer */

footer {
    background: white;
    margin-top: 36px;
    border-top: 1px solid lightgrey;
    height: 64px;
    padding-inline: 16px;
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    text-align: center;
    color: grey;
}

footer > * {
    width: 100%;
}

footer.mobile {
    display: none;
    flex-direction: column;
    margin-top: 30px;
    padding-inline: 16px;
    gap: 16px;
}

footer.mobile > #footer-links {
    padding-top: 16px;
}

footer.mobile > .footer-info {
    display: flex;
    justify-content: space-between;
    padding-top: 16px;
    padding-bottom: 18px;
    border-top: 1px solid lightgrey;
}

#footer-links {
    display: flex;
    justify-content: center;
    text-wrap: nowrap;
    flex-wrap: wrap;
    gap: 8px;
}

#footer-links > a {
    color: grey;
    text-decoration: none;
}

#footer-links > a:hover {
    color: #152fa3;
    text-decoration: underline;
}

/* Mobile responsive */

@media only screen and (max-width: 600px) {
    #header-right {
        margin-right: 12px;
    }

    div#title {
        padding-inline: 12px;
    }

    .main-button-row > button {
        font-size: 12px;
    }

    .form-card {
        border-radius: 0;
        padding: 9px;
        padding-bottom: 20px;
        /* margin-inline: 9px; */
    }

    .form-title {
        padding-left: 3px;
        margin-bottom: 15px;
    }

    #info-cards {
        flex-direction: column;
        margin-top: 30px;
    }

    footer.desktop {
        display: none;
    }

    footer.mobile {
        display: flex;
    }
}
