/**
 * STUDIES.CSS - Permanent Research Studies Styling
 * Add this as assets/css/studies.css and link in index.html
 */

/* ==========================================================================
   RESEARCH STUDIES CORE STYLES
   ========================================================================== */

.pubmed-section {
    margin-top: 24px;
    border-top: 1px solid rgba(59, 130, 246, 0.1);
    padding-top: 16px;
}

.pubmed-content {
    display: none !important;
    opacity: 1 !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 16px 0 !important;
    background: transparent !important;
    border: none !important;
    margin-top: 16px !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
}

.pubmed-content.show,
.pubmed-content[data-visible="true"] {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    animation: fadeInStudies 0.3s ease-out !important;
}

.pubmed-content.hide,
.pubmed-content[data-visible="false"] {
    display: none !important;
}

/* ==========================================================================
   STUDY LINKS STYLING
   ========================================================================== */

.pubmed-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pubmed-link {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
    border-radius: 8px !important;
    padding: 16px !important;
    transition: all 0.3s ease !important;
    position: relative;
    overflow: hidden;
}

.pubmed-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pubmed-link:hover {
    border-color: rgba(59, 130, 246, 0.4) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.pubmed-link:hover::before {
    opacity: 1;
}

.pubmed-link a {
    color: #60a5fa !important;
    text-decoration: none !important;
    display: block !important;
    width: 100%;
}

.pubmed-link a:hover {
    color: #93c5fd !important;
}

.study-title {
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    color: #e2e8f0 !important;
    line-height: 1.4 !important;
    font-size: 1rem !important;
    display: block;
}

.study-meta {
    color: #94a3b8 !important;
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
    font-style: italic;
}

/* ==========================================================================
   TOGGLE BUTTONS STYLING
   ========================================================================== */

.pubmed-toggle {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
    margin-top: 16px !important;
    width: 100% !important;
    text-align: center !important;
    font-size: 0.9rem !important;
    font-family: 'Inter', sans-serif !important;
    position: relative;
    overflow: hidden;
}

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

.pubmed-toggle:hover::before {
    left: 100%;
}

.pubmed-toggle:hover {
    background: linear-gradient(135deg, #4f5b76 0%, #2d3748 100%) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.pubmed-toggle:active {
    transform: translateY(0) !important;
}

/* ==========================================================================
   ADDITIONAL STUDIES TOGGLE
   ========================================================================== */

.additional-studies {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.toggle-additional {
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    color: #60a5fa !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    margin-top: 12px !important;
    transition: all 0.3s ease !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    display: inline-block;
}

.toggle-additional:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
    transform: translateY(-1px) !important;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeInStudies {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 500px;
        opacity: 1;
    }
}

.pubmed-content.show {
    animation: fadeInStudies 0.3s ease-out !important;
}

.additional-studies {
    animation: slideDown 0.3s ease-out;
}

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

@media (max-width: 768px) {
    .pubmed-link {
        padding: 12px !important;
    }
    
    .study-title {
        font-size: 0.9rem !important;
        margin-bottom: 6px !important;
    }
    
    .study-meta {
        font-size: 0.8rem !important;
    }
    
    .pubmed-toggle {
        padding: 10px 16px !important;
        font-size: 0.85rem !important;
    }
    
    .toggle-additional {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
    }
}

@media (max-width: 480px) {
    .pubmed-link {
        padding: 10px !important;
        border-radius: 6px !important;
    }
    
    .study-title {
        font-size: 0.85rem !important;
    }
    
    .study-meta {
        font-size: 0.75rem !important;
    }
    
    .pubmed-toggle {
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
        border-radius: 6px !important;
    }
}

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

@media (prefers-color-scheme: dark) {
    .pubmed-link {
        background: rgba(15, 23, 42, 0.8) !important;
    }
    
    .pubmed-toggle {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    }
    
    .pubmed-toggle:hover {
        background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
    }
}

/* ==========================================================================
   HIGH CONTRAST MODE
   ========================================================================== */

@media (prefers-contrast: high) {
    .pubmed-link {
        border: 2px solid #60a5fa !important;
    }
    
    .pubmed-toggle {
        border: 2px solid #60a5fa !important;
    }
    
    .study-title {
        color: #ffffff !important;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .pubmed-content {
        display: block !important;
        background: white !important;
        color: black !important;
    }
    
    .pubmed-toggle {
        display: none !important;
    }
    
    .toggle-additional {
        display: none !important;
    }
    
    .additional-studies {
        display: block !important;
    }
    
    .pubmed-link {
        background: white !important;
        border: 1px solid #ccc !important;
        color: black !important;
        break-inside: avoid;
        margin-bottom: 8px !important;
    }
    
    .pubmed-link a {
        color: #0066cc !important;
    }
    
    .study-title {
        color: black !important;
    }
    
    .study-meta {
        color: #666 !important;
    }
}