/* General Styles */
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  background: #0f0f0f;
  color: #ffffff;
  overflow-x: hidden;
  scroll-behavior: smooth;
  transition: background 0.5s, color 0.5s;
}

body.light-mode {
  background: #f0f0f0;
  color: #000;
}

/* Custom Scrollbar */
body::-webkit-scrollbar {
  width: 10px;
}

body::-webkit-scrollbar-track {
  background: #1a1a1a;
}

body::-webkit-scrollbar-thumb {
  background: #00ffcb;
  border-radius: 5px;
}

body.light-mode::-webkit-scrollbar-track {
  background: #e0e0e0;
}

body.light-mode::-webkit-scrollbar-thumb {
  background: #00aa7f;
}

/* Navbar */
.navbar {
  position: fixed;
  width: 100%;
  top: 0;
  background: rgba(0, 0, 0, 0.8);
  padding: 15px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(10px);
  transition: background 0.5s;
  box-sizing: border-box;
}

body.light-mode .navbar {
  background: rgba(255, 255, 255, 0.8);
}

.navbar .logo {
  color: #ffffff;
  font-size: 1.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.5s;
}

body.light-mode .navbar .logo {
  color: #000;
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
  align-items: center;
}

.navbar ul li a {
  text-decoration: none;
  color: #ffffff;
  font-weight: 500;
  transition: color 0.3s ease;
}

body.light-mode .navbar ul li a {
  color: #000;
}

.navbar ul li a:hover {
  color: #00ffcb;
}

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: #ffffff;
  transition: color 0.5s;
  padding: 0;
  margin: 0;
}

body.light-mode #theme-toggle {
  color: #000;
}

/* Hero Section */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: 100vh;
  position: relative;
  padding: 0 5%;
  z-index: 1;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  transition: filter 0.5s;
}

.hero-title {
  font-size: 4rem;
  margin-bottom: 20px;
  color: #ffffff;
  text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: color 0.5s;
}

body.light-mode .hero-title {
  color: #000;
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 30px;
  color: #cccccc;
  transition: color 0.5s;
}

body.light-mode .hero-subtitle {
  color: #555;
}

/* CTA and Action Buttons */
.cta-btn, .action-btn {
  padding: 15px 30px;
  background: linear-gradient(45deg, #00ffcb, #00ffaa);
  color: #000;
  text-decoration: none;
  border-radius: 30px;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  border: none;
  cursor: pointer;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
  z-index: 10;
}

.cta-btn.small, .action-btn {
  padding: 10px 20px;
  font-size: 1rem;
  background-color: #00ffcb; /* Solid background for visibility */
  color: #000;
  border: 2px solid #00aa7f; /* Border for contrast */
}

.cta-btn:hover, .action-btn:hover {
  transform: scale(1.1);
  background: linear-gradient(45deg, #00ffaa, #00ffcb);
}

/* Portfolio Sections */
.portfolio-section {
  padding: 100px 5%;
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 20px;
  transition: color 0.5s;
}

body.light-mode .section-title {
  color: #000;
}

.section-desc {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 40px;
  color: #aaaaaa;
  transition: color 0.5s;
}

body.light-mode .section-desc {
  color: #555;
}

.section-desc a {
  color: #00ffcb;
  text-decoration: none;
}

body.light-mode .section-desc a {
  color: #00aa7f;
}

.section-desc a:hover {
  color: #00ffaa;
}

.video-gallery, .photo-gallery, .game-gallery, .repo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.video-card, .photo-card, .game-card, .repo-card {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.5s;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

body.light-mode .video-card, body.light-mode .photo-card, body.light-mode .game-card, body.light-mode .repo-card {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.video-card:hover, .photo-card:hover, .game-card:hover, .repo-card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.video-card iframe {
  width: 100%;
  height: 200px;
  border-radius: 10px;
  border: none;
}

.photo-card img, .game-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}

.game-card p, .repo-card p {
  font-size: 1rem;
  margin: 10px 0;
  color: #cccccc;
}

body.light-mode .game-card p, body.light-mode .repo-card p {
  color: #555;
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.skill-card {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.5s;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode .skill-card {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.skill-card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.progress-bar {
  height: 10px;
  background-color: #ddd;
  border-radius: 5px;
  margin-top: 10px;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  display: block;
  height: 100%;
  background-color: #00ffcb;
  width: 0;
  transition: width 1s ease-in-out;
}

.skill-card[data-skill="100"] .progress-bar::after {
  width: 100%;
}

.skill-card[data-skill="80"] .progress-bar::after {
  width: 80%;
}

.skill-card[data-skill="60"] .progress-bar::after {
  width: 60%;
}

/* Work History Section */
.work-card {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.5s;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode .work-card {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.work-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

/* Projects Section */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.project-card {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.5s;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode .project-card {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.project-card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.project-button {
  padding: 10px 20px;
  background: linear-gradient(45deg, #00ffcb, #00ffaa);
  color: #000;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.project-button:hover {
  transform: scale(1.1);
}

.project-button.disabled {
  background: #555;
  cursor: not-allowed;
}

/* Rocket Section (Wikipedia-Style Tabs) */
.wiki-tabs {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  max-width: 800px;
  margin: 0 auto;
}

.tab-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

.tab-btn {
  background: transparent;
  border: 1px solid #00ffcb;
  color: #00ffcb;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s, color 0.3s;
  opacity: 1 !important;
  visibility: visible !important;
}

.tab-btn.active {
  background: #00ffcb;
  color: #000;
}

.tab-btn:hover {
  background: #00ffaa;
  color: #000;
}

.tab-content {
  display: none;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
}

.tab-content.active {
  display: block;
}

.tab-content ul {
  list-style-type: disc;
  padding-left: 20px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.media-item iframe, .media-item img {
  width: 100%;
  border-radius: 10px;
}

/* Contact Section */
#contact {
  position: relative;
  background: #0f0f0f;
  overflow: hidden;
  transition: background 0.5s;
}

body.light-mode #contact {
  background: #f0f0f0;
}

.contact-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.3;
}

.contact-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  position: relative;
  z-index: 1;
  justify-items: center;
  margin: 0 auto;
  max-width: 1200px;
}

.contact-card {
  background: #1a1a1a;
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
  max-width: 300px;
  box-sizing: border-box;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

body.light-mode .contact-card {
  background: #e0e0e0;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.contact-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

body.light-mode .contact-card:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.contact-logo {
  width: 40px;
  height: 40px;
  display: block;
  margin: 0 auto 10px;
  transition: transform 0.3s ease;
  object-fit: contain;
  max-width: 100px; /* Adjust as needed */
}

.contact-card:hover .contact-logo {
  transform: scale(1.2);
}

.contact-card h3 {
  font-size: 1.5rem;
  margin: 10px 0;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
}

body.light-mode .contact-card h3 {
  color: #000;
}

.contact-link {
  color: #00ffcb;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  font-family: 'Poppins', sans-serif;
  transition: color 0.3s ease;
  word-break: break-all;
}

body.light-mode .contact-link {
  color: #00aa7f;
}

.contact-link:hover {
  color: #00ffaa;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 800px;
  text-align: center;
}

body.light-mode .modal-content {
  background-color: #f0f0f0;
}

.modal-close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.modal-close:hover,
.modal-close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.modal-loader {
  font-size: 1.2rem;
  color: #00ffcb;
}

/* Back to Top Button */
#back-to-top {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99;
  border: none;
  outline: none;
  background-color: #00ffcb;
  color: #000;
  cursor: pointer;
  padding: 15px;
  border-radius: 10px;
  font-size: 18px;
  opacity: 1 !important;
  visibility: visible !important;
}

#back-to-top:hover {
  background-color: #00ffaa;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px 5%;
  background: #0f0f0f;
  color: #aaaaaa;
  font-size: 0.9rem;
  transition: background 0.5s, color 0.5s;
}

body.light-mode footer {
  background: #e0e0e0;
  color: #555;
}

footer a {
  text-decoration: none;
  color: #00ffcb;
  font-weight: 500;
  transition: color 0.5s;
}

body.light-mode footer a {
  color: #00aa7f;
}

footer a:hover {
  color: #00ffaa;
}

/* Responsive Image */
.responsive-image {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Video Wrappers for Responsive Scaling */
.video-wrapper {
  position: relative;
  width: 100%;
  height: 0;
  overflow: hidden;
}

.aspect-16-9 {
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.aspect-9-16 {
  padding-top: 177.78%; /* 9:16 Aspect Ratio (vertical) */
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Media Gallery Grid for Responsiveness */
.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.media-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Infobox Image: Smaller Size, Centered */
.infobox-image {
  max-width: 200px; /* Adjusted to make it smaller; tweak this value as needed */
  height: auto;
  display: block;
  margin: 0 auto; /* Centers the image */
}

/* Center Wrapper */
.center-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* Curvy Corner Outline */
.curvy-corner-outline {
  position: relative;
  display: inline-block;
  width: 300px; /* Resize as needed */
  border-radius: 20px;
  overflow: hidden;
}

.curvy-corner-outline::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 20px;
  border: 4px solid #00ffaa;
  pointer-events: none;
  box-sizing: border-box;

  /* Mask to show corners only */
  mask:
    radial-gradient(circle 20px at top left, #000 98%, transparent 100%) top left,
    radial-gradient(circle 20px at top right, #000 98%, transparent 100%) top right,
    radial-gradient(circle 20px at bottom left, #000 98%, transparent 100%) bottom left,
    radial-gradient(circle 20px at bottom right, #000 98%, transparent 100%) bottom right;
  mask-repeat: no-repeat;
  mask-size: 40px 40px;

  -webkit-mask:
    radial-gradient(circle 20px at top left, #000 98%, transparent 100%) top left,
    radial-gradient(circle 20px at top right, #000 98%, transparent 100%) top right,
    radial-gradient(circle 20px at bottom left, #000 98%, transparent 100%) bottom left,
    radial-gradient(circle 20px at bottom right, #000 98%, transparent 100%) bottom right;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 40px 40px;
}

.curvy-corner-outline img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
}

/* Center Button Wrapper */
.center-button-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* Green Button */
.green-button {
  background-color: #00ffaa;
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 16px;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.green-button:hover {
  background-color: #00e699;
  transform: scale(1.05);
}

/* About Image */
.about-image-wrapper {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.about-image {
  width: 200px; /* Adjust size as needed */
  border-radius: 16px;
  border: 4px solid #00ffaa; /* Optional: adds a green border */
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
  .navbar {
    padding: 12px 5%;
  }

  .navbar ul {
    gap: 12px;
  }

  .navbar .logo {
    font-size: 1.4rem;
  }

  .hero-title {
    font-size: 2.5rem;
    line-height: 1.2;
    padding: 0 10px;
  }

  .hero-subtitle {
    font-size: 1.2rem;
    padding: 0 15px;
  }

  .cta-btn {
    padding: 12px 25px;
    font-size: 1rem;
  }

  .portfolio-section {
    padding: 60px 5%;
  }

  .section-title {
    font-size: 2rem;
  }

  .section-desc {
    font-size: 1rem;
  }

  .video-gallery, .photo-gallery, .game-gallery, .repo-gallery, .skills-grid, .project-gallery {
    grid-template-columns: 1fr;
  }

  .video-card iframe {
    height: 180px;
  }

  .contact-gallery {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .contact-card {
    padding: 15px;
    max-width: 280px;
    min-height: 160px;
  }

  .contact-logo {
    width: 35px;
    height: 35px;
  }

  .contact-card h3 {
    font-size: 1.3rem;
  }

  .contact-link {
    font-size: 1rem;
  }

  .tab-links {
    flex-direction: column;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }

  .progress-bar {
    height: 8px;
  }
}

@media (max-width: 480px) {
  .navbar ul li a {
    font-size: 0.9rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .video-card iframe {
    height: 150px;
  }
}

@media (hover: none) {
  #hero-canvas {
    transform: translateZ(0);
    will-change: transform;
  }

  .video-card, .photo-card, .game-card, .repo-card {
    transform: none !important;
  }
}

/* Only apply centering/scaling to the Vlogging video inside the YouTube Videos section */
#youtube-videos .vlog-gallery {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  max-width: 600px;
}

/* Optional: style for the single vlog video card */
#youtube-videos .vlog-gallery .video-card {
  flex: 1 1 0;
  max-width: 600px;
}

#youtube-videos .vlog-gallery iframe {
  width: 100%;
  height: 340px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

#loader-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #0f0f0f;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  transition: opacity 0.5s;
}

#loader-canvas {
  display: block;
  width: 160px;
  height: 160px;
  background: transparent;
}

#loader-text {
  margin-top: 32px;
  font-family: 'Poppins', sans-serif;
  font-size: 1.4rem;
  color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.19);
  transition: color 0.5s;
}

/* Light Mode: Loader styles adapt on theme */
body.light-mode #loader-overlay {
  background: #f0f0f0;
}

body.light-mode #loader-text {
  color: #111;
  text-shadow: 0 2px 6px rgba(180,180,180,0.11);
}

