/* Ensure the entire page takes up at least the viewport height */
html, body {
    overflow-y: auto !important;
    background-color: #f5eee9 !important;
    margin: 0;
    height: 100%;
    margin: 0;
}

/* From https://saol.ai/ (nav.php, line ~67) */
#wrapper.wrap {
    background-color: #f5eee9 !important;
    /*min-height: 80vh !important;
    max-height: 227vh !important;*/
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* From https://saol.ai/, about.php, page-privacy.php, page-terms.php, register.php (gdpr-handler.php, line ~96) */
/* Deduplicated GDPR modal styles */
.gdpr-modal {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 90vw;
    max-width: 800px;
    background: #fff;
    color: #222;
    padding: 1.25rem 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 9999;
    opacity: 0;
    transform: translate(-50%, 20px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.gdpr-modal--visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 480px) {
    .gdpr-modal {
        bottom: 20px;
        width: 95vw;
        padding: 1rem 0.75rem;
    }
}

/* Legacy modal dialog for backwards compatibility */
.modal-dialog-custom {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    max-height: 200px;
    display: flex;
    align-items: flex-end;
}

.class-1 {
    display: none;
}

.class-2 {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.class-3 {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
    min-width: 200px;
}

.class-4 {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.class-5 {
    padding: 8px 16px;
    background: #178d72;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

    .class-5:hover {
        background: #126b55;
    }

.class-6 {
    padding: 8px 16px;
    background: #ffffff;
    color: #178d72;
    border: 1px solid #178d72;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

    .class-6:hover {
        background: #f0f0f0;
    }

/* From https://saol.ai/ (foot.php, line ~19) */
.footer-bg {
    background-color: #000000 !important;
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    z-index: 1000;
}

/* From https://saol.ai/, page-privacy.php, page-terms.php, register.php (footer2.php, line ~7) */
.uc-footer {
    background-color: #000000 !important;
}

.footer-outer {
    background-color: #000000 !important;
}

.footer-container {
    background-color: #000000 !important;
    padding: 15px;
}

/* From https://saol.ai/about.php (about.php, line ~17) */
.about-content p {
    text-align: left !important;
}

/* From https://saol.ai/about.php (about.php, line ~37) */
.star-left {
    top: 40% !important;
    left: 24% !important;
}

/* From https://saol.ai/about.php (about.php, line ~41) */
.star-right {
    top: 40% !important;
    right: 24% !important;
}

/* From https://saol.ai/about.php (about.php, line ~217) */
.star-bottom-left {
    bottom: -4% !important;
    left: 28% !important;
}

/* From https://saol.ai/about.php (about.php, line ~361) */
.star-bottom-right {
    bottom: 40% !important;
    right: 24% !important;
}

/* From https://saol.ai/about.php (about.php, line ~441) */
.star-bottom-left-cta {
    bottom: 40% !important;
    left: 24% !important;
}

/* From burger.css */
@import url(https://fonts.googleapis.com/css2?family=Inter+Tight:ital,wght@0,300..700;1,300..700&family=Inter:wght@300..700&family=IBM+Plex+Sans+Arabic:wght@400;500;700&display=swap);

@font-face {
    font-family: "Mabry Pro";
    src: local("Mabry Pro Bold"), url('../fonts/mabry-pro/MabryPro-Bold.woff2'), url('../fonts/mabry-pro/MabryPro-Bold.woff');
    font-weight: 700;
    text-rendering: optimizeLegibility;
    font-display: swap;
    ascent-override: 90%;
}

/* Navbar styles with increased specificity */
nav.navbar {
    background-color: #f3eee9;
    font-family: 'Mabry Pro', sans-serif;
    font-weight: 700;
    padding: 10px 20px;
    position: relative;
    z-index: 1000;
    width: 100%;
    box-sizing: border-box;
}

    nav.navbar .nav-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 2rem;
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
        box-sizing: border-box;
    }

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

        nav.navbar .logo img {
            height: 34px;
            width: auto;
        }

    /* Desktop nav */
    nav.navbar .nav-links {
        display: flex;
        justify-content: flex-end;
        list-style: none;
        margin: 0;
        padding: 0;
    }

        nav.navbar .nav-links li {
            margin-left: 20px;
        }

        nav.navbar .nav-links a {
            text-decoration: none;
            color: #000;
            font-size: 18px;
            font-weight: bold;
            transition: color 0.2s;
        }

            nav.navbar .nav-links a:hover {
                color: #178d72;
            }

    /* Hamburger */
    nav.navbar button#hamburger.hamburger {
        display: none !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        width: 34px !important;
        height: 24px !important;
        cursor: pointer !important;
        z-index: 1001 !important;
        background: none !important;
        border: none !important;
        padding: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

        nav.navbar button#hamburger.hamburger span.hamburger-bar {
            display: block !important;
            height: 4px !important;
            width: 100% !important;
            background: #000 !important;
            margin: 4px 0 !important;
            border-radius: 2px !important;
            transition: all 0.3s ease !important;
            opacity: 1 !important;
            visibility: visible !important;
            position: relative !important;
            z-index: 1002 !important;
        }

    /* Hamburger animation */
    nav.navbar .hamburger.active .hamburger-bar:nth-child(1) {
        transform: translateY(10px) rotate(45deg) !important;
    }

    nav.navbar .hamburger.active .hamburger-bar:nth-child(2) {
        opacity: 0 !important;
    }

    nav.navbar .hamburger.active .hamburger-bar:nth-child(3) {
        transform: translateY(-10px) rotate(-45deg) !important;
    }

    /* Mobile menu (hidden by default) */
    nav.navbar .mobile-menu {
        display: none;
        flex-direction: column;
        background-color: #f5eee9;
        opacity: 0.95;
        width: 220px;
        position: absolute;
        top: 100%;
        left: 20px;
        padding: 20px;
        z-index: 1000;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        border-radius: 8px;
    }

        nav.navbar .mobile-menu.show {
            display: flex !important;
        }

        nav.navbar .mobile-menu a {
            color: #333;
            text-decoration: none;
            padding: 0.8rem 0;
            display: block;
            font-size: 18px;
            font-family: 'Mabry Pro', sans-serif;
            font-weight: 700;
            transition: color 0.2s;
        }

            nav.navbar .mobile-menu a:hover {
                color: #178d72;
            }

/* Media query for responsive design */
@media screen and (max-width: 768px) {
    nav.navbar .nav-links {
        display: none !important;
    }

    nav.navbar button#hamburger.hamburger {
        display: flex !important;
    }

    nav.navbar .mobile-menu.show {
        display: flex !important;
    }
}

@media (min-width: 769px) {
    nav.navbar .nav-links {
        display: flex !important;
    }

    nav.navbar .hamburger {
        display: none !important;
    }

    nav.navbar .mobile-menu {
        display: none !important;
    }
}

/* IMPROVED MODAL CSS - Consolidated and Enhanced */

/* Modal base styling - hidden by default */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

    /* Modal show state */
    .modal.modal-show {
        display: block !important;
        opacity: 1;
    }

    /* Modal hide state */
    .modal.modal-hide {
        display: none !important;
        opacity: 0;
    }

/* Modal fade in animation */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
}

/* Modal content */
.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal.modal-show .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal header */
.modal-header {
    background: linear-gradient(135deg, #3CB4E5, #845EC2);
    color: white;
    padding: 1.5rem;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
}

    .modal-header h3 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
    }

/* Modal body */
.modal-body {
    padding: 2rem;
}

/* Close button */
.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
}

    .close:hover {
        opacity: 1;
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.1);
    }

    .close:focus {
        outline: 2px solid rgba(255, 255, 255, 0.5);
        outline-offset: 2px;
    }

/* Form group visibility classes */
.form-group {
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

    .form-group.form-group-hide {
        display: none !important;
        opacity: 0;
        max-height: 0;
        overflow: hidden;
    }

    .form-group.form-group-show {
        display: block !important;
        opacity: 1;
        max-height: 200px;
    }

/* Form styling */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
    color: #374151;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
    box-sizing: border-box;
}

    .form-control:focus, .form-select:focus {
        border-color: #3CB4E5;
        outline: none;
        box-shadow: 0 0 0 0.2rem rgba(60, 180, 229, 0.25);
        transform: translateY(-1px);
    }

    .form-control:invalid {
        border-color: #dc3545;
    }

        .form-control:invalid:focus {
            border-color: #dc3545;
            box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
        }

/* Button styling */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-size: 1rem;
    line-height: 1.2;
    text-align: center;
}

    .btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none !important;
    }

.btn-primary {
    background: linear-gradient(135deg, #3CB4E5, #845EC2);
    color: white;
}

    .btn-primary:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(60, 180, 229, 0.3);
        color: white;
        text-decoration: none;
    }

.btn-outline-primary {
    background: transparent;
    border: 2px solid #3CB4E5;
    color: #3CB4E5;
}

    .btn-outline-primary:hover:not(:disabled) {
        background: #3CB4E5;
        color: white;
        text-decoration: none;
    }

.btn-success {
    background: #28a745;
    color: white;
}

    .btn-success:hover:not(:disabled) {
        background: #218838;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
        color: white;
        text-decoration: none;
    }

.btn-danger {
    background: #dc3545;
    color: white;
}

    .btn-danger:hover:not(:disabled) {
        background: #c82333;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
        color: white;
        text-decoration: none;
    }

.btn-warning {
    background: #ffc107;
    color: #212529;
}

    .btn-warning:hover:not(:disabled) {
        background: #e0a800;
        transform: translateY(-2px);
        color: #212529;
        text-decoration: none;
    }

/* Small buttons */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Utility classes */
.d-flex {
    display: flex !important;
}

.gap-3 {
    gap: 1rem !important;
}

.text-center {
    text-align: center !important;
}

.text-muted {
    color: #6c757d !important;
}

/* Loading spinner */
.ri-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Alert styling */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 8px;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* Table styling for share details */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}

    .table th,
    .table td {
        padding: 0.75rem;
        vertical-align: top;
        border-top: 1px solid #dee2e6;
        text-align: left;
    }

    .table thead th {
        background-color: #f8f9fa;
        border-bottom: 2px solid #dee2e6;
        font-weight: 600;
        color: #495057;
    }

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Badge styling */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
}

.bg-success {
    background-color: #28a745 !important;
    color: white !important;
}

.bg-info {
    background-color: #17a2b8 !important;
    color: white !important;
}

.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.bg-danger {
    background-color: #dc3545 !important;
    color: white !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 2% auto;
        max-height: 95vh;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }

    .d-flex {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

        .btn:last-child {
            margin-bottom: 0;
        }
}

/* Animation improvements */
@media (prefers-reduced-motion: no-preference) {
    .modal {
        transition: opacity 0.3s ease;
    }

    .modal-content {
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .form-group {
        transition: all 0.3s ease;
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal,
    .modal-content,
    .form-group {
        transition: none;
    }

    .ri-spin {
        animation: none;
    }
}

/* SVG sprite container — hidden from layout, available to <use href="#..."> */
.svg-sprite-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* =====================================================
   Research Mark — SVG Sprite Icon & Link Styles
   Used on persona pages to link to research.php anchors
   ===================================================== */

.research-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.3em;
    text-decoration: none;
    color: #178d72;
    vertical-align: middle;
    line-height: 1;
}

.research-icon {
    width: 0.9em;
    height: 0.9em;
    fill: currentColor;
    opacity: 0.55;
    vertical-align: middle;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.research-mark:hover .research-icon,
.research-mark:focus .research-icon {
    opacity: 1;
    transform: translateY(-1px);
}

/* =====================================================
   Research Page — Filter Badge Links
   ===================================================== */

.badge-link {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    background-color: rgba(23, 141, 114, 0.08);
    color: #178d72;
    border: 1px solid rgba(23, 141, 114, 0.22);
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.badge-link:hover,
.badge-link:focus {
    background-color: #178d72;
    color: #fff;
    border-color: #178d72;
    text-decoration: none;
}

/* =====================================================
   Research Page — Accordion Sections (details/summary)
   ===================================================== */

.research-section {
    border: 1px solid rgba(0, 0, 0, 0.09);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.65rem;
    background-color: #fff;
}

.dark .research-section,
[data-theme="dark"] .research-section {
    background-color: #1e2228;
    border-color: rgba(255, 255, 255, 0.09);
}

.research-section summary {
    list-style: none;
    cursor: pointer;
    padding: 0.9rem 1.25rem;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background-color: rgba(23, 141, 114, 0.06);
    transition: background-color 0.15s ease;
    user-select: none;
}

.research-section summary::-webkit-details-marker {
    display: none;
}

.research-section summary::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.45;
    flex-shrink: 0;
    transition: transform 0.2s ease, opacity 0.15s ease;
    line-height: 1;
}

.research-section[open] > summary::after {
    transform: rotate(45deg);
    opacity: 0.7;
}

.research-section summary:hover {
    background-color: rgba(23, 141, 114, 0.11);
}

.research-section-label {
    display: flex;
    align-items: center;
    gap: 0.6em;
    min-width: 0;
}

.research-section-count {
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.5;
    background-color: rgba(23, 141, 114, 0.12);
    color: #178d72;
    border-radius: 10px;
    padding: 0.1em 0.55em;
    flex-shrink: 0;
}

.research-section-body {
    padding: 0.5rem 1.25rem 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* =====================================================
   Research Page — Source List
   ===================================================== */

.research-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.research-list li {
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
    line-height: 1.5;
    display: flex;
    align-items: baseline;
    gap: 0.4em;
}

.research-list li:last-child {
    border-bottom: none;
}

.research-list a {
    color: #178d72;
    text-decoration: none;
}

.research-list a:hover {
    text-decoration: underline;
}

/* Peer-reviewed / credible source styling */
.research-list li.credible {
    font-weight: 700;
}

.research-list li.credible::before {
    content: '✓';
    color: #178d72;
    font-size: 0.75em;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.1em;
}

.research-list li.credible a {
    font-weight: 700;
}

/* =====================================================
   Research Page — Source Type Labels
   ===================================================== */

.source-type {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1em 0.45em;
    border-radius: 4px;
    flex-shrink: 0;
    align-self: center;
}

.source-type-journal {
    background-color: rgba(23, 141, 114, 0.12);
    color: #178d72;
}

.source-type-book {
    background-color: rgba(100, 100, 220, 0.1);
    color: #4a4ab5;
}

.source-type-institution {
    background-color: rgba(200, 120, 0, 0.1);
    color: #a05a00;
}

/* =====================================================
   Research Page — Footer Note
   ===================================================== */

.research-footer-note {
    font-size: 0.82rem;
    opacity: 0.6;
    text-align: center;
    margin-top: 2rem;
    font-style: italic;
    line-height: 1.6;
}

/* =====================================================
   Persona Pages — Article Layout
   ===================================================== */

.persona-article-body h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.6rem;
}

.persona-article-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 1.4rem;
    margin-bottom: 0.4rem;
    color: #178d72;
}

.persona-article-body p {
    line-height: 1.75;
    margin-bottom: 0.9rem;
    font-size: 0.975rem;
}

.persona-article-body ul {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}

.persona-article-body ul li {
    line-height: 1.7;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

.persona-tag {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.persona-reflection-box {
    background-color: rgba(23, 141, 114, 0.07);
    border-left: 3px solid #178d72;
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}

.persona-reflection-box ul {
    margin: 0;
    padding-left: 1.1rem;
}

.persona-reflection-box ul li {
    font-style: italic;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.persona-summary-box {
    background-color: rgba(23, 141, 114, 0.05);
    border: 1px solid rgba(23, 141, 114, 0.2);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
}

.persona-summary-box h3 {
    color: #178d72;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
    margin-top: 0;
}

.persona-summary-box ul {
    margin: 0;
    padding-left: 1.1rem;
}

.persona-summary-box ul li {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.3rem;
}