/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2E7D32; /* Deep Green */
    --secondary-color: #1976D2; /* Blue */
    --accent-color: #FF6F00; /* Orange */
    --success-color: #388E3C; /* Darker Green */
    --warning-color: #F57C00; /* Darker Orange */
    --danger-color: #D32F2F; /* Red */
    --text-dark: #1a1a1a;
    --text-light: #666;
    --text-white: #fff;
    --bg-light: #f8f9fa; /* Light Gray */
    --bg-dark: #0D1117; /* Dark Blue-Gray */
    --border-color: #e1e5e9;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    /* Dark Mode Variables */
    --dark-bg-color: #1a202c;
    --dark-text-color: #e2e8f0;
    --dark-card-bg: #2d3748;
    --dark-border-color: #4a5568;

    /* New Gradient Background Colors (Red, Yellow, Green) */
    --global-bg-start: #FF4136; /* Red */
    --global-bg-mid: #FFDC00;   /* Yellow */
    --global-bg-end: #2ECC40;   /* Green */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
    background: linear-gradient(135deg, var(--global-bg-start), var(--global-bg-mid), var(--global-bg-end));
    background-size: 400% 400%; /* For animation */
    animation: gradientBackground 15s ease infinite; /* Animated gradient */
    transition: background-color var(--transition), color var(--transition);
    position: relative; /* For glassy overlay */
}

/* Glassy Overlay for Body Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05); /* Very subtle white overlay */
    backdrop-filter: blur(5px); /* Gentle blur for glass effect */
    -webkit-backdrop-filter: blur(5px);
    z-index: -1; /* Behind content */
    pointer-events: none; /* Allow clicks to pass through */
}

@keyframes gradientBackground {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


/* Dark Mode */
body.dark-mode {
    background: linear-gradient(135deg, #1a202c, #2d3748, #4a5568); /* Darker gradient for dark mode */
    background-size: 400% 400%;
    animation: gradientBackground 15s ease infinite;
    color: var(--dark-text-color);
}
body.dark-mode::before {
    background: rgba(0, 0, 0, 0.1); /* Darker subtle overlay */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

body.dark-mode .navbar {
    background: rgba(26, 32, 44, 0.95);
    box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}
body.dark-mode .navbar.scrolled {
    background: rgba(26, 32, 44, 0.98);
}
body.dark-mode .nav-logo {
    color: var(--primary-color);
}
body.dark-mode .nav-logo-sub {
    color: var(--dark-text-color);
}
body.dark-mode .nav-link {
    color: var(--dark-text-color);
}
body.dark-mode .hamburger span {
    background: var(--dark-text-color);
}
body.dark-mode .section-title,
body.dark-mode .about-card h3,
body.dark-mode .timeline-content h4,
body.dark-mode .research-card h3,
body.dark-mode .category-title,
body.dark-mode .event-card h4,
body.dark-mode .partner-card h3,
body.dark-mode .cta-section h2,
body.dark-mode .faq-item h4,
body.dark-mode .chatbot-content h3 {
    color: var(--dark-text-color);
}
body.dark-mode .about-card,
body.dark-mode .timeline-content,
body.dark-mode .research-card,
body.dark-mode .team-stat,
body.dark-mode .team-category,
body.dark-mode .resource-card,
body.dark-mode .filter-btn,
body.dark-mode .search-input,
body.dark-mode .contact-form-card,
body.dark-mode .event-card,
body.dark-mode .partner-card,
body.dark-mode .modal-content,
body.dark-mode .faq-item,
body.dark-mode .testimonial-card,
body.dark-mode .chatbot-content {
    background: var(--dark-card-bg);
    box-shadow: var(--shadow); /* Keep a subtle shadow */
    border-color: var(--dark-border-color);
}
body.dark-mode .about-card ul li,
body.dark-mode .timeline-content p,
body.dark-mode .research-card ul li,
body.dark-mode .team-stat-label,
body.dark-mode .position-item .position-title,
body.dark-mode .contact-form label,
body.dark-mode .contact-form textarea,
body.dark-mode .contact-form input::placeholder,
body.dark-mode .event-meta span,
body.dark-mode .event-card p,
body.dark-mode .partner-card p,
body.dark-mode .modal-content p,
body.dark-mode .modal-content label,
body.dark-mode .modal-content input,
body.dark-mode .faq-item p,
body.dark-mode .testimonial-card p,
body.dark-mode .testimonial-card .author-info span,
body.dark-mode .chat-messages .message {
    color: var(--dark-text-color);
}
body.dark-mode .bg-light {
    background-color: var(--dark-bg-color) !important;
}
body.dark-mode .position-item {
    background: rgba(255,255,255,0.05);
}
body.dark-mode .position-item:hover {
    background: var(--primary-color);
    color: white;
}
body.dark-mode .filter-btn {
    border-color: var(--dark-border-color);
    color: var(--dark-text-color);
}
body.dark-mode .filter-btn.active,
body.dark-mode .filter-btn:hover {
    color: white;
    background: var(--primary-color);
    border-color: var(--primary-color);
}
body.dark-mode .search-input {
    background: var(--dark-card-bg);
    border-color: var(--dark-border-color);
    color: var(--dark-text-color);
}
body.dark-mode .search-input:focus {
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.3);
}
body.dark-mode .contact-form input,
body.dark-mode .contact-form textarea,
body.dark-mode .modal-content input,
body.dark-mode #chatInput {
    background: rgba(255,255,255,0.05);
    border-color: var(--dark-border-color);
    color: var(--dark-text-color);
}
body.dark-mode .contact-form input:focus,
body.dark-mode .contact-form textarea:focus,
body.dark-mode .modal-content input:focus,
body.dark-mode #chatInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.3);
}
body.dark-mode .event-card .event-date-box {
    background: var(--primary-color);
    color: white;
}
body.dark-mode .event-card:hover .event-date-box {
    background: var(--secondary-color);
}
body.dark-mode .cta-section {
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.9), rgba(25, 118, 210, 0.9));
}
body.dark-mode .faq-item {
    border-color: var(--dark-border-color);
}
body.dark-mode .faq-item.active {
    border-color: var(--primary-color);
}
body.dark-mode .faq-item .faq-question {
    color: var(--dark-text-color);
}
body.dark-mode .faq-item .faq-question i {
    color: var(--dark-text-color);
}
body.dark-mode .back-to-top,
body.dark-mode .chatbot-toggle-btn {
    background: var(--dark-card-bg);
    border: 1px solid var(--dark-border-color);
    color: var(--dark-text-color);
}
body.dark-mode .back-to-top:hover,
body.dark-mode .chatbot-toggle-btn:hover {
    background: var(--primary-color);
    color: white;
}
body.dark-mode .chat-messages .user-message {
    background-color: var(--primary-color);
    color: white;
}
body.dark-mode .chat-messages .bot-message {
    background-color: var(--dark-border-color);
}
body.dark-mode .visualization-container .chart-placeholder {
    background: linear-gradient(45deg, #2d3748, #4a5568);
    border: 2px dashed #667eea;
    color: #e2e8f0;
}
body.dark-mode .visualization-container p {
    color: var(--dark-text-color);
}


/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

.loading-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    animation: fadeInUp 0.6s ease;
}

.loading-subtext {
    font-size: 1rem;
    opacity: 0.8;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin: 20px auto 0;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: white;
    border-radius: 2px;
    width: 0%;
    animation: loadingProgress 2s ease-in-out;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes loadingProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255,255,255,0.98);
    box-shadow: 0 4px 30px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.nav-logo {
    display: flex;
    align-items: center;
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.nav-logo:hover {
    transform: scale(1.05);
}

.nav-logo-image {
    width: 50px;
    height: 50px;
    border-radius: 50%; /* Make it round */
    object-fit: contain; /* Ensure logo fits */
    margin-right: 12px;
    transition: var(--transition);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2); /* Subtle shadow */
}

.nav-logo:hover .nav-logo-image {
    transform: rotate(10deg);
    box-shadow: 0 0 0 5px rgba(46, 125, 50, 0.4);
}

.nav-logo-text {
    display: flex;
    flex-direction: column;
}

.nav-logo-main {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
}

.nav-logo-sub {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 500;
    line-height: 1;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 35px;
    align-items: center;
}

.nav-menu.active {
    left: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 8px 0;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active::after {
    width: 100%;
}

.nav-cta {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn {
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::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.5s;
}

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

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1B5E20;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-accent {
    background: var(--accent-color);
    color: white;
}

.btn-accent:hover {
    background: #E65100;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.hamburger:hover {
    background: rgba(0,0,0,0.05);
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    transition: var(--transition);
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background: linear-gradient(135deg, 
        rgba(46, 125, 50, 0.95) 0%, 
        rgba(25, 118, 210, 0.95) 50%,
        rgba(255, 111, 0, 0.95) 100%);
    color: white;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="%23ffffff10" points="0,0 1000,300 1000,1000 0,700"/><polygon fill="%23ffffff05" points="0,200 1000,0 1000,800 0,1000"/></svg>');
    background-size: cover;
    animation: heroFloat 20s ease-in-out infinite;
}

.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Make particles not interfere with clicks */
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    animation: particleFloat 6s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translateX(0px) rotate(0deg); opacity: 1; }
    25% { transform: translateX(10px) rotate(90deg); opacity: 0.8; }
    50% { transform: translateX(-10px) rotate(180deg); opacity: 0.9; }
    75% { transform: translateX(5px) rotate(270deg); opacity: 0.7; }
}

@keyframes particleFloat {
    0%, 100% { transform: translateY(0px) translateX(0px); opacity: 0.6; }
    25% { transform: translateY(-20px) translateX(10px); opacity: 1; }
    50% { transform: translateY(-40px) translateX(-5px); opacity: 0.8; }
    75% { transform: translateY(-20px) translateX(5px); opacity: 0.9; }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    margin-bottom: 30px;
    font-size: 0.9rem;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.1;
    animation: fadeInUp 1s ease 0.4s both;
    background: linear-gradient(45deg, #ffffff, #e3f2fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 300;
    margin-bottom: 40px;
    opacity: 0.9;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 1s ease 0.6s both;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 60px;
    animation: fadeInUp 1s ease 0.8s both;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeInUp 1s ease 1s both;
}

.stat {
    text-align: center;
    position: relative;
}

.stat::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: var(--accent-color);
    border-radius: 1px;
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 8px;
    transition: var(--transition);
}

.stat:hover .stat-number {
    transform: scale(1.1);
}

.stat-label {
    font-size: 1rem;
    opacity: 0.8;
    font-weight: 500;
}

/* Section Styles */
section {
    padding: 120px 0;
    position: relative;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 80px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.section-header.animated {
    opacity: 1;
    transform: translateY(0);
}

.section-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.section-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.section-description {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

/* About Section */
.about {
    background: var(--bg-light);
    position: relative;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="%23e8f5e8" opacity="0.5"/><circle cx="80" cy="40" r="3" fill="%23e3f2fd" opacity="0.3"/><circle cx="40" cy="80" r="2" fill="%23fff3e0" opacity="0.4"/></svg>');
    background-size: 100px 100px;
    animation: patternMove 30s linear infinite;
    pointer-events: none;
}

@keyframes patternMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(100px, 100px); }
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    margin-bottom: 80px;
    position: relative;
    z-index: 1;
}

.about-card {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
}

.about-card.animated {
    opacity: 1;
    transform: translateY(0);
}

.about-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.about-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.about-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin-bottom: 25px;
    transition: var(--transition);
}

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

.about-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.about-card ul {
    list-style: none;
}

.about-card ul li {
    padding: 8px 0;
    position: relative;
    padding-left: 25px;
    color: var(--text-light);
    transition: var(--transition);
}

.about-card ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.1rem;
    transition: var(--transition);
}

.about-card:hover ul li::before {
    transform: scale(1.2);
}
.about-card p.description {
    margin-bottom: 15px;
    color: var(--text-light);
}
.about-card .read-more-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    padding: 0;
    transition: color var(--transition);
}
.about-card .read-more-btn:hover {
    color: var(--secondary-color);
}
.about-card .full-text {
    display: none;
}
.about-card .full-text.show {
    display: block;
}

/* Timeline */
.timeline {
    margin-top: 80px;
    position: relative;
    z-index: 1;
}

.timeline h3 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: var(--text-dark);
}

.timeline-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}
.timeline-container::after {
    content: '';
    position: absolute;
    width: 4px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    z-index: 0;
}

.timeline-item {
    display: flex;
    margin-bottom: 50px;
    align-items: center;
    position: relative;
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.timeline-item.animated {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
    transform: translateX(50px);
}

.timeline-item:nth-child(even).animated {
    transform: translateX(0);
}

.timeline-item::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border: 4px solid white;
    border-radius: 50%;
    z-index: 1;
    left: 50%;
    transform: translateX(-50%);
    top: 50%;
    margin-top: -10px;
    box-shadow: 0 0 0 5px rgba(46, 125, 50, 0.2);
    transition: background var(--transition);
}
.timeline-item:hover::before {
    background: var(--secondary-color);
    box-shadow: 0 0 0 8px rgba(25, 118, 210, 0.3);
}

.timeline-date {
    background: var(--primary-color);
    color: white;
    padding: 15px 25px;
    border-radius: var(--border-radius);
    font-weight: 700;
    min-width: 200px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow);
    flex-shrink: 0; /* Prevent shrinking on small screens */
}

.timeline-date::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -10px;
    transform: translateY(-50%);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 10px solid var(--primary-color);
}

.timeline-item:nth-child(even) .timeline-date::after {
    right: auto;
    left: -10px;
    border-left: none;
    border-right: 10px solid var(--primary-color);
}

.timeline-content {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-left: 30px;
    flex: 1;
    transition: var(--transition);
    max-width: calc(50% - 120px); /* Adjust to fit without overlapping */
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: 0;
    margin-right: 30px;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.timeline-content h4 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-dark);
}
.timeline-content p {
    color: var(--text-light);
}

/* Research Areas */
.research {
    background: white;
    position: relative;
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.research-card {
    background: white;
    border: 2px solid var(--border-color);
    padding: 40px;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
}

.research-card.animated {
    opacity: 1;
    transform: translateY(0);
}

.research-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.1), rgba(25, 118, 210, 0.1));
    transition: var(--transition);
    z-index: 0;
}

.research-card:hover::before {
    width: 100%;
}

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

.research-card > * {
    position: relative;
    z-index: 1;
}

.research-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin: 0 auto 25px;
    transition: var(--transition);
}

.research-card:hover .research-icon {
    transform: scale(1.1) rotate(10deg);
}

.research-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.research-card ul {
    list-style: none;
    text-align: left;
}

.research-card ul li {
    padding: 5px 0;
    position: relative;
    padding-left: 20px;
    transition: var(--transition);
    color: var(--text-light);
}

.research-card ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    font-weight: bold;
    color: var(--primary-color);
    transition: var(--transition);
}

.research-card:hover ul li::before {
    transform: translateX(5px);
}

/* Data Visualization Section */
.data-visualization {
    background: var(--bg-light);
}
.visualization-container {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}
.data-visualization.animated .visualization-container {
    opacity: 1;
    transform: translateY(0);
}
.chart-placeholder {
    border: 2px dashed var(--primary-color);
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 600;
    position: relative;
}
.chart-placeholder p {
    color: var(--text-light);
}


/* Team Section */
.team {
    background: var(--bg-light);
    position: relative;
}

.team-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 80px;
}

.team-stat {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(30px);
}

.team-stat.animated {
    opacity: 1;
    transform: translateY(0);
}

.team-stat:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.team-stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
    transition: var(--transition);
}

.team-stat:hover .team-stat-number {
    transform: scale(1.1);
}

.team-stat-label {
    color: var(--text-light);
}

.team-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.team-category {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(30px);
}

.team-category.animated {
    opacity: 1;
    transform: translateY(0);
}

.team-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.category-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-right: 20px;
    transition: var(--transition);
}

.team-category:hover .category-icon {
    transform: rotate(10deg);
}

.category-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
}

.position-list {
    display: flex; /* Use flexbox for items */
    flex-direction: column;
    gap: 15px; /* Use gap for spacing between items */
}

.position-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border-color); /* Add a subtle border */
}

.position-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
    border-color: var(--primary-color);
}
.position-item:hover .position-status {
    background: rgba(255,255,255,0.2);
    color: white;
}


.position-title {
    font-weight: 600;
    color: var(--text-dark);
}

.position-status {
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--success-color);
    color: white;
    transition: var(--transition);
}

/* Resources Section */
.resources {
    background: white;
    position: relative;
}

.resources-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 24px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    position: relative;
    overflow: hidden;
    color: var(--text-dark);
    flex-shrink: 0; /* Prevent shrinking */
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    transition: left 0.3s ease;
    z-index: 0;
}

.filter-btn span {
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.filter-btn.active::before,
.filter-btn:hover::before {
    left: 0;
}

.filter-btn.active span,
.filter-btn:hover span {
    color: white;
}

.filter-btn.active {
    border-color: var(--primary-color);
}

.resources-search {
    max-width: 600px;
    margin: 0 auto 50px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 18px 60px 18px 20px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    color: var(--text-dark);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.1);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    bottom: 5px;
    width: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: #1B5E20;
    transform: scale(1.05);
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    min-height: 200px; /* Ensure grid has some height even if empty */
}

.resource-card {
    background: white;
    border: 2px solid var(--border-color);
    padding: 30px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.resource-card.animated {
    opacity: 1;
    transform: translateY(0);
}
.resource-card.hidden {
    display: none;
}

.resource-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--accent-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.resource-card:hover::before {
    transform: scaleX(1);
}

.resource-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.resource-card h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.resource-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.resource-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 15px;
}

.resource-type, .resource-date {
    background: var(--bg-light);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
    color: var(--primary-color);
}

.resource-card:hover .resource-type,
.resource-card:hover .resource-date {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* News & Events Section */
.news-events {
    background: var(--bg-light);
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.event-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
}
.event-card.animated {
    opacity: 1;
    transform: translateY(0);
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.event-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.event-content {
    padding: 25px;
    position: relative;
}

.event-date-box {
    position: absolute;
    top: -20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.event-date-box span {
    display: block;
    line-height: 1;
}
.event-date-box .day {
    font-size: 1.5rem;
}

.event-card h4 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.event-meta {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}
.event-meta i {
    color: var(--primary-color);
    margin-right: 5px;
}

.event-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.event-card .btn {
    width: 100%;
    text-align: center;
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* Partnerships Section */
.partnerships {
    background: white;
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    justify-items: center;
    align-items: center;
}

.partner-card {
    background: var(--bg-light);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    opacity: 0;
    transform: translateY(30px);
    border: 1px solid var(--border-color);
}
.partner-card.animated {
    opacity: 1;
    transform: translateY(0);
}

.partner-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--secondary-color);
}

.partner-logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 20px;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: var(--transition);
}

.partner-card:hover .partner-logo {
    filter: grayscale(0%);
    opacity: 1;
}

.partner-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.partner-card p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Testimonials Section */
.testimonials {
    background: var(--bg-light);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.testimonial-card {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(30px);
    border-left: 5px solid var(--primary-color);
}
.testimonial-card.animated {
    opacity: 1;
    transform: translateY(0);
}
.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--secondary-color);
}
.testimonial-card p {
    font-style: italic;
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: 1rem;
}
.author-info {
    display: flex;
    align-items: center;
    gap: 15px;
}
.author-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}
.author-info .name {
    font-weight: 700;
    color: var(--text-dark);
}
.author-info .title {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* FAQ Section */
.faq {
    background: white;
}
.faq-container {
    max-width: 900px;
    margin: 0 auto;
}
.faq-item {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    overflow: hidden;
    transition: var(--transition);
    opacity: 0;
    transform: translateY(30px);
}
.faq-item.animated {
    opacity: 1;
    transform: translateY(0);
}
.faq-item.active {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}
.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-dark);
    transition: background-color var(--transition);
}
.faq-question:hover {
    background-color: rgba(0,0,0,0.03);
}
.faq-question i {
    font-size: 1rem;
    transition: transform var(--transition);
}
.faq-item.active .faq-question i {
    transform: rotate(180deg);
}
.faq-answer {
    padding: 0 30px 20px;
    color: var(--text-light);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}
.faq-item.active .faq-answer {
    max-height: 200px; /* Adjust based on content */
    padding: 0 30px 30px;
}


/* Call to Action Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 80px 20px;
    text-align: center;
    margin-top: 80px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.8s ease;
}
.cta-section.animated {
    transform: translateY(0);
    opacity: 1;
}

.cta-section h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 20px;
    color: white; /* Ensure title is white in CTA */
}

.cta-section p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto 40px;
}

.cta-section .btn {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow);
}
.cta-section .btn:hover {
    background: var(--bg-light);
    color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}


/* Contact Section */
.contact {
    background: var(--bg-light);
}

.contact-content {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    justify-content: center;
    align-items: flex-start;
}

.contact-info {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    padding: 30px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}
.contact-info.animated {
    opacity: 1;
    transform: translateY(0);
}

.contact-info h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 25px;
    font-weight: 700;
}

.contact-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.contact-info-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.contact-info-item span {
    font-size: 1.1rem;
    color: var(--text-light);
}
.contact-info-item a {
    color: var(--text-light);
    text-decoration: none;
    transition: color var(--transition);
}
.contact-info-item a:hover {
    color: var(--primary-color);
}

.contact-form-card {
    flex: 2;
    min-width: 400px;
    max-width: 700px;
    padding: 50px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
    transition-delay: 0.2s; /* Stagger animation */
}
.contact-form-card.animated {
    opacity: 1;
    transform: translateY(0);
}

.contact-form h3 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-light);
    color: var(--text-dark);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.submit-btn:hover {
    background: #1B5E20;
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.form-loading-spinner {
    display: none;
    border: 4px solid rgba(0,0,0,0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
.form-loading-spinner.active {
    display: block;
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 60px 0;
    text-align: center;
    font-size: 0.9rem;
    margin-top: 80px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

.social-icon {
    color: white;
    font-size: 1.5rem;
    transition: var(--transition);
    opacity: 0.8;
}

.social-icon:hover {
    color: var(--primary-color);
    transform: scale(1.2);
    opacity: 1;
}

.footer-bottom {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 10001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    width: 90%;
    max-width: 500px;
    position: relative;
    transform: translateY(-50px);
    opacity: 0;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.modal.show .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: var(--danger-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-content h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 25px;
    text-align: center;
}

.modal-content p {
    margin-bottom: 20px;
    line-height: 1.6;
    color: var(--text-light);
}

.modal-content .form-group {
    margin-bottom: 20px;
}

.modal-content label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-light);
    color: var(--text-dark);
}

.modal-content input[type="text"]:focus,
.modal-content input[type="email"]:focus,
.modal-content input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.modal-content .btn-primary {
    width: 100%;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    color: var(--primary-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    border: 1px solid var(--border-color);
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* AI Chatbot Button */
.chatbot-toggle-btn {
    position: fixed;
    bottom: 100px; /* Above back-to-top */
    right: 30px;
    background: var(--secondary-color);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    box-shadow: var(--shadow-hover);
    transition: var(--transition);
    cursor: pointer;
    z-index: 998;
    border: none;
    animation: pulse 2s infinite;
}
.chatbot-toggle-btn:hover {
    background: #1565C0;
    transform: scale(1.05);
    animation: none;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(25, 118, 210, 0); }
    100% { box-shadow: 0 0 0 0 rgba(25, 118, 210, 0); }
}

/* AI Chatbot Modal Specific Styles */
.chatbot-modal .modal-content {
    max-width: 450px;
    height: 600px; /* Fixed height for chat window */
    display: flex;
    flex-direction: column;
    padding: 25px;
    background: white;
}
.chatbot-modal .modal-content h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
    color: var(--secondary-color);
}
.chat-window {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-light);
}
.chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}
.user-message {
    align-self: flex-end;
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 5px;
}
.bot-message {
    align-self: flex-start;
    background-color: #e0e0e0;
    color: var(--text-dark);
    border-bottom-left-radius: 5px;
}
.chat-input-area {
    display: flex;
    padding: 15px;
    border-top: 1px solid var(--border-color);
    gap: 10px;
}
#chatInput {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
}
#sendMessageBtn {
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
}
.chatbot-modal .form-loading-spinner {
    margin-top: 10px;
}


/* Responsive Design */
@media (max-width: 992px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        flex-direction: column;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 30px;
        box-shadow: var(--shadow-hover);
        transition: left 0.5s ease;
        align-items: flex-start;
        gap: 25px;
    }
    body.dark-mode .nav-menu {
        background: rgba(26, 32, 44, 0.98);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        font-size: 1.2rem;
        width: 100%;
        padding: 15px 0;
    }

    .nav-cta {
        flex-direction: column;
        width: 100%;
        gap: 20px;
        margin-top: 30px;
    }

    .nav-cta .btn {
        width: 100%;
        text-align: center;
    }

    .hamburger {
        display: flex;
    }

    .hero {
        padding-top: 100px; /* Account for fixed navbar */
    }

    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .timeline-item:nth-child(even) {
        flex-direction: column;
    }
    .timeline-date {
        margin-bottom: 20px;
        min-width: unset;
        width: 100%;
    }
    .timeline-date::after {
        left: 50%;
        transform: translateX(-50%) rotate(90deg);
        top: auto;
        bottom: -10px;
        border-left: 10px solid var(--primary-color);
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
    }
    .timeline-item:nth-child(even) .timeline-date::after {
        right: auto;
        left: -10px;
        border-left: none;
        border-right: 10px solid var(--primary-color);
    }
    .timeline-content {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
    }
    .timeline-container::after {
        left: 20px; /* Align timeline bar to left */
    }
    .timeline-item::before {
        left: 20px; /* Align circle to timeline bar */
        transform: translateX(0);
    }

    .contact-form-card {
        padding: 30px;
    }
    .modal-content {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .hero-stats {
        grid-template-columns: 1fr;
    }
    .section-header {
        margin-bottom: 50px;
    }
    section {
        padding: 80px 0;
    }
    .about-grid, .research-grid, .team-stats, .team-categories, .resources-grid, .events-grid, .partners-grid, .testimonials-grid, .faq-container {
        grid-template-columns: 1fr;
    }
    .about-card, .research-card, .team-stat, .team-category, .resource-card, .event-card, .partner-card, .testimonial-card, .faq-item {
        padding: 30px;
    }
    .contact-content {
        flex-direction: column;
        gap: 30px;
    }
    .contact-form-card, .contact-info {
        min-width: unset;
        max-width: 100%;
        width: 100%;
    }
    .footer-links, .social-icons {
        flex-direction: column;
        gap: 15px;
    }
    .cta-section {
        padding: 60px 20px;
    }
    .faq-question {
        padding: 15px 20px;
        font-size: 1rem;
    }
    .faq-answer {
        padding: 0 20px 20px;
    }
    .faq-item.active .faq-answer {
        padding: 0 20px 20px;
    }
    .chatbot-toggle-btn {
        bottom: 80px; /* Adjust for smaller screens */
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    .chatbot-modal .modal-content {
        height: 80vh; /* Make chat modal taller on small screens */
    }
}
