/* AID2E Custom Styles */

/* Typography */
body,h1,h2,h3,h4,h5,h6 {
  font-family: "Lato", sans-serif;
  color: #e0e0e0;
}

.w3-bar,h1,button {
  font-family: "Montserrat", sans-serif;
}

/* Background Colors */
body {
  background-color: #1a1a1a;
}

.dark-bg {
  background-color: #2a2a2a !important;
}

.darker-bg {
  background-color: #1a1a1a !important;
}

/* Accent Colors */
.accent-color {
  background-color: #3a7ca5 !important;
}

.accent-hover:hover {
  background-color: #2d6080 !important;
}

/* Logo Container */
.logo-container {
  max-width: 300px;
  margin: 20px auto;
}

.logo-container img {
  width: 100%;
  height: auto;
}

/* Institute Logos Container */
.institutes-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(15px, 2vw, 30px);
  width: 100%;
  padding: 0 2%;
}

/* Institute Logos */
.institute-logo {
  padding: clamp(10px, 1.5vw, 20px);
  transition: transform 0.3s ease;
  flex-shrink: 1;
  min-width: 0;
}

.institute-logo img {
  height: auto;
  width: 100%;
  filter: brightness(0.9);
  opacity: 0.85;
  transition: opacity 0.3s ease;
  display: block;
}

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

.institute-logo img:hover {
  opacity: 1;
}

/* Logo sizes - responsive and fluid */
.logo-large {
  flex: 0 1 clamp(100px, 12vw, 180px);
}

.logo-small {
  flex: 0 1 clamp(50px, 6vw, 90px);
}

/* Keep all logos in one line on larger screens */
@media (min-width: 1200px) {
  .institutes-container {
    flex-wrap: nowrap;
  }
  .logo-large {
    flex: 0 1 180px;
  }
  .logo-small {
    flex: 0 1 90px;
  }
}

/* Allow wrapping on medium screens */
@media (max-width: 1199px) and (min-width: 768px) {
  .institutes-container {
    flex-wrap: wrap;
  }
}

/* Stack on small screens */
@media (max-width: 767px) {
  .institutes-container {
    flex-direction: column;
    gap: 20px;
  }
  .logo-large,
  .logo-small {
    flex: 0 1 auto;
    max-width: 200px;
  }
}

/* Lead Institute Highlight */
.lead-institute {
  border: 3px solid #3a7ca5;
  border-radius: 10px;
  background-color: rgba(58, 124, 165, 0.1);
}

/* White Background for Specific Logos */
.white-bg-logo {
  background-color: white;
  border-radius: 10px;
}

/* About Section Text */
.about-text {
  color: #ffffff;
  font-size: clamp(1rem, 1.8vw, 1.125rem);
  line-height: 1.7;
  margin-bottom: 1.2em;
}

/* Under Construction Page */
.under-construction {
  animation: fadeIn 1s ease-in;
}

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

.under-construction i {
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Collaboration Page Styles */
.collaboration-section {
  margin-bottom: 2rem;
}

.institution-header {
  background: linear-gradient(135deg, #3a7ca5 0%, #2d6080 100%);
  padding: clamp(1rem, 2vw, 1.5rem);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.institution-header:hover {
  background: linear-gradient(135deg, #2d6080 0%, #3a7ca5 100%);
  transform: translateX(5px);
}

.institution-info {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.5rem);
  flex: 1;
}

.institution-logo-small {
  height: clamp(40px, 5vw, 60px);
  width: auto;
  object-fit: contain;
  filter: brightness(1.1);
}

.institution-header h2 {
  margin: 0;
  color: white;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
}

.toggle-icon {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  transition: transform 0.3s ease;
  color: white;
}

.toggle-icon.active {
  transform: rotate(180deg);
}

.institution-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
  padding: 0 1rem;
}

.institution-content.active {
  max-height: 5000px;
  padding: 2rem 1rem;
}

.role-section {
  margin-bottom: 3rem;
}

.role-title {
  color: #3a7ca5;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #3a7ca5;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(200px, 25vw, 280px), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-bottom: 2rem;
}

/* Flip Card Styles */
.flip-card {
  background-color: transparent;
  perspective: 1000px;
  height: clamp(280px, 35vw, 360px);
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  transition: box-shadow 0.3s ease;
}

.flip-card:hover .flip-card-front,
.flip-card:hover .flip-card-back {
  box-shadow: 0 8px 16px rgba(58, 124, 165, 0.4);
}

.flip-card-front {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.flip-card-front img {
  width: clamp(100px, 15vw, 150px);
  height: clamp(100px, 15vw, 150px);
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 3px solid #3a7ca5;
}

.flip-card-front h3 {
  color: white;
  margin: 0.5rem 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.flip-card-front .member-role {
  color: #3a7ca5;
  font-weight: bold;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  margin-top: 0.5rem;
}

.flip-card-back {
  background: linear-gradient(135deg, #3a7ca5 0%, #2d6080 100%);
  color: white;
  transform: rotateY(180deg);
  padding: clamp(1rem, 2vw, 1.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

.flip-card-back h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
  border-bottom: 2px solid white;
  padding-bottom: 0.5rem;
}

.flip-card-back p {
  margin: 0.5rem 0;
  font-size: clamp(0.85rem, 1.5vw, 0.95rem);
  line-height: 1.5;
  text-align: left;
}

.flip-card-back .label {
  font-weight: bold;
  color: #e0e0e0;
}

.visit-link {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background-color: white;
  color: #3a7ca5;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  font-size: clamp(0.8rem, 1.4vw, 0.9rem);
  transition: all 0.3s ease;
}

.visit-link:hover {
  background-color: #e0e0e0;
  transform: scale(1.05);
}

.visit-link i {
  margin-left: 0.3rem;
}

/* Placeholder image for missing photos */
.placeholder-image {
  width: clamp(100px, 15vw, 150px);
  height: clamp(100px, 15vw, 150px);
  border-radius: 50%;
  background: linear-gradient(135deg, #3a7ca5 0%, #2d6080 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  border: 3px solid #3a7ca5;
}

.placeholder-image i {
  font-size: clamp(3rem, 8vw, 5rem);
  color: white;
  opacity: 0.7;
}

/* Collaboration Page header */
.page-header {
  padding: clamp(6rem, 12vw, 8rem) 2rem clamp(3rem, 6vw, 4rem);
  text-align: center;
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

.page-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
}

.page-header p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: #e0e0e0;
  max-width: 800px;
  margin: 0 auto;
}

/* Projects Page Styles */
.section-title {
  color: #3a7ca5;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-title i {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
}

.section-description {
  color: #e0e0e0;
  font-size: clamp(1rem, 1.8vw, 1.1rem);
  margin-bottom: 3rem;
  line-height: 1.6;
}

.projects-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-card {
  background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
  border-radius: 10px;
  padding: clamp(1.5rem, 3vw, 2rem);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  border-left: 4px solid #3a7ca5;
}

.project-card:hover {
  box-shadow: 0 6px 12px rgba(58, 124, 165, 0.3);
  transform: translateX(5px);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.project-header h3 {
  color: white;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.status-badge {
  padding: 0.4rem 0.8rem;
  border-radius: 5px;
  font-size: clamp(0.75rem, 1.5vw, 0.85rem);
  font-weight: bold;
  text-transform: uppercase;
}

.status-ongoing {
  background-color: #3a7ca5;
  color: white;
}

.status-completed {
  background-color: #28a745;
  color: white;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background-color: #24292e;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
  transition: all 0.3s ease;
}

.github-link:hover {
  background-color: #2d3338;
  transform: scale(1.05);
}

.project-short-desc {
  color: #e0e0e0;
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background-color: rgba(58, 124, 165, 0.2);
  color: #3a7ca5;
  padding: 0.3rem 0.7rem;
  border-radius: 15px;
  font-size: clamp(0.75rem, 1.4vw, 0.85rem);
  border: 1px solid #3a7ca5;
}

.expand-btn {
  background: linear-gradient(135deg, #3a7ca5 0%, #2d6080 100%);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: clamp(0.9rem, 1.6vw, 1rem);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}

.expand-btn:hover {
  background: linear-gradient(135deg, #2d6080 0%, #3a7ca5 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(58, 124, 165, 0.3);
}

.expand-btn i {
  transition: transform 0.3s ease;
}

.project-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.project-content.active {
  max-height: 5000px;
  margin-top: 1rem;
}

.markdown-content {
  color: #e0e0e0;
  line-height: 1.8;
  font-size: clamp(0.95rem, 1.7vw, 1.05rem);
}

.markdown-content h2 {
  color: #3a7ca5;
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #3a7ca5;
  padding-bottom: 0.5rem;
}

.markdown-content h3 {
  color: #5a9cc5;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
}

.markdown-content p {
  margin-bottom: 1rem;
}

.markdown-content ul, .markdown-content ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.markdown-content li {
  margin-bottom: 0.5rem;
}

.markdown-content code {
  background-color: #1a1a1a;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #3a7ca5;
}

.markdown-content pre {
  background-color: #1a1a1a;
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
  border-left: 4px solid #3a7ca5;
}

.markdown-content pre code {
  background-color: transparent;
  padding: 0;
  color: #e0e0e0;
}

.markdown-content a {
  color: #3a7ca5;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-bottom 0.3s ease;
}

.markdown-content a:hover {
  border-bottom: 1px solid #3a7ca5;
}

.markdown-content strong {
  color: white;
  font-weight: bold;
}

.markdown-content blockquote {
  border-left: 4px solid #3a7ca5;
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
  color: #c0c0c0;
}
