/* ==========================================================================
   PUBMED STYLES - Complete CSS for PubMed Research Studies Sections
   Updated with modern text effect and cleaner design
   ========================================================================== */

/* ==========================================================================
   MODERN TEXT EFFECT FOR PROTOCOL ATTRIBUTION
   ========================================================================== */

.protocol-attribution {
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    /* Fallback for browsers that don't support background-clip */
    color: #38bdf8;
}

/* Firefox fallback */
@supports not (-webkit-background-clip: text) {
    .protocol-attribution {
        color: #38bdf8;
        font-weight: 600;
    }
}

/* ==========================================================================
   CLEANER PUBMED SECTION - REMOVED EXTRA BOX STYLING
   ========================================================================== */

.pubmed-section {
    margin-top: 32px;
    padding-top: 20px;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    /* Removed the extra border and background styling */
}

/* ==========================================================================
   SIMPLIFIED PUBMED HEADER - CLEAN DESIGN
   ========================================================================== */

.pubmed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 16px;
    user-select: none;
    /* Removed heavy box-shadow for cleaner look */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pubmed-header:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.pubmed-header:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* ==========================================================================
   SIMPLIFIED PUBMED TITLE AND COUNT
   ========================================================================== */

.pubmed-title {
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

.pubmed-count {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 8px;
}

/* ==========================================================================
   SIMPLIFIED TOGGLE BUTTON
   ========================================================================== */

.chevron {
    transition: transform 0.3s ease;
    opacity: 0.7;
    color: #94a3b8;
}

.pubmed-header[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* ==========================================================================
   CLEANER PUBMED CONTENT AREA
   ========================================================================== */

.pubmed-content {
    /* Default collapsed state */
    display: none;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    
    /* Styling when expanded - MUCH CLEANER */
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    margin-top: 0;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

/* EXPANDED STATES - CLEAN DESIGN */
.pubmed-content.show,
.pubmed-content[style*="display: block"] {
    display: block !important;
    opacity: 1 !important;
    max-height: none !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
    padding: 16px 0 !important;
    background: transparent !important;
    border: none !important;
}

/* Force visibility when header indicates expanded */
.pubmed-header[aria-expanded="true"] + .pubmed-content {
    display: block !important;
    opacity: 1 !important;
    max-height: none !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
    padding: 16px 0 !important;
    background: transparent !important;
    border: none !important;
}

/* ==========================================================================
   STUDIES GRID - CLEAN LAYOUT
   ========================================================================== */

.pubmed-studies {
    display: grid;
    gap: 16px;
    opacity: 1;
    visibility: visible;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.pubmed-study {
    display: block !important;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    opacity: 1;
    visibility: visible;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.pubmed-study:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    background: rgba(15, 23, 42, 0.6);
}

/* ==========================================================================
   STUDY CONTENT ELEMENTS - MODERN STYLING
   ========================================================================== */

.study-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 12px;
}

.study-title {
    color: #60a5fa;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    flex: 1;
    font-family: 'Inter', sans-serif;
}

.study-title:hover {
    color: #3b82f6;
}

.study-date {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.study-authors {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 8px;
    line-height: 1.4;
    font-family: 'Inter', sans-serif;
}

.study-journal {
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 12px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.study-abstract {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
    font-family: 'Inter', sans-serif;
}

.study-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.study-link {
    display: inline-block;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Inter', sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.study-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.study-link:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.study-link:hover::before {
    left: 100%;
}

/* ==========================================================================
   ADDITIONAL STUDIES SECTION - CLEANER STYLING
   ========================================================================== */

.additional-studies {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    display: block;
}

.show-more-studies {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 16px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    width: 100%;
    font-family: 'Inter', sans-serif;
}

.show-more-studies:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

/* ==========================================================================
   PARENT CONTAINER FIXES - CLEAN OVERRIDES
   ========================================================================== */

.peptide-card {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

.card-content {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

.card-section {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .pubmed-header {
        padding: 14px 16px;
    }
    
    .pubmed-title {
        font-size: 0.9rem;
    }
    
    .pubmed-studies {
        gap: 12px;
    }
    
    .pubmed-study {
        padding: 16px;
    }
    
    .study-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .study-date {
        align-self: flex-start;
    }
    
    .study-link {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .pubmed-header {
        padding: 12px 14px;
    }
    
    .pubmed-title {
        font-size: 0.85rem;
    }
    
    .pubmed-count {
        font-size: 0.75rem;
        padding: 1px 6px;
    }
    
    .pubmed-study {
        padding: 14px;
    }
    
    .study-title {
        font-size: 0.9rem;
    }
    
    .study-authors,
    .study-journal {
        font-size: 0.8rem;
    }
    
    .study-abstract {
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   ANIMATION IMPROVEMENTS
   ========================================================================== */

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

.pubmed-content.show {
    animation: fadeInUp 0.3s ease-out;
}

/* ==========================================================================
   DARK MODE ENHANCEMENTS
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .protocol-attribution {
        background: linear-gradient(to right, #38bdf8, #818cf8);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .pubmed-header {
        background: rgba(15, 23, 42, 0.8);
        border-color: rgba(148, 163, 184, 0.3);
    }
    
    .pubmed-study {
        background: rgba(15, 23, 42, 0.6);
        border-color: rgba(148, 163, 184, 0.2);
    }
}