/* ============================================
   OSHA Glossary Term Page Styles
   BEM Methodology with QuickCare Design System
   ============================================ */

.glossary-term {
    --gt-accent-bg: #f4f0ff;
    --gt-quickcare-gradient: linear-gradient(135deg, rgba(106, 61, 232, 0.08), rgba(0, 184, 212, 0.05));
    --gt-section-gap: 2rem;
    --gt-border-accent: 5px;
}

/* ============================================
   Header Section
   ============================================ */
.glossary-term__header {
    background: linear-gradient(135deg, var(--qc-color-primary, #6a3de8), var(--qc-color-primary-dark, #5227cf));
    padding: 3rem 1rem 4rem;
    color: white;
    margin-bottom: 0;
    border-bottom-left-radius: 50px;
    border-bottom-right-radius: 50px;
    box-shadow: 0 4px 20px rgba(106, 61, 232, 0.25);
    position: relative;
    overflow: hidden;
}

.glossary-term__header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.glossary-term__header-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.glossary-term__category {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: rgba(255,255,255,0.9);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    background: rgba(255,255,255,0.15);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    backdrop-filter: blur(5px);
}

.glossary-term__category-icon {
    font-size: 1rem;
}

.glossary-term__title {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.glossary-term__subtitle {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    color: rgba(255,255,255,0.85);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================
   Main Content Layout
   ============================================ */
.glossary-term__main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0 1rem;
}

@media (min-width: 992px) {
    .glossary-term__main {
        grid-template-columns: 1fr 320px;
        gap: 2.5rem;
    }
}

.glossary-term__content-area {
    background-color: var(--qc-color-bg-white, #ffffff);
    border-radius: var(--qc-radius-xl, 20px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    margin-top: -60px;
    position: relative;
    z-index: 10;
    overflow: hidden;
}

.glossary-term__content-inner {
    padding: 2rem;
}

@media (min-width: 768px) {
    .glossary-term__content-inner {
        padding: 2.5rem;
    }
}

/* ============================================
   Table of Contents / Quick Navigation
   ============================================ */
.glossary-term__toc {
    background: linear-gradient(135deg, var(--qc-color-bg-light, #f7f9fc), #ffffff);
    border-radius: var(--qc-radius-lg, 12px);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--qc-color-border, #e2e8f0);
}

.glossary-term__toc-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--qc-color-text-medium, #4a5568);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.glossary-term__toc-icon {
    font-size: 1.1rem;
    color: var(--qc-color-primary, #6a3de8);
}

.glossary-term__toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.glossary-term__toc-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: var(--qc-color-bg-white, #ffffff);
    color: var(--qc-color-text-medium, #4a5568);
    border: 1px solid var(--qc-color-border, #e2e8f0);
    border-radius: var(--qc-radius-md, 8px);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.glossary-term__toc-link:hover {
    background: var(--qc-color-primary, #6a3de8);
    color: white;
    border-color: var(--qc-color-primary, #6a3de8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(106, 61, 232, 0.2);
}

.glossary-term__toc-link-icon {
    font-size: 0.9rem;
}

/* ============================================
   Content Sections
   ============================================ */
.glossary-term__section {
    margin-bottom: var(--gt-section-gap);
    padding: 1.75rem;
    background-color: var(--qc-color-bg-light, #f7f9fc);
    border-radius: var(--qc-radius-lg, 12px);
    border-left: var(--gt-border-accent) solid var(--qc-color-primary-light, #8a65f0);
    transition: all 0.3s ease;
}

.glossary-term__section:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.glossary-term__section:last-of-type {
    margin-bottom: 0;
}

.glossary-term__section-title {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 700;
    color: var(--qc-color-primary-dark, #5227cf);
    margin-top: 0;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    line-height: 1.3;
}

.glossary-term__section-title-icon {
    color: var(--qc-color-primary, #6a3de8);
    font-size: 1.5em;
    line-height: 1;
    flex-shrink: 0;
}

.glossary-term__section-title-image {
    height: 1.4em;
    width: auto;
    flex-shrink: 0;
}

/* Section Variants */
.glossary-term__section--definition {
    background: linear-gradient(135deg, #ffffff, var(--qc-color-bg-light, #f7f9fc));
    border-left-color: var(--qc-color-primary, #6a3de8);
}

.glossary-term__section--quickcare-solutions {
    background: var(--gt-quickcare-gradient);
    border-left-color: var(--qc-color-primary, #6a3de8);
    position: relative;
    overflow: hidden;
}

.glossary-term__section--quickcare-solutions::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(106, 61, 232, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.glossary-term__section--quickcare-solutions .glossary-term__section-title {
    color: var(--qc-color-primary-dark, #5227cf);
}

.glossary-term__section--best-practices {
    border-left-color: var(--qc-color-accent, #2eca8b);
}

.glossary-term__section--misconceptions {
    border-left-color: var(--qc-color-danger, #ff5252);
    background: linear-gradient(135deg, #fff5f5, var(--qc-color-bg-light, #f7f9fc));
}

/* ============================================
   Text Content Styles
   ============================================ */
.glossary-term__text,
.glossary-term__definition-text {
    font-size: clamp(0.95rem, 2.2vw, 1.05rem);
    line-height: 1.8;
    color: var(--qc-color-text-dark, #1a2a42);
}

.glossary-term__text p,
.glossary-term__definition-text p {
    margin-bottom: 1.25rem;
}

.glossary-term__text p:last-child,
.glossary-term__definition-text p:last-child {
    margin-bottom: 0;
}

.glossary-term__text a,
.glossary-term__definition-text a {
    color: var(--qc-color-primary, #6a3de8);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(106, 61, 232, 0.3);
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
    transition: all 0.2s ease;
}

.glossary-term__text a:hover,
.glossary-term__definition-text a:hover {
    color: var(--qc-color-primary-dark, #5227cf);
    text-decoration-color: var(--qc-color-primary-dark, #5227cf);
}

.glossary-term__text ul,
.glossary-term__text ol {
    padding-left: 0;
    margin: 1rem 0;
    list-style: none;
}

.glossary-term__text ul li,
.glossary-term__text ol li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.glossary-term__text ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 8px;
    height: 8px;
    background: var(--qc-color-primary, #6a3de8);
    border-radius: 50%;
}

.glossary-term__text strong {
    color: var(--qc-color-primary-dark, #5227cf);
    font-weight: 600;
}

/* Definition highlight box */
.glossary-term__definition-highlight {
    background: white;
    border-radius: var(--qc-radius-md, 8px);
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--qc-color-border, #e2e8f0);
    margin-bottom: 1rem;
    font-size: 1.05rem;
    line-height: 1.8;
    position: relative;
}

.glossary-term__definition-highlight::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 15px;
    font-size: 4rem;
    color: var(--qc-color-primary-light, #8a65f0);
    opacity: 0.2;
    font-family: Georgia, serif;
    line-height: 1;
}

/* ============================================
   Official Standard Link
   ============================================ */
.glossary-term__official-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--qc-color-text-medium, #4a5568);
    font-size: 0.9rem;
    text-decoration: none;
    margin-top: 1.25rem;
    padding: 0.6rem 1rem;
    background: white;
    border: 1px solid var(--qc-color-border, #e2e8f0);
    border-radius: var(--qc-radius-md, 8px);
    transition: all 0.2s ease;
}

.glossary-term__official-link:hover {
    color: var(--qc-color-primary, #6a3de8);
    border-color: var(--qc-color-primary-light, #8a65f0);
    background: var(--gt-accent-bg);
    transform: translateX(3px);
}

.glossary-term__official-link-icon {
    font-size: 1.1rem;
}

/* ============================================
   Related Terms Section
   ============================================ */
.glossary-term__related-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.glossary-term__related-item {
    display: inline-block;
}

.glossary-term__related-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    background-color: var(--qc-color-bg-white, #ffffff);
    color: var(--qc-color-primary, #6a3de8);
    border: 2px solid var(--qc-color-primary-light, #8a65f0);
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.25s ease;
}

.glossary-term__related-link::before {
    content: '#';
    opacity: 0.5;
}

.glossary-term__related-link:hover {
    background-color: var(--qc-color-primary, #6a3de8);
    color: white;
    border-color: var(--qc-color-primary, #6a3de8);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(106, 61, 232, 0.25);
}

/* ============================================
   Sidebar
   ============================================ */
.glossary-term__sidebar {
    margin-top: -60px;
    position: relative;
    z-index: 10;
}

@media (max-width: 991.98px) {
    .glossary-term__sidebar {
        margin-top: 0;
    }
}

.glossary-term__sidebar-card {
    background: white;
    border-radius: var(--qc-radius-lg, 12px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--qc-color-border, #e2e8f0);
}

.glossary-term__sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--qc-color-text-dark, #1a2a42);
    margin-top: 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.glossary-term__sidebar-icon {
    color: var(--qc-color-primary, #6a3de8);
    font-size: 1.25rem;
}

/* CTA Card */
.glossary-term__cta-card {
    background: linear-gradient(135deg, var(--qc-color-primary, #6a3de8), var(--qc-color-primary-dark, #5227cf));
    border: none;
    color: white;
    text-align: center;
}

.glossary-term__cta-title {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.glossary-term__cta-text {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.glossary-term__cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: white;
    color: var(--qc-color-primary, #6a3de8);
    border: none;
    border-radius: var(--qc-radius-md, 8px);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.glossary-term__cta-btn:hover {
    background: var(--qc-color-bg-light, #f7f9fc);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    color: var(--qc-color-primary-dark, #5227cf);
}

/* Quick Facts Card */
.glossary-term__quick-facts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.glossary-term__quick-fact {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--qc-color-border, #e2e8f0);
}

.glossary-term__quick-fact:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.glossary-term__quick-fact:first-child {
    padding-top: 0;
}

.glossary-term__quick-fact-icon {
    color: var(--qc-color-primary, #6a3de8);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.glossary-term__quick-fact-content {
    flex: 1;
}

.glossary-term__quick-fact-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--qc-color-text-light, #4a5568);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}

.glossary-term__quick-fact-value {
    font-size: 0.9rem;
    color: var(--qc-color-text-dark, #1a2a42);
    font-weight: 500;
}

/* Quick-fact rows that are themselves links (e.g. the "Our Services" card) --
   the icon + label sit inline like a plain quick-fact row, but the whole
   row is a clickable <a>, so it needs the link underline suppressed and the
   text color inherited from the surrounding row instead of default link blue. */
.glossary-term__quick-fact-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

/* Share Card */
.glossary-term__share-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.glossary-term__share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--qc-radius-md, 8px);
    background: var(--qc-color-bg-light, #f7f9fc);
    color: var(--qc-color-text-medium, #4a5568);
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--qc-color-border, #e2e8f0);
}

.glossary-term__share-btn:hover {
    background: var(--qc-color-primary, #6a3de8);
    color: white;
    border-color: var(--qc-color-primary, #6a3de8);
    transform: translateY(-2px);
}

.glossary-term__share-btn--copy {
    flex: 1;
    width: auto;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============================================
   Back Link & Navigation
   ============================================ */
.glossary-term__navigation {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--qc-color-border, #e2e8f0);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

.glossary-term__back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--qc-color-primary, #6a3de8);
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--qc-color-primary-light, #8a65f0);
    border-radius: var(--qc-radius-md, 8px);
    transition: all 0.2s ease;
}

.glossary-term__back-link:hover {
    background-color: var(--qc-color-primary, #6a3de8);
    color: white;
    border-color: var(--qc-color-primary, #6a3de8);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(106, 61, 232, 0.25);
}

.glossary-term__back-link-icon {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.glossary-term__back-link:hover .glossary-term__back-link-icon {
    transform: translateX(-3px);
}

.glossary-term__print-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--qc-color-text-medium, #4a5568);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: var(--qc-radius-md, 8px);
    transition: all 0.2s ease;
    cursor: pointer;
    background: none;
    border: none;
}

.glossary-term__print-btn:hover {
    color: var(--qc-color-primary, #6a3de8);
    background: var(--gt-accent-bg);
}

/* ============================================
   Container Override
   ============================================ */
.container--term {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container--term { max-width: 540px; }
}
@media (min-width: 768px) {
    .container--term { max-width: 720px; }
}
@media (min-width: 992px) {
    .container--term { max-width: 960px; }
}
@media (min-width: 1200px) {
    .container--term { max-width: 1140px; }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .glossary-term__header {
        background: #f0f0f0 !important;
        color: #333 !important;
        border-radius: 0;
        padding: 2rem 1rem;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .glossary-term__sidebar,
    .glossary-term__toc,
    .glossary-term__navigation,
    .glossary-term__share-btns {
        display: none !important;
    }

    .glossary-term__content-area {
        margin-top: 1rem;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .glossary-term__section {
        page-break-inside: avoid;
        border-left-width: 3px;
    }

    .glossary-term__main {
        display: block;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glossary-term__section {
    animation: fadeInUp 0.4s ease forwards;
}

.glossary-term__section:nth-child(1) { animation-delay: 0.1s; }
.glossary-term__section:nth-child(2) { animation-delay: 0.2s; }
.glossary-term__section:nth-child(3) { animation-delay: 0.3s; }
.glossary-term__section:nth-child(4) { animation-delay: 0.4s; }
.glossary-term__section:nth-child(5) { animation-delay: 0.5s; }
.glossary-term__section:nth-child(6) { animation-delay: 0.6s; }
