
/* ===== GLOBAL SETTINGS ===== */

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

html {
    scroll-behavior: smooth;
    background: #0f172a;
}

/* ===== GLOBAL PAGE LAYOUT ===== */

body {
    font-family: Arial, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;

    min-height: 100vh;
    min-height: 100svh;

    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}
/* ===== HEADER ===== */

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 7%;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.logo {
    font-size: 25px;
    font-weight: 800;
    color: #075985;
    text-decoration: none;
}

.main-nav {
    display: flex;
    gap: 25px;
}

.main-nav a {
    text-decoration: none;
    color: #334155;
    font-size: 15px;
    font-weight: 600;
    transition:
        color 0.3s ease,
        transform 0.3s ease;
}

.main-nav a:hover {
    color: #0284c7;
}

/* ===== NAVIGATION HOVER ANIMATION ===== */

@media (min-width: 769px) {

    .main-nav > a:hover,
    .nav-dropdown-heading > a:hover {
        transform: translateY(-2px);
    }

}

/* ===== HERO SECTION ===== */

.hero {
    min-height: 75vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 60px 20px;

    background: linear-gradient(
        135deg,
        #075985,
        #0e7490,
        #0284c7
    );

    color: #ffffff;
}

.hero p:first-child {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: clamp(36px, 6vw, 64px);
    max-width: 850px;
    line-height: 1.15;
    margin-bottom: 20px;
}

.hero p:nth-of-type(2) {
    max-width: 600px;
    font-size: 18px;
    color: #e0f2fe;
    margin-bottom: 30px;
}

/* ===== HERO BUTTON ===== */

.hero-button {
    display: inline-block;
    background: #ffffff;
    color: #075985;
    padding: 14px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: 0.3s ease;
}

.hero-button:hover {
    background: #e0f2fe;
    transform: translateY(-3px);
}


/* ===== PROFESSIONAL FOOTER ===== */

.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    font-size: 14px;
}

.footer-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 65px 7%;
}

.footer-brand h2 {
    color: #ffffff;
    font-size: 25px;
    margin-bottom: 15px;
}

.footer-brand p {
    color: #94a3b8;
    max-width: 320px;
    line-height: 1.8;
}

.footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.footer-links h3 {
    color: #ffffff;
    font-size: 17px;
    margin-bottom: 8px;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #38bdf8;
}

.footer-bottom {
    border-top: 1px solid #334155;
    text-align: center;
    padding: 20px 15px;
    color: #94a3b8;
    font-size: 13px;
}

/* ===== MOBILE RESPONSIVENESS ===== */

@media (max-width: 768px) {

    .site-header {
        flex-direction: row;
        justify-content: space-between;
        gap: 10px;
        padding: 15px 20px;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 15px;
    }
    .main-nav.active {
    display: flex;
}

    .hero {
        min-height: 65vh;
    }
}


/* ===== SERVICES SECTION ===== */

.services-section {
    padding: 90px 7%;
    background: #f8fafc;
}

.section-heading {
    text-align: center;
    max-width: 650px;
    margin: 0 auto 50px;
}

.section-heading p {
    color: #0284c7;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.section-heading h2 {
    font-size: 36px;
    color: #0f172a;
    margin-bottom: 12px;
}

.section-heading span {
    color: #64748b;
    font-size: 16px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    background: #ffffff;
    padding: 35px 28px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.12);
}

.service-icon {
    font-size: 38px;
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 21px;
    color: #0f172a;
    margin-bottom: 12px;
}

.service-card p {
    color: #475569;
    font-size: 15px;
    margin-bottom: 22px;
}

.service-card a {
    color: #0369a1;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

.service-card a:hover {
    color: #0c4a6e;
}

/* ===== RESPONSIVE SERVICES GRID ===== */

@media (max-width: 900px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .services-section {
        padding: 65px 20px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .section-heading h2 {
        font-size: 29px;
    }
}

/* ===== PROJECTS SECTION ===== */

.projects-section {
    padding: 90px 7%;
    background: #ffffff;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.13);
}

.project-visual {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.project-visual span {
    font-size: 65px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.85);
}

.project-one {
    background: linear-gradient(135deg, #075985, #38bdf8);
}

.project-two {
    background: linear-gradient(135deg, #7c3aed, #c084fc);
}

.project-three {
    background: linear-gradient(135deg, #047857, #34d399);
}

.project-info {
    padding: 25px;
}

.project-info p {
    color: #0284c7;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.project-info h3 {
    color: #0f172a;
    font-size: 21px;
    margin-bottom: 10px;
}

.project-info > span {
    color: #475569;
    font-size: 14px;
}

/* ===== RESPONSIVE PROJECT GRID ===== */

@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .projects-section {
        padding: 65px 20px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-visual {
        height: 190px;
    }
}


/* ===== BLOG SECTION ===== */

.blog-section {
    padding: 90px 7%;
    background: #f8fafc;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto;
}

.blog-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.12);
}

/* BLOG IMAGE AREA */

.blog-image {
    height: 210px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.blog-image span {
    font-size: 65px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.85);
}

.blog-image-one {
    background: linear-gradient(135deg, #075985, #38bdf8);
}

.blog-image-two {
    background: linear-gradient(135deg, #7c3aed, #c084fc);
}

.blog-image-three {
    background: linear-gradient(135deg, #047857, #34d399);
}

/* BLOG CONTENT */

.blog-content {
    padding: 25px;
}

.blog-category {
    color: #0284c7;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.blog-content h3 {
    color: #0f172a;
    font-size: 20px;
    line-height: 1.4;
    margin-bottom: 12px;
}

.blog-content > p:not(.blog-category) {
    color: #475569;
    font-size: 14px;
    margin-bottom: 20px;
}

.blog-content a {
    color: #0369a1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.blog-content a:hover {
    color: #0c4a6e;
}

/* RESPONSIVE BLOG GRID */

@media (max-width: 900px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .blog-section {
        padding: 65px 20px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== CONTACT SECTION ===== */

.contact-section {
    padding: 90px 7%;
    background: #f8fafc;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start;
}

/* CONTACT INFORMATION */

.contact-label {
    color: #0284c7;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.contact-info h2 {
    font-size: 36px;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 20px;
}

.contact-description {
    color: #64748b;
    font-size: 16px;
    margin-bottom: 35px;
}

.contact-detail {
    margin-bottom: 25px;
}

.contact-detail h3 {
    color: #0f172a;
    font-size: 17px;
    margin-bottom: 5px;
}

.contact-detail p {
    color: #64748b;
    font-size: 15px;
}

/* CONTACT FORM CONTAINER */

.contact-form-container {
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.06);
}

.contact-form-container h2 {
    color: #0f172a;
    font-size: 27px;
    margin-bottom: 10px;
}

.contact-form-container > p {
    color: #64748b;
    font-size: 15px;
    margin-bottom: 30px;
}

/* FORM FIELDS */

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    font-size: 15px;
    color: #1e293b;
    background: #ffffff;
    outline: none;
    transition: border-color 0.3s ease,
                box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

/* SUBMIT BUTTON */

.contact-submit {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background: #075985;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s ease,
                transform 0.3s ease;
}

.contact-submit:hover {
    background: #0369a1;
    transform: translateY(-2px);
}

/* RESPONSIVE CONTACT SECTION */

@media (max-width: 900px) {

    .contact-container {
        grid-template-columns: 1fr;
        gap: 45px;
    }

}

@media (max-width: 600px) {

    .contact-section {
        padding: 65px 20px;
    }

    .contact-info h2 {
        font-size: 29px;
    }

    .contact-form-container {
        padding: 25px 20px;
    }

    .contact-form-container h2 {
        font-size: 23px;
    }

}

/* ===== CONTACT FORM FEEDBACK ===== */

#form-status {
    margin-top: 18px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

/* DISABLED SUBMIT BUTTON */

.contact-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    opacity: 0.8;
}


/* ===== ACTIVE NAVIGATION LINK ===== */

.main-nav a.active,
.nav-dropdown-heading a.active {
    color: #0284c7;
    position: relative;
}

.main-nav a.active::after,
.nav-dropdown-heading a.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 100%;
    height: 2px;
    background: #0284c7;
    border-radius: 2px;
}

/* ===== ACTIVE UNDERLINE ANIMATION ===== */

.main-nav a::after,
.nav-dropdown-heading a::after {
    transition: width 0.3s ease;
}

/* ===== NAVIGATION HOVER UNDERLINE ===== */

@media (min-width: 769px) {

    .main-nav > a:not(.active)::after,
    .nav-dropdown-heading > a:not(.active)::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: -8px;
        width: 0;
        height: 2px;
        background: #0284c7;
        border-radius: 2px;
        transition: width 0.3s ease;
    }

    .main-nav > a:not(.active):hover::after,
    .nav-dropdown-heading > a:not(.active):hover::after {
        width: 100%;
    }

}
/* ===== MOBILE MENU BUTTON ===== */

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #075985;
    cursor: pointer;
    padding: 5px 10px;
}

/* ===== MOBILE MENU VISIBILITY FIX ===== */

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
}


/* ===== FLOATING MOBILE NAVIGATION ===== */

@media (max-width: 768px) {

    .site-header {
        position: relative;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .menu-toggle {
        display: block;
        position: relative;
        z-index: 1001;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        right: 7%;
        width: min(260px, 86vw);
        background: #ffffff;
        padding: 15px;
        border-radius: 10px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
        z-index: 1000;
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav a {
        padding: 10px 12px;
    }

    .main-nav a.active::after {
        display: none;
    }
}



/* ===== PROFESSIONAL SERVICES DROPDOWN ===== */

.nav-dropdown {
    position: relative;
}

.nav-dropdown-heading {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-toggle {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s ease;
}

.nav-dropdown.open .dropdown-toggle {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    padding: 8px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1100;

    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);

    transition:
        max-height 0.35s ease,
        opacity 0.25s ease,
        transform 0.3s ease,
        visibility 0.3s ease;
}

.dropdown-menu a {
    display: block;
    padding: 10px 12px;
    color: #1e293b;
    text-decoration: none;
    border-radius: 5px;
    white-space: nowrap;
}

.dropdown-menu a:hover,
.dropdown-menu a:focus {
    background: #f1f5f9;
    color: #0284c7;
}

/* Desktop dropdown interaction */

@media (min-width: 769px) {
    .nav-dropdown:hover .dropdown-menu,
    .nav-dropdown:focus-within .dropdown-menu,
    .nav-dropdown.open .dropdown-menu {
        max-height: 300px;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* Mobile dropdown interaction */

@media (max-width: 768px) {
    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-heading {
        justify-content: center;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        min-width: 0;
        box-shadow: none;
        background: #f8fafc;
        margin-top: 5px;
        padding: 0 8px;
        transform: translateY(-5px);
    }

    .nav-dropdown.open .dropdown-menu {
        max-height: 300px;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        padding: 8px;
    }

    .dropdown-menu a {
        white-space: normal;
        text-align: center;
    }
}


/* ===== DESKTOP DROPDOWN POLISH ===== */

@media (min-width: 769px) {

    .nav-dropdown {
        display: flex;
        align-items: center;
    }

    .dropdown-menu {
        top: calc(100% + 12px);
        min-width: 230px;
        padding: 8px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    }

    .dropdown-menu a {
        padding: 11px 14px;
        font-size: 14px;
        transition:
            background 0.25s ease,
            color 0.25s ease,
            padding-left 0.25s ease;
    }

    .dropdown-menu a:hover {
        background: #eff6ff;
        color: #0284c7;
        padding-left: 19px;
    }

    .dropdown-menu a:focus-visible {
        outline: 2px solid #0284c7;
        outline-offset: 2px;
    }
}


/* ===== RESPONSIVE FOOTER ===== */

@media (max-width: 768px) {

    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 35px;
        padding: 50px 25px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

}

@media (max-width: 480px) {

    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 45px 25px;
    }

    .footer-brand {
        grid-column: auto;
    }

}


/* ===== MEDICAL TOOLS PAGE ===== */

.medical-tools-section {
    padding: 60px 7%;
    background: #f8fafc;
}

.medical-tools-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
}

.medical-tool-card {
    background: #ffffff;
    padding: 35px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.medical-tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.12);
}

.medical-tool-card h2 {
    color: #0f172a;
    font-size: 23px;
    margin-bottom: 15px;
}

.medical-tool-card p {
    color: #64748b;
    line-height: 1.8;
    margin-bottom: 25px;
}

.medical-tool-card a {
    display: inline-block;
    background: #0284c7;
    color: #ffffff;
    padding: 11px 22px;
    border-radius: 7px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
}

.medical-tool-card a:hover {
    background: #0369a1;
}

/* ===== MEDICAL TOOLS RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {

    .medical-tools-container {
        grid-template-columns: 1fr;
    }

    .medical-tools-section {
        padding: 40px 25px;
    }

    .medical-tool-card {
        padding: 28px;
    }

}

/* ===== MEDICAL DISCLAIMER ===== */

.medical-disclaimer {
    max-width: 1200px;
    margin: 35px auto 0;
    padding: 25px 30px;
    background: #eff6ff;
    border-left: 4px solid #0284c7;
    border-radius: 8px;
}

.medical-disclaimer h3 {
    color: #0f172a;
    font-size: 18px;
    margin-bottom: 10px;
}

.medical-disclaimer p {
    color: #475569;
    font-size: 14px;
    line-height: 1.8;
}

@media (max-width: 768px) {

    .medical-disclaimer {
        margin-top: 25px;
        padding: 22px;
    }

}

/* ===== MEDICAL TOOLS SEARCH AND FILTER ===== */

.medical-tools-toolbar {
    max-width: 1200px;
    margin: 0 auto 35px;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
    gap: 20px;
    align-items: end;
}

.medical-search-box input,
.medical-category-filter select {
    width: 100%;
    min-height: 48px;
    padding: 12px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    font: inherit;
    outline: none;
}

.medical-search-box input:focus,
.medical-category-filter select:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.14);
}

.medical-category-filter label {
    display: block;
    margin-bottom: 7px;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .medical-tools-toolbar {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 25px;
    }
}


/* ===== FEATURED CALCULATOR LABEL ===== */

.featured-label {
    display: inline-block;
    margin-bottom: 15px;
    padding: 5px 11px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.7px;
}


/* ===== MEDICAL CALCULATOR CARD IMPROVEMENTS ===== */

.medical-tool-card {
    display: flex;
    flex-direction: column;
}

.medical-tool-card p {
    flex-grow: 1;
}

.medical-tool-card a {
    align-self: flex-start;
}

.medical-tool-card a:focus-visible {
    outline: 3px solid #7dd3fc;
    outline-offset: 3px;
}


/* ===== MEDICAL TOOLS FAVORITE BUTTON ===== */

.favorite-toggle {
    align-self: flex-end;
    width: 38px;
    height: 38px;
    margin-bottom: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    background: #ffffff;
    color: #64748b;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.favorite-toggle:hover {
    border-color: #f59e0b;
    color: #d97706;
    background: #fffbeb;
}

.favorite-toggle[aria-pressed="true"] {
    color: #d97706;
    border-color: #f59e0b;
    background: #fffbeb;
}

.favorite-toggle:focus-visible {
    outline: 3px solid #7dd3fc;
    outline-offset: 3px;
}


/* ===== FAVORITES FILTER ===== */

.favorites-filter {
    max-width: 1200px;
    margin: 0 auto 22px;
}

.favorites-filter label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.favorites-filter input {
    width: 17px;
    height: 17px;
    accent-color: #0284c7;
    cursor: pointer;
}


/* ===== MEDICAL TOOLS THEME TOGGLE ===== */

.theme-toggle-container {
    max-width: 1200px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: flex-end;
}

.theme-toggle {
    padding: 10px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    border-color: #0284c7;
    color: #0284c7;
}

.theme-toggle:focus-visible {
    outline: 3px solid #7dd3fc;
    outline-offset: 3px;
}

@media (max-width: 768px) {
    .theme-toggle-container {
        margin-bottom: 15px;
    }
}


/* ===== MEDICAL TOOLS DARK THEME ===== */

body.medical-tools-dark .medical-tools-section {
    background: #0f172a;
}

body.medical-tools-dark .medical-tool-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

body.medical-tools-dark .medical-tool-card h2 {
    color: #f8fafc;
}

body.medical-tools-dark .medical-tool-card p {
    color: #cbd5e1;
}

body.medical-tools-dark .medical-search-box input,
body.medical-tools-dark .medical-category-filter select {
    background: #1e293b;
    color: #f8fafc;
    border-color: #475569;
}

body.medical-tools-dark .medical-category-filter label,
body.medical-tools-dark .favorites-filter label {
    color: #e2e8f0;
}

body.medical-tools-dark .medical-disclaimer {
    background: #172554;
    border-left-color: #38bdf8;
}

body.medical-tools-dark .medical-disclaimer h3 {
    color: #f8fafc;
}

body.medical-tools-dark .medical-disclaimer p {
    color: #cbd5e1;
}

body.medical-tools-dark .theme-toggle {
    background: #1e293b;
    color: #f8fafc;
    border-color: #475569;
}

body.medical-tools-dark .favorite-toggle {
    background: #1e293b;
    color: #cbd5e1;
    border-color: #475569;
}

body.medical-tools-dark .favorite-toggle[aria-pressed="true"] {
    color: #fbbf24;
    border-color: #f59e0b;
    background: #422006;
}

body.medical-tools-dark .featured-label {
    background: #0c4a6e;
    color: #bae6fd;
}

/* ===== MEDICAL TOOL CARD IMAGES ===== */

.medical-tool-image {
    display: block;
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin: 0 auto 18px;
}

/* ===== MEDICAL TOOL CARD LAYOUT IMPROVEMENTS ===== */

.medical-tool-card {
    position: relative;
}

/* Favorite button: fixed at the top-right of each card */
.medical-tool-card .favorite-toggle {
    position: absolute;
    top: 14px;
    right: 14px;
    width: auto;
    min-width: 42px;
    height: 42px;
    padding: 4px 10px;
    margin: 0;
    font-size: 27px;
    line-height: 1;
    z-index: 2;
}

/* Featured header */
.medical-tool-card .featured-label {
    display: block;
    margin: -25px -25px 16px;
    padding: 12px 55px 12px 18px;
    background: #075985;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-align: left;
    border-radius: 16px 16px 0 0;
}

/* Larger calculator illustrations */
.medical-tool-card .medical-tool-image {
    display: block;
    width: 145px;
    height: 145px;
    object-fit: contain;
    margin: 0 auto 5px;
}

/* Keep calculator names close to images */
.medical-tool-card h2 {
    margin-top: 0;
}

/* ===== MEDICAL TOOLS SEARCH DESIGN ===== */

.medical-search-box {
    position: relative;
    width: 100%;
}

.medical-search-input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 0 14px;
    box-shadow: 0 3px 12px #0f172a0d;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.medical-search-input-wrapper:focus-within {
    border-color: #0284c7;
    box-shadow: 0 0 0 4px #0284c71a;
}

.search-icon {
    color: #0284c7;
    font-size: 28px;
    margin-right: 10px;
    line-height: 1;
}

.medical-search-input-wrapper input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    box-shadow: none;
    background: transparent;
    padding: 15px 0;
    margin: 0;
    font-size: 15px;
}

.medical-search-input-wrapper input:focus {
    border: none;
    outline: none;
    box-shadow: none;
}

.clear-search {
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0 0 0 8px;
    border: none;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.search-guide {
    margin: 8px 4px 0;
    color: #64748b;
    font-size: 12px;
}

.search-suggestions {
    position: static;
    width: 100%;
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 24px #0f172a1a;
    overflow: hidden;
}

.search-suggestions[hidden],
.clear-search[hidden] {
    display: none;
}


/* ===== SEARCH AUTOCOMPLETE SUGGESTIONS ===== */

.search-suggestion-item {
    display: block;
    width: 100%;
    padding: 13px 16px;
    margin: 0;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 0;
    background: #ffffff;
    color: #1e293b;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.search-suggestion-item:hover,
.search-suggestion-item:focus {
    background: #eff6ff;
    color: #0369a1;
    outline: none;
}

.no-search-results {
    padding: 14px 16px;
    color: #64748b;
    font-size: 13px;
}

/* Dark mode */
.medical-tools-dark .medical-search-input-wrapper,
.medical-tools-dark .search-suggestions {
    background: #1e293b;
    border-color: #475569;
}

.medical-tools-dark .medical-search-input-wrapper input {
    color: #f1f5f9;
}

.medical-tools-dark .search-guide,
.medical-tools-dark .no-search-results {
    color: #cbd5e1;
}

.medical-tools-dark .search-suggestion-item {
    background: #1e293b;
    color: #f1f5f9;
    border-bottom-color: #334155;
}

.medical-tools-dark .search-suggestion-item:hover,
.medical-tools-dark .search-suggestion-item:focus {
    background: #334155;
    color: #7dd3fc;
}

.medical-tools-dark .clear-search {
    background: #475569;
    color: #f1f5f9;
}

/* ===== PERMANENT SEARCH SUGGESTION LAYOUT FIX ===== */

.medical-tools-section .medical-search-box {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    height: auto;
    overflow: visible;
}

.medical-tools-section .medical-search-input-wrapper {
    width: 100%;
    flex-shrink: 0;
}

.medical-tools-section .search-suggestions {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    flex-shrink: 0;
    margin-top: 8px;
    z-index: 1;
}

.medical-tools-section .medical-category-filter {
    position: relative;
    clear: both;
    width: 100%;
    margin-top: 32px;
    z-index: 0;
}

/* ===== FAVORITES FILTER SPACING ===== */

.medical-tools-section .favorites-filter {
    margin-top: 16px;
}

/* ===== ACCESSIBILITY SKIP LINK ===== */

.skip-link {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 9999;

    padding: 12px 18px;
    background: #0f172a;
    color: #ffffff;

    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;

    transform: translateY(-150%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
    outline: 3px solid #38bdf8;
    outline-offset: 3px;
}

/* ===== NAVIGATION KEYBOARD ACCESSIBILITY ===== */

.logo:focus-visible,
.main-nav a:focus-visible,
.menu-toggle:focus-visible,
.dropdown-toggle:focus-visible {
    outline: 3px solid #0284c7;
    outline-offset: 4px;
    border-radius: 4px;
}

/* ===== REDUCED MOTION ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== SEARCH SUGGESTION KEYBOARD HIGHLIGHT ===== */

.search-suggestion-item.active {
    background: #e0f2fe;
    color: #075985;
    outline: 2px solid #0284c7;
    outline-offset: -2px;
}
body.medical-tools-dark .search-suggestion-item.active {
    background: #1e3a5f;
    color: #e0f2fe;
    outline-color: #38bdf8;
}
