/*
Theme Name: Rational Nerd Theme
Theme URI: https://rationalnerd.com
Author: Rational Nerd Team
Description: Clinical Engineering Hub.
Version: 4.0.0
Text Domain: rational-nerd-theme
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --clinical-teal: #4F7D7D;
    --clinical-teal-dark: #3D6161;
    --clinical-slate-50: #F8FAFC;
    --clinical-slate-100: #F1F5F9;
    --clinical-slate-200: #E2E8F0;
    --clinical-slate-600: #475569;
    --clinical-slate-900: #0F172A;
}

body {
    background-color: var(--clinical-slate-50);
    color: var(--clinical-slate-600);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--clinical-slate-900);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* 🖼️ Global Emoji & Smiley Fix */
img.wp-smiley,
img.emoji {
    display: inline !important;
    border: none !important;
    box-shadow: none !important;
    height: 1em !important;
    width: 1em !important;
    margin: 0 .07em !important;
    vertical-align: -0.1em !important;
    background: none !important;
    padding: 0 !important;
}

/* 🔗 Premium Clinical Hyperlinks (Standout Edition) */
.clinical-content a,
.clinical-page-content a {
    color: var(--clinical-teal);
    text-decoration: none;
    font-weight: 700; /* Bolder for standout effect */
    border-bottom: 2px solid rgba(79, 125, 125, 0.3); /* More visible underline */
    transition: all 0.25s ease;
    padding: 0 2px;
}

.clinical-content a:hover,
.clinical-page-content a:hover {
    color: #ffffff !important;
    background-color: var(--clinical-teal) !important;
    border-bottom-color: var(--clinical-teal);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(79, 125, 125, 0.2);
}



/* Layered Look Containers */
.section-white {
    background-color: #ffffff;
    border-top: 1px solid var(--clinical-slate-200);
    border-bottom: 1px solid var(--clinical-slate-200);
}

/* Professional Buttons */
.btn-medical {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 200px;
}

.btn-medical-solid {
    background-color: var(--clinical-teal);
    color: #ffffff;
}

.btn-medical-solid:hover {
    background-color: var(--clinical-teal-dark);
}

.btn-medical-outline {
    background-color: transparent;
    border: 1.5px solid var(--clinical-teal);
    color: var(--clinical-teal);
}

.btn-medical-outline:hover {
    background-color: var(--clinical-slate-50);
}

/* Grid & Cards */
.card-instrument {
    background-color: #ffffff;
    border: 1px solid var(--clinical-slate-200);
    border-radius: 0.75rem;
    padding: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-instrument:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Expert Cards */
.expert-box {
    background-color: #ffffff;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.expert-image-container {
    aspect-ratio: 1/1;
    background-color: var(--clinical-slate-100);
    overflow: hidden;
}

.expert-image-container img {
    width: 100%;
    height: 100%;
    object-cover: cover;
}

/* Badges */
.badge-expert {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background-color: #ecfdf5;
    color: #059669;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
    text-transform: uppercase;
}

/* Utilities */
.max-w-hero { max-width: 800px; margin-left: auto; margin-right: auto; }
.container-medical { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* Mobile-First AMP Optimizations */
@media (max-width: 768px) {
    html, body {
        font-size: 16px !important; /* Ensure readability */
        overflow-x: hidden !important; /* Prevent horizontal scroll */
        width: 100vw !important;
        max-width: 100vw !important;
    }

    /* 44x44px touch target minimums */
    button, .btn-action, .btn-medical, a, .tool-card, input, select, textarea, .expert-socials a, .social-icon {
        min-height: 44px;
        min-width: 44px;
    }

    /* Landing Page padding reductions */
    .vanguard-hero {
        padding: 6rem 1.5rem !important;
    }
    
    .section-container {
        padding: 4rem 1.5rem !important;
    }
    
    .vision-section {
        padding: 4rem 1.5rem !important;
    }

    .vision-glass {
        padding: 2rem !important;
        gap: 3rem !important;
    }
    
    /* Make buttons full width on mobile */
    .btn-action, .btn-medical {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }
    
    .hero-btns {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    /* Mobile Bottom Tab Bar for Dashboard */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #FFFFFF;
        border-top: 1px solid #E2E8F0;
        display: flex;
        justify-content: space-around;
        align-items: center;
        height: 65px;
        z-index: 100;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
    }
    
    /* Viewport Lock & App-Shell Logic */
    #clinical-dashboard-wrapper {
        height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        padding-bottom: 0 !important;
    }

    .app-container {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .workspace-center {
        flex: 1 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0; /* Allow shrinking */
    }

    .app-header {
        position: static !important; /* Flex parent handles it */
    }

    .mobile-bottom-nav {
        position: relative !important; /* Flex parent handles it */
        flex-shrink: 0 !important;
    }

    /* Hide desktop sidebars */
    .sidebar-left, .hub-right {
        display: none !important;
    }

    /* Independent Scroll Area */
    .workspace-center {
        width: 100% !important;
        padding: 1rem !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 100px !important; /* Balanced for bottom nav */
    }


    .bottom-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 90vh; /* 90% screen height */
        background: #FFFFFF;
        border-top-left-radius: 24px;
        border-top-right-radius: 24px;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
        z-index: 200 !important;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        display: none !important; /* Hide by default to save space */
        flex-direction: column !important;
        overflow: hidden;
    }

    .bottom-sheet.sheet-open {
        display: flex !important;
        transform: translateY(0);
    }


    /* Utilities */
    .scrollbar-hide::-webkit-scrollbar {
        display: none;
    }
    .scrollbar-hide {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    body {
        font-family: 'Inter', sans-serif;
        background-color: #F8FAFC !important;
        color: #1e293b;
        overflow-x: hidden;
    }

    .universal-library-list, .hub-search-results, .hub-search-results .space-y-3 {
        display: block !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .bottom-sheet {
        overflow: hidden !important; /* Contain the scrollable area */
        z-index: 200 !important;
    }

    .bottom-sheet > div {
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-start !important; /* Force to top */
        overflow: hidden;
    }

    /* Ensure inner scrollable areas work on touch */
    .bottom-sheet .overflow-y-auto {
        -webkit-overflow-scrolling: touch;
        flex: 1;
        overflow-y: auto !important;
    }


    .bottom-sheet-handle-inner {
        width: 40px;
        height: 4px;
        background: #E2E8F0;
        border-radius: 10px;
        margin: 0 auto 20px auto;
        flex-shrink: 0;
        cursor: pointer;
    }

    /* Scribe textarea height */
    .scribe-textarea {
        min-height: 350px !important;
        height: 50vh !important;
        background: white !important;
        z-index: 10 !important;
    }

    /* FABs */
    .mobile-fab-container {
        position: fixed;
        bottom: 140px; /* Higher up to avoid Evaluate button */
        right: 20px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        z-index: 60;
        pointer-events: none; /* Container doesn't block */
    }

    .mobile-fab {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--clinical-teal);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        cursor: pointer;
        border: none;
        pointer-events: auto; /* Button itself works */
    }

    /* Sticky Footer for Clinical Actions */
    .sticky-mobile-action {
        position: fixed !important;
        bottom: 65px !important;
        left: 0 !important;
        width: 100% !important;
        background: white !important;
        padding: 1rem !important;
        border-top: 1px solid var(--clinical-slate-200) !important;
        z-index: 40 !important;
        display: flex !important;
        justify-content: center !important;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.05) !important;
    }
    
    .sticky-mobile-action button, .sticky-mobile-action a {
        width: 100% !important;
        max-width: none !important;
    }

    /* Landing Page Mobile Scaling */
    .vanguard-hero h1 {
        font-size: 3.2rem !important; /* Scale up */
        line-height: 1.1 !important;
        letter-spacing: -2px !important;
    }
    
    .vanguard-hero {
        padding: 4rem 1.5rem !important; /* Scale gaps down */
    }
    
    .section-container {
        padding: 2.5rem 1.5rem !important; /* Scale gaps down */
    }
    
    .expert-photo {
        height: 350px !important; /* Adjust height for mobile */
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .expert-photo img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
    }

    /* Tool Card Padding Reductions */
    .workspace-center main, .workspace-center .p-8, .workspace-center .p-12 {
        padding: 1.5rem !important;
    }
    
    .workspace-center .p-6 {
        padding: 1rem !important;
    }
    
    .workspace-center .p-10 {
        padding: 1.5rem !important;
    }
    
    .workspace-center .space-y-10 {
        margin-top: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }

    .workspace-center .max-w-2xl, .workspace-center .max-w-xl {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Slim Header bar max 50px */
    .app-header, .vanguard-header {
        height: 50px !important;
        padding: 0 1rem !important;
    }
    
    .vanguard-header {
        padding: 0 !important;
        display: flex;
        align-items: center;
    }

    .custom-logo-link img {
        max-height: 35px !important;
    }

    /* Centering Search Input Text on Mobile */
    .hub-right input[type="text"] {
        text-align: center !important;
    }

    /* Margin Capping for Stability */
    .mt-10, .mt-12, .mt-16, .my-10, .my-12, .my-16 {
        margin-top: 2rem !important;
    }

    /* Mobile Scribe Visibility Fixes */
    .scribe-textarea {
        flex: 1 !important;
        min-height: 150px !important;
        height: auto !important;
    }

    /* Ensure workspace content is visible and fills space */
    .workspace-center > div {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 100% !important;
    }

    /* Fix Hub Content Spacing */
    .hub-right .p-6 {
        padding: 1.25rem !important;
        height: calc(90vh - 30px) !important; /* Adjust for handle */
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
    }
}

    .hub-right .space-y-6 > * {
        margin-bottom: 1rem !important;
    }
}

