html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

@media only screen and (max-device-width: 768px) {
  body {
    margin:0;
    padding:0;
    top: -20;
    z-index: -100;
    background-color: black;
  }

  .card-container {
    height: 100%;
  }

  /* Fix logo and navigation positioning to prevent overlap */
  .nav {
    position: relative;
    z-index: 100;
    min-height: auto;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .container {
    display: flex;
    flex-direction: column;
    padding: 10px 10px 0 10px;
    justify-content: center;
    align-items: center;
    gap: 0px;
    margin-bottom: 0;
  }

  .telugu-logo {
    width: 80px;
    height: 80px;
    animation: logoMobileFadeOut 3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards !important;
  }

  /* Mobile-specific logo animation - animate then fade out */
  @keyframes logoMobileFadeOut {
    0% {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(2);
      opacity: 1;
      z-index: 1000;
    }
    50% {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(2);
      opacity: 1;
      z-index: 1000;
    }
    80% {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(2);
      opacity: 1;
      z-index: 1000;
    }
    100% {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(2);
      opacity: 0;
      z-index: -1;
      pointer-events: none;
    }
  }

  /* Hide text navigation on mobile and show dot navigation instead */
  .main_list {
    display: none;
  }

  .dot-navigation {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 10px 0 5px 0;
    width: 100%;
    position: relative;
    z-index: 200;
    margin-bottom: 10px !important;
  }

  .nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    flex-shrink: 0;
  }

  .nav-dot.active {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
  }

  /* Navigation improvements */
  h2 {
    font-size: 16px;
  }

  /* Title and header improvements - better spacing without logo */
  .typewriter {
    padding-top: 0px !important;
    margin-top: 0px !important;
  }

  .typewriter h1 {
    font-size: 40px;
    padding: 0 15px;
    text-align: center;
    line-height: 1.2;
    height: auto !important;
    margin: 0 !important;
  }

  /* Card improvements for better readability */
  .card {
    width: 90%;
    margin: 10px auto;
    padding: 15px;
    font-size: 16px;
  }

  .card-body {
    padding: 15px;
  }

  .card-header {
    font-size: 20px;
    padding: 12px 15px;
  }

  .card-text {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 12px;
  }

  /* Stack images above text on mobile */
  .card.mb-3.about {
    flex-direction: column !important;
    align-items: center !important;
  }

  .card.mb-3.about .card-body {
    width: 100%;
  }

  /* Image improvements - make images responsive and fit within cards */
  .card-img-top {
    width: 150px;
    height: 150px;
    margin: 10px auto;
  }

  .card-img-gallery {
    width: 150px;
    height: 150px;
  }

  .card-img-gallery-container {
    gap: 10px;
    margin-bottom: 10px;
  }

  /* Make all images in cards responsive */
  .card img {
    max-width: 100%;
    height: auto;
  }

  .card-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
  }

  /* Icon/Footer improvements - make more touchable */
  .footer {
    padding-bottom: 10px;
    padding-top: 10px;
    background: linear-gradient(to top, #1c1c20 0%, transparent 100%);
  }

  .dock {
    padding: 10px;
  }

  .icon {
    padding: 10px;
  }

  .icon img {
    width: 40px !important;
    height: 40px !important;
  }

  #scholar img {
    width: 45px !important;
    height: 45px !important;
  }

  /* Card container improvements */
  .card-container-home {
    max-height: calc(100vh - 210px);
    padding: 0 10px 180px 10px;
    gap: 15px;
    margin-top: 10px !important;
    padding-top: 10px !important;
    padding-bottom: 180px !important;
  }

  /* Adjust the gradient overlay for mobile */
  .card-container-home::after {
    height: 150px;
  }

  /* Journal list improvements */
  .journal-list-item {
    padding: 15px;
    margin-bottom: 12px;
  }

  .journal-list-item h3 {
    font-size: 18px;
  }

  .journal-list-item .journal-date {
    font-size: 14px;
  }

  .journal-back-button {
    padding: 12px 20px;
    font-size: 16px;
  }

  /* PDF viewer improvements - hide iframe on mobile, show download only */
  .pdf-iframe-container {
    display: none !important;
  }

  .pdf-viewer-container {
    padding: 20px;
    text-align: center;
  }

  .pdf-download {
    padding: 0;
  }

  .pdf-download .btn {
    font-size: 18px;
    padding: 15px 30px;
  }

  /* Improve link touch targets */
  a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  canvas { display: none; }
}

#main  {
	position: relative;
	margin: 0;
	height: 100%;
	width:  100%;
	overflow:hidden;
}

/* Ensure Vanta canvas stays in background and doesn't block interactions */
#main canvas {
	pointer-events: none !important;
	z-index: -3 !important;
}

/* Ensure specific elements are above the Vanta background */
.typewriter, .card-container-home {
	position: relative;
	z-index: 1;
}

.nav {
	position: relative;
	z-index: 100;
}

.footer, .nav-arrow {
	z-index: 100;
}

#main2  {
	position: relative;
	margin: 0; 
	height: 100%;
	width:  100%;
}

canvas {
  margin: 0;
	position: fixed;
	z-index: -3;
}

#canv {
	display: none;
}


.title {
	/*width: 29ch;*/
  opacity: 0;
  animation-name: fadeIn;
  animation-duration: 1s; /* Duration of the animation */
  animation-delay: 0.75s; /* Start after logo animation completes */
  animation-fill-mode: forwards; /* Ensures the element remains in the final state */
  overflow: hidden;
  white-space: nowrap;
  margin-top: -50px;
}

.title-visible {
  opacity: 1 !important;
  animation: none !important;
}

/* DEMO-SPECIFIC STYLES */
.typewriter {
  padding-top: 80px;
}

.typewriter h1 {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 10vh;
  font-family: monospace;
  font-size: 44px;
  flex-direction: column;
  color: #E0F2F1;
}

h2 {
  margin: 0;
  padding: 0;
  color: #fff;
  font-family: monospace;
  opacity: 0.8;
  font-weight: normal;
  transition: opacity 0.3s ease, font-weight 0.3s ease;
}

.nav-link-active h2 {
  opacity: 1;
  font-weight: bold;
}

/* Define the keyframes for fade-in */
@keyframes fadeIn {
  from {
      opacity: 0;
  }
  to {
      opacity: 1;
  }
}

.footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  color: white;
}

.dock {
  display: flex;
  justify-content: center;
}

.icon {
  padding: 5px;
}

.navlinks ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.navlinks li {
  display: inline;
  float: left;
  padding-left: 15px;
}

.container {
  display: flex;
  padding-top: 1%;
  padding-left: 2%;
}

.logo-text {
  font-size: 36px;
}

.telugu-logo {
  width: 120px;
  height: 120px;
  cursor: pointer;
  animation: moveToCorner 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.telugu-char {
  stroke-dasharray: 1000;
  stroke-dashoffset: 0;
  animation: drawOnStartup 2s ease-in-out forwards;
}

.telugu-logo:hover .telugu-char {
  animation: draw 2s ease-in-out;
}

@keyframes drawOnStartup {
  from {
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes draw {
  from {
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes moveToCorner {
  0% {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(2);
    z-index: 1000;
  }
  100% {
    position: fixed;
    top: 1%;
    left: 2%;
    transform: translate(0, 0) scale(1);
    z-index: 1000;
  }
}

.main_list {
  position:absolute;
  right: 10px;
}

/* Dot navigation - hidden on desktop */
.dot-navigation {
  display: none;
}

a {
  text-decoration: none;
}

.card {
  margin: auto;
  width: 70%;
  padding-top: 10px;
}

.card-img-top {
  width: 200px;
  height: 200px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 10px;
}

.card-img-gallery-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  align-items: center;
  margin-bottom: 15px;
}

.card-img-gallery {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

/* PDF Viewer Styles */
.pdf-viewer-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.pdf-iframe-container {
  width: 100%;
  height: 600px;
  background-color: rgba(255, 255, 255, 0.02);
  border-radius: 5px;
  overflow: hidden;
}

.pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 5px;
}

.pdf-download {
  padding: 10px;
}

.card-container {
  height: 100%;
  padding-top: 5px;
}

.exit {
  position: fixed;
  padding-top: 1%;
  font-size: 40px;
  text-align: right;
  right: 0;
}

.card {
  margin-top: 10px;
  max-height: 100%;
  margin-bottom: 10px;
  animation-name: fadeIn;
  animation-duration: 1s; /* Duration of the animation */
  animation-fill-mode: forwards; /* Ensures the element remains in the final state */
}


.card.mb-3.about {
  display: flex;
  flex-direction: row; /* Aligns children (img and text) in a row */
  align-items: flex-start; /* Aligns items at the start of the cross axis */
  padding: 10px;
}


.exitlink {
  z-index: 9999;
}


.card-text.lower {
  margin-top: 20px
}

.card-container-home {
  opacity: 0;
  animation: fadeIn 1s ease-in-out forwards;
  animation-delay: 0.75s;
  padding-top: 0px;
  margin-top: -20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 0;
  transition: opacity 0.3s ease-in-out;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  overflow-x: hidden;
  gap: 20px;
  padding-bottom: 0px;
  position: relative;
}

.card-container-home::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, #0f0f0f 0%, transparent 100%);
  pointer-events: none;
  z-index: 10;
}

/* Navigation arrows */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
  z-index: 100;
  padding: 20px;
  font-family: monospace;
  animation: arrowIntro 2s ease-in-out forwards, arrowPulse 1.5s ease-in-out infinite;
  animation-delay: 1s, 3s;
}

.nav-arrow:hover {
  color: rgba(255, 255, 255, 1);
  transform: translateY(-50%) scale(1.2);
  animation: none;
}

.nav-arrow-left {
  left: 20px;
}

.nav-arrow-right {
  right: 20px;
}

@keyframes arrowIntro {
  0% {
    color: rgba(255, 255, 255, 0.7);
  }
  100% {
    color: rgba(255, 255, 255, 0.4);
  }
}

@keyframes arrowPulse {
  0%, 100% {
    color: rgba(255, 255, 255, 0.4);
  }
  50% {
    color: rgba(255, 255, 255, 0.7);
  }
}

@media only screen and (max-device-width: 768px) {
  .nav-arrow {
    display: none;
  }
}

.about-home {
  max-width: 1000px;
  margin: 0 auto;
}

.card-text a {
  color: #82B1FF;
  text-decoration: none;
}

.card-text a:hover {
  text-decoration: underline;
}


/* Card styling for non-about sections */
.card-container-home .card {
  max-width: 1000px;
  width: 100%;
  flex-shrink: 0;
}

.card-container-home .about-home {
  max-width: 1000px;
  width: 100%;
  flex-shrink: 0;
}

/* Custom scrollbar styling for the container */
.card-container-home::-webkit-scrollbar {
  width: 8px;
}

.card-container-home::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 4px;
}

.card-container-home::-webkit-scrollbar-thumb {
  background: #1976D2;
  border-radius: 4px;
}

.card-container-home::-webkit-scrollbar-thumb:hover {
  background: #1565C0;
}

/* Journal list view styles */
.journal-list {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
}

.journal-list-item {
  padding: 20px;
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.journal-list-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-left-color: #1976D2;
  transform: translateX(5px);
}

.journal-list-item h3 {
  margin: 0;
  color: #E0F2F1;
  font-family: monospace;
  font-size: 20px;
}

.journal-list-item .journal-date {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.6);
  font-family: monospace;
  font-size: 14px;
}

/* Journal detail view styles */
.journal-detail {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
}

.journal-back-button {
  display: inline-block;
  padding: 10px 20px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: #E0F2F1;
  font-family: monospace;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.journal-back-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #1976D2;
  transform: translateX(-5px);
}

.journal-back-button::before {
  content: '← ';
}