/* 
   TRUST Project - Premium Academic Theme
   University of Granada
*/

:root {
  /* Color Palette - Trust & Networks */
  --primary: #0f172a;
  /* Slate 900 - Deep Trust Blue */
  --primary-light: #1e293b;
  /* Slate 800 */
  --secondary: #0ea5e9;
  /* Sky 500 - Network Blue */
  --accent: #f43f5e;
  /* Rose 500 - Life/Donation Accent */

  --bg-dark: #0f172a;
  --bg-light: #f8fafc;
  --text-main: #334155;
  --text-light: #64748b;
  --white: #ffffff;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);

  /* Typography */
  --font-main: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-light);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--primary);
  font-weight: 700;
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

/* Components: Navigation */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.logo-img {
  height: 40px;
  width: auto;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.logo-text span {
  color: var(--secondary);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-link {
  font-weight: 500;
  color: var(--text-main);
  font-size: 0.95rem;
  position: relative;
}

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

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

.cta-button {
  padding: 0.6rem 1.5rem;
  background: var(--primary);
  color: white;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(15, 23, 42, 0.2);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5%;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.1;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(14, 165, 233, 0.1);
  color: var(--secondary);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.hero h1 {
  font-size: 4rem;
  margin-bottom: 1.2rem;
  background: -webkit-linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-primary {
  padding: 0.9rem 2rem;
  background: var(--secondary);
  color: white;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.btn-secondary {
  padding: 0.9rem 2rem;
  background: white;
  color: var(--text-main);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-weight: 600;
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-2px);
}

/* Sections Global */
.section {
  padding: 6rem 5%;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  position: relative;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--accent);
  margin: 10px auto 0;
  border-radius: 2px;
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  align-items: center;
}

.about-card {
  background: white;
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  border: 1px solid #f1f5f9;
}

.feature-icon {
  font-size: 2rem;
  color: var(--secondary);
  margin-bottom: 1rem;
}

/* Team Grid */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2.5rem;
  max-width: 1300px;
  margin: 0 auto;
  justify-content: center;
}

.team-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s ease;
}

.team-card:hover {
  transform: translateY(-5px);
}

.team-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  background-color: #e2e8f0;
  /* Placeholder color */
}

.team-info {
  padding: 1.5rem;
}

.team-name {
  font-size: 1.25rem;
  margin-bottom: 0.3rem;
  color: var(--primary);
}

.team-role {
  color: var(--secondary);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.team-bio {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Team Member Hover Effect */
.team-img {
  position: relative;
  width: 100%;
  height: 300px;
  object-fit: cover;
  background-color: #e2e8f0;
  overflow: hidden;
}

.team-img-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.9);
  /* using primary color with opacity */
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: all 0.3s ease;
  text-align: center;
  backdrop-filter: blur(4px);
}

.team-img-overlay p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #f1f5f9;
}

.team-card:hover .team-img-overlay {
  opacity: 1;
}

/* Studies List */
.study-card {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.study-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--secondary);
}

.study-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.study-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.status-badge {
  background: #dcfce7;
  color: #166534;
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* News & Publications Two-Column Layout */
.news-publications-container {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 4rem;
  max-width: 1400px;
  margin: 0 auto;
}

.column-title {
  font-size: 1.8rem;
  margin-bottom: 2.5rem;
  color: var(--primary);
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--secondary);
}

/* Publications Column (Left, Narrower) */
.publications-column {
  min-width: 0;
}

.publication-item {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e2e8f0;
}

.publication-item:last-child {
  border-bottom: none;
}

.publication-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.publication-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
  line-height: 1.4;
}

.publication-journal {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.8rem;
  font-style: italic;
}

.publication-abstract {
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.publication-link {
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.publication-link:hover {
  color: var(--accent);
}

/* News Column (Right, Wider, Blog-style) */
.news-column {
  min-width: 0;
}

.news-blog-item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid #e2e8f0;
  align-items: flex-start;
}

.news-blog-item:last-child {
  border-bottom: none;
}

.news-blog-image {
  flex-shrink: 0;
  width: 200px;
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
}

.news-image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-blog-content {
  flex: 1;
  min-width: 0;
}

.news-blog-date {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.news-blog-title {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  color: var(--primary);
  line-height: 1.3;
}

.news-blog-description {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.7;
}

/* Responsive Design for News/Publications */
@media (max-width: 1024px) {
  .news-publications-container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .news-blog-image {
    width: 150px;
    height: 120px;
  }
}

@media (max-width: 768px) {
  .news-blog-item {
    flex-direction: column;
  }

  .news-blog-image {
    width: 100%;
    height: 200px;
  }

  .column-title {
    font-size: 1.5rem;
  }
}

/* Footer */
footer {
  background: var(--primary);
  color: white;
  padding: 4rem 5%;
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  color: white;
  margin-bottom: 1.5rem;
}

.footer-links li {
  list-style: none;
  margin-bottom: 0.8rem;
}

.footer-links a {
  color: #94a3b8;
}

.footer-links a:hover {
  color: var(--secondary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .navbar {
    padding: 1rem;
  }

  /* Mobile Nav Toggle */
  .mobile-nav-toggle {
    display: block;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
  }

  .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--primary);
    transition: all 0.3s ease-in-out;
  }

  /* Hamburger Animation */
  .mobile-nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }

  .mobile-nav-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .mobile-nav-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .nav-links {
    display: flex;
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 70%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: right 0.3s ease-in-out;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  }

  .nav-links.active {
    right: 0;
  }

  /* Layout Fixes */
  .section-title {
    font-size: 2rem;
    width: 100%;
    left: 0;
    transform: none;
    margin-left: 0;
    padding: 0 1rem;
  }
}

/* Ensure Toggle is hidden on desktop */
.mobile-nav-toggle {
  display: none;
}

@media (max-width: 768px) {
  .mobile-nav-toggle {
    display: block;
  }

}

/* Scroll Animation Styles */
.scroll-fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

.scroll-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

.scroll-slide-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

.scroll-slide-left.visible {
  opacity: 1;
  transform: translateX(0);
  will-change: auto;
}

.scroll-slide-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

.scroll-slide-right.visible {
  opacity: 1;
  transform: translateX(0);
  will-change: auto;
}

.scroll-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delay for multiple elements */
.scroll-fade-in.delay-1,
.scroll-slide-left.delay-1,
.scroll-slide-right.delay-1 { transition-delay: 0.1s; }
.scroll-fade-in.delay-2,
.scroll-slide-left.delay-2,
.scroll-slide-right.delay-2 { transition-delay: 0.2s; }
.scroll-fade-in.delay-3,
.scroll-slide-left.delay-3,
.scroll-slide-right.delay-3 { transition-delay: 0.3s; }
.scroll-fade-in.delay-4,
.scroll-slide-left.delay-4,
.scroll-slide-right.delay-4 { transition-delay: 0.4s; }