* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Oswald', sans-serif;
  background: #000;
  height: 100vh;
}

.grid-view {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  justify-content: center;
}

.responsive-img {
  width: 100%;
  max-width: 1200px; /* Image won't grow beyond 800px */
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Example: Make heading text responsive */
@media (max-width: 600px) {
  div[style*="font-size"] p {
    font-size: 35px !important; /* Smaller font for mobile */
  }
}


.card {
  position: relative;
  max-width: 400px;
  height: 500px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(.4,2,.6,1), box-shadow 0.4s;
  flex: 1 1 400px;
  min-width: 280px;
  margin: 0;
}

.profile-name {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  padding: 0.5em 0;
  letter-spacing: 1px;
  z-index: 2;
  opacity: 1;
  transition: none;
  pointer-events: auto;
}

/* Always hide card-content, never show on hover */
.card-content {
  display: none !important;
}



.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: none;
}

.student-info {
  text-align: center;
  line-height: 1.6;
  font-size: 20px;
  font-weight: bold;
}

.icons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 10px 0;
}

.icons i {
  font-size: 24px;
  transition: transform 0.3s;
}

.icons i:hover {
  transform: scale(1.2);
}

.fa-twitter { color: #1DA1F2; }
.fa-linkedin { color: #0077B5; }
.fa-github { color: #171515; }
.fa-envelope { color: #FF5722; }

.bottom-container {
  font-size: 20px;
  text-align: center;
  color: #333;
  padding-bottom: 10px;
}

@media (max-height: 550px) {
  .card {
    height: 90vh;
  }
}

/* Modal styles */
.modal {
  display: flex;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
  transition: opacity 0.4s ease;
}
.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #fff;
  border-radius: 18px;
  width: 650px;         /* Fixed width */
  height: 420px;        /* Fixed height */
  display: flex;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(.4,2,.6,1);
  max-width: 95vw;
  max-height: 95vh;
}
.modal.show .modal-content {
  transform: scale(1);
}

.modal-photo {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 260px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.modal-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-top-left-radius: 18px;
  border-bottom-left-radius: 18px;
  max-width: 260px;
  max-height: 100%;
}

.modal-details {
  flex: 2 1 350px;
  padding: 2rem 1.5rem;
  overflow-y: auto;
  height: 100%;
  color: #222;
  font-family: 'Oswald', Arial, sans-serif;
  background: #fff;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 2rem;
  color: #789ae9;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10001;
  transition: color 0.2s;
}
.modal-close:hover {
  color: #d32f2f;
}

@media (max-width: 700px) {
  .modal-content {
    flex-direction: column;
    width: 95vw;
    height: 75vh;  /* Balanced height for mobile */
    min-width: unset;
    min-height: unset;
    max-width: 98vw;
    max-height: 98vh;
  }
  .modal-photo {
    max-width: 100vw;
    min-height: 210px;  /* Larger image area */
    height: 210px;
    border-radius: 18px 18px 0 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .modal-photo img {
    border-radius: 18px 18px 0 0;
    width: 100%;
    height: 100%;
    max-height: 210px;
    object-fit: contain; /* Show full image, no cropping */
    background: #ffffff;
  }
  .modal-details {
    max-height: calc(75vh - 210px); /* Adjusted to new modal height and image height */
    height: 100%;
    padding: 1.2rem 1rem;
    overflow-y: auto;
  }
}
