/* science-page-enhanced.css - Complete Science Page Styling Fix */

/* ===================================
 Global Science Page Variables
 =================================== */
:root {
 --science-primary: #0F75BD;
 --science-secondary: #F72C93;
 --science-text: #495057;
 --science-light-bg: #f8f9fa;
 --science-white: #ffffff;
 --science-border: rgba(15, 117, 189, 0.1);
 --science-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
 --science-shadow-md: 0 4px 15px rgba(0, 0, 0, 0.15);
 --science-shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.2);
 --science-radius: 15px;
 --science-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
 Main Container Fixes
 =================================== */
.science-page {
 min-height: 100vh;
 padding-top: 2rem;
 background: #ffffff;
}

.science-page .container {
 max-width: 1200px;
 padding: 0 15px;
}

/* ===================================
 Hero Section
 =================================== */
.science-hero {
 background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
 padding: 4rem 0;
 margin-bottom: 3rem;
 position: relative;
 overflow: hidden;
 border-radius: 0 0 50px 50px;
}

.science-hero::before {
 content: '';
 position: absolute;
 top: 0;
 left: 0;
 right: 0;
 bottom: 0;
 background-image: 
 radial-gradient(circle at 20% 50%, rgba(15, 117, 189, 0.05) 0%, transparent 50%),
 radial-gradient(circle at 80% 50%, rgba(247, 44, 147, 0.05) 0%, transparent 50%);
 z-index: 1;
}

.science-hero > * {
 position: relative;
 z-index: 2;
}

.science-hero h1 {
 font-size: clamp(2rem, 5vw, 3.5rem);
 font-weight: 700;
 margin-bottom: 1.5rem;
 background: linear-gradient(135deg, #0F75BD 0%, #F72C93 100%);
 -webkit-background-clip: text;
 -webkit-text-fill-color: transparent;
 background-clip: text;
 color: #0F75BD; /* Fallback color */
}

/* Ensure h1 has fallback for browsers that don't support background-clip */
@supports not (-webkit-background-clip: text) {
 .science-hero h1 {
 background: none;
 -webkit-text-fill-color: initial;
 color: #0F75BD;
 }
}

.science-hero p.lead {
 font-size: 1.25rem;
 color: #495057;
 margin-bottom: 2rem;
 line-height: 1.6;
 font-weight: 400;
}

.hero-subtitle {
 font-size: 1.25rem;
 color: #495057;
 margin-bottom: 2rem;
 line-height: 1.6;
}

/* Science hero stats */
.science-hero .stats-container {
 margin-top: 3rem;
}

.science-hero .stat-item {
 padding: 1.5rem;
}

.science-hero .stat-number {
 font-size: 2.5rem;
 font-weight: 700;
 color: #0F75BD;
 margin-bottom: 0.5rem;
 display: block;
}

.science-hero .stat-label {
 font-size: 1rem;
 color: #495057;
 font-weight: 500;
}

/* Ensure all text in science hero is visible */
.science-hero * {
 color: #212529; /* Bootstrap's default dark text */
}

.science-hero h1,
.science-hero h2,
.science-hero h3,
.science-hero h4,
.science-hero h5,
.science-hero h6 {
 color: #0F75BD;
}

/* Override any white text that might be set elsewhere */
.science-hero .text-white {
 color: #212529 !important;
}

/* ===================================
 Section Styling
 =================================== */
.science-section {
 background: #ffffff;
 padding: 3rem 2rem;
 margin-bottom: 3rem;
 border-radius: 20px;
 box-shadow: var(--science-shadow-md);
 border: 1px solid var(--science-border);
 transition: var(--science-transition);
 position: relative;
}

.science-section:hover {
 transform: translateY(-2px);
 box-shadow: var(--science-shadow-lg);
}

.science-section h2 {
 color: var(--science-primary);
 font-size: 2.25rem;
 font-weight: 600;
 margin-bottom: 1.5rem;
 position: relative;
 padding-bottom: 1rem;
}

.science-section h2::after {
 content: '';
 position: absolute;
 bottom: 0;
 left: 0;
 width: 60px;
 height: 3px;
 background: linear-gradient(90deg, var(--science-primary) 0%, var(--science-secondary) 100%);
 border-radius: 3px;
}

/* ===================================
 Research Cards Accordion Fix
 =================================== */
.research-grid {
 display: grid;
 gap: 1.5rem;
 margin-top: 2rem;
}

.research-card {
 background: #ffffff;
 border-radius: 15px;
 overflow: hidden;
 transition: var(--science-transition);
 border: 1px solid rgba(15, 117, 189, 0.1);
 border-left: 4px solid var(--science-secondary);
 position: relative;
 box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.research-card:hover {
 transform: translateY(-3px);
 box-shadow: var(--science-shadow-md);
 border-left-color: var(--science-primary);
}

.research-card .card-header {
 background: linear-gradient(135deg, rgba(15, 117, 189, 0.05) 0%, rgba(247, 44, 147, 0.05) 100%);
 border-bottom: 1px solid rgba(15, 117, 189, 0.1);
 padding: 1.25rem;
 position: relative;
}

.research-card .card-number {
 position: absolute;
 left: 1.25rem;
 top: 50%;
 transform: translateY(-50%);
 width: 35px;
 height: 35px;
 background: linear-gradient(135deg, var(--science-primary) 0%, var(--science-secondary) 100%);
 color: white;
 border-radius: 50%;
 display: flex;
 align-items: center;
 justify-content: center;
 font-weight: 600;
 font-size: 1rem;
}

.research-card h4 {
 margin: 0;
 padding-left: 3rem;
}

.research-card h4 a {
 color: #2c3e50;
 font-weight: 600;
 text-decoration: none;
 display: flex;
 align-items: center;
 justify-content: space-between;
 font-size: 1.05rem;
 line-height: 1.4;
 transition: color 0.3s ease;
}

.research-card h4 a:hover {
 color: var(--science-secondary);
}

.research-card h4 a i {
 font-size: 1.1rem;
 color: var(--science-primary);
 transition: all 0.3s ease;
}

.research-card h4 a:hover i {
 color: var(--science-secondary);
 transform: rotate(90deg);
}

.research-card h4 a[aria-expanded="true"] i {
 transform: rotate(45deg);
}

.research-card .card-body {
 padding: 1.5rem;
 background: #fbfcfd;
 border-top: 1px solid rgba(15, 117, 189, 0.05);
}

.research-card .card-body p {
 margin-bottom: 1rem;
 line-height: 1.7;
 color: var(--science-text);
}

.research-card .card-body a {
 color: var(--science-primary);
 text-decoration: underline;
 transition: color 0.3s ease;
}

.research-card .card-body a:hover {
 color: var(--science-secondary);
}

/* ===================================
 Images and Media
 =================================== */
.science-image {
 max-width: 100%;
 height: auto;
 border-radius: 12px;
 box-shadow: var(--science-shadow-sm);
 transition: transform 0.3s ease;
}

.science-image:hover {
 transform: scale(1.02);
}

.science-icon {
 width: 150px !important;
 height: 150px !important;
 filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
 transition: transform 0.3s ease;
 margin: 0 auto;
 display: block;
}

.science-icon:hover {
 transform: scale(1.1) rotate(5deg);
}

/* ===================================
 Video Container
 =================================== */
.video-container {
 position: relative;
 margin: 2rem 0;
}

.video-wrapper {
 position: relative;
 padding-bottom: 56.25%; /* 16:9 aspect ratio */
 height: 0;
 overflow: hidden;
 border-radius: 15px;
 box-shadow: var(--science-shadow-lg);
}

.video-wrapper iframe {
 position: absolute;
 top: 0;
 left: 0;
 width: 100%;
 height: 100%;
 border: 0;
}

.video-description {
 margin-top: 1.5rem;
 font-size: 1.1rem;
 color: var(--science-text);
 line-height: 1.7;
}

.video-description .highlight {
 color: var(--science-primary);
 font-weight: 600;
}

/* ===================================
 Media Grid
 =================================== */
.media-grid {
 display: grid;
 grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
 gap: 2rem;
 margin: 3rem 0;
}

.media-card {
 background: white;
 border-radius: 15px;
 overflow: hidden;
 box-shadow: var(--science-shadow-sm);
 transition: all 0.3s ease;
 border: 1px solid var(--science-border);
}

.media-card:hover {
 transform: translateY(-5px);
 box-shadow: var(--science-shadow-lg);
 text-decoration: none;
}

.media-card .card-img-top {
 height: 200px;
 object-fit: cover;
 transition: transform 0.3s ease;
}

.media-card:hover .card-img-top {
 transform: scale(1.05);
}

.media-card .card-body {
 padding: 1.5rem;
}

.media-card h6 {
 color: var(--science-primary);
 font-weight: 600;
 margin-bottom: 0.75rem;
}

.media-card .card-text {
 color: #6c757d;
 font-size: 0.95rem;
 line-height: 1.6;
}

/* ===================================
 CTA Section
 =================================== */
.cta-section {
 background: linear-gradient(135deg, rgba(15, 117, 189, 0.08) 0%, rgba(247, 44, 147, 0.08) 100%);
 padding: 4rem 2rem;
 border-radius: 25px;
 margin: 4rem 0;
 border: 1px solid rgba(15, 117, 189, 0.1);
 position: relative;
 overflow: hidden;
}

.cta-section::before {
 content: '';
 position: absolute;
 top: -50%;
 right: -50%;
 width: 200%;
 height: 200%;
 background: radial-gradient(circle, rgba(247, 44, 147, 0.05) 0%, transparent 50%);
 animation: float 20s ease-in-out infinite;
}

@keyframes float {
 0%, 100% { transform: translate(0, 0) rotate(0deg); }
 33% { transform: translate(30px, -30px) rotate(120deg); }
 66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.cta-section > * {
 position: relative;
 z-index: 2;
}

.cta-section h3 {
 font-size: 2.5rem;
 background: linear-gradient(135deg, var(--science-primary) 0%, var(--science-secondary) 100%);
 -webkit-background-clip: text;
 -webkit-text-fill-color: transparent;
 background-clip: text;
 margin-bottom: 2rem;
}

/* ===================================
 Buttons
 =================================== */
.btn-science {
 background: linear-gradient(135deg, var(--science-primary) 0%, var(--science-secondary) 100%);
 border: none;
 color: white;
 padding: 14px 32px;
 border-radius: 30px;
 font-weight: 600;
 text-decoration: none;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 transition: var(--science-transition);
 margin: 0.5rem;
 position: relative;
 overflow: hidden;
 font-size: 1.05rem;
 box-shadow: var(--science-shadow-sm);
}

.btn-science:hover {
 transform: translateY(-2px);
 box-shadow: var(--science-shadow-lg);
 color: white;
 text-decoration: none;
}

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

.btn-science:hover::before {
 left: 100%;
}

.btn-science i {
 margin-right: 0.5rem;
 font-size: 1.1rem;
}

/* ===================================
 Responsive Design
 =================================== */
@media (max-width: 992px) {
 .science-hero {
 padding: 3rem 0;
 }
 
 .science-hero h1 {
 font-size: 2.25rem;
 }
 
 .science-section {
 padding: 2rem 1.5rem;
 }
 
 .media-grid {
 grid-template-columns: 1fr;
 }
}

@media (max-width: 768px) {
 .science-hero {
 padding: 2rem 0;
 border-radius: 0 0 30px 30px;
 }
 
 .science-hero h1 {
 font-size: 1.75rem;
 }
 
 .hero-subtitle {
 font-size: 1.1rem;
 }
 
 .science-section {
 padding: 1.5rem 1rem;
 margin-bottom: 2rem;
 }
 
 .science-section h2 {
 font-size: 1.75rem;
 }
 
 .research-card .card-header {
 padding: 1rem;
 }
 
 .research-card h4 {
 font-size: 0.95rem;
 }
 
 .btn-science {
 padding: 12px 24px;
 font-size: 0.95rem;
 width: 100%;
 max-width: 300px;
 }
 
 .cta-section {
 padding: 3rem 1.5rem;
 }
 
 .cta-section h3 {
 font-size: 1.75rem;
 }
 
 .cta-buttons {
 flex-direction: column;
 align-items: center;
 }
 
 .science-icon {
 width: 120px !important;
 height: 120px !important;
 }
}

@media (max-width: 576px) {
 .science-page {
 padding-top: 1rem;
 }
 
 .science-hero h1 {
 font-size: 1.5rem;
 }
 
 .research-card .card-number {
 width: 30px;
 height: 30px;
 font-size: 0.875rem;
 }
 
 .research-card h4 {
 padding-left: 2.5rem;
 }
}

/* ===================================
 Animation Enhancements
 =================================== */
.science-section,
.research-card,
.media-card {
 animation: fadeInUp 0.6s ease-out;
}

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

/* Stagger animation for research cards */
.research-card:nth-child(1) { animation-delay: 0.1s; }
.research-card:nth-child(2) { animation-delay: 0.2s; }
.research-card:nth-child(3) { animation-delay: 0.3s; }
.research-card:nth-child(4) { animation-delay: 0.4s; }
.research-card:nth-child(5) { animation-delay: 0.5s; }

/* ===================================
 Accessibility Improvements
 =================================== */
.research-card h4 a:focus,
.btn-science:focus,
.media-card:focus {
 outline: 3px solid var(--science-primary);
 outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
 .research-card {
 border-width: 2px;
 }
 
 .btn-science {
 border: 2px solid white;
 }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
 *,
 *::before,
 *::after {
 animation-duration: 0.01ms !important;
 animation-iteration-count: 1 !important;
 transition-duration: 0.01ms !important;
 }
}

/* ===================================
 Print Styles
 =================================== */
@media print {
 .science-hero {
 background: none;
 padding: 1rem 0;
 }
 
 .science-section {
 box-shadow: none;
 border: 1px solid #ddd;
 page-break-inside: avoid;
 }
 
 .video-wrapper,
 .cta-section {
 display: none;
 }
 
 .btn-science {
 display: none;
 }
}