/* Add CSS Variables at the top for theming */
:root {
  --bg-color: #fff;
  --text-color: #333;
  --nav-bg-color: #eee;
  --grid-item-bg-color: #eee;
  --link-color: #333;
  --link-hover-color: #ffa800;
  --code-bg-color: #2d2d2d;
}

body.dark-mode {
  --bg-color: rgb(26, 26, 26);
  --text-color: #f0f0f0;
  --nav-bg-color: #2a2a2a;
  --grid-item-bg-color: #333;
  --link-color: #f0f0f0;
  --code-bg-color: #1e1e1e;
}


body {
  margin: 0;
  font-family: Poppins,sans-serif;
  font-weight: 400;
  font-style: normal;
  /* MODIFIED: Use CSS variables */
  background-color: var(--bg-color);
  color: var(--text-color);
  /* transition: background-color .3s ease-in-out, color .3s ease-in-out; */
}
.navbar {
  /* MODIFIED: Use CSS variable */
  background-color: var(--nav-bg-color);
  position: fixed;
  top: 0;
  width: 100%;
  height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
  z-index: 1000;
  /* transition: background-color .3s ease-in-out; */
}
.navbar-links {
  display: flex;
  gap: 12px
}
.navbar-icons {
  display: flex;
  gap: 12px; /* Increased gap for new icon */
  align-items: center; /* Vertically align icons */
}
.navbar a {
  text-decoration: none;
  font-size: .7rem
}
.navbar-icons a {
  font-size: 20px
}
.navbar a.active,
.navbar a:hover {
  /* MODIFIED: Use CSS variable */
  color: var(--link-hover-color)
}
.header {
  padding-top: 50px;
  margin: 0 auto;
  z-index: 200;
  width: 300px;
  height: 240px;

}
.header-image {
  cursor: pointer;
  top: 0; left: 0; clip-path: inset(2px 2px);
}
#heading {
  text-align: center;
  padding: 0px 0px 30px 0px;
  margin: 0 auto;
  width: 98%;

}
.grid-container {
  display: grid;
  grid-template-columns: repeat(8,1fr);
  grid-auto-flow: dense;
  gap: 1.5vw;
  padding-left: 9vw;
  padding-right: 9vw;
  padding-bottom: 9vw
}
.grid-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  font-weight: 700;
  /* MODIFIED: Use CSS variable */
  background-color: var(--grid-item-bg-color);
  opacity: 0;
  transition: opacity .3s ease-in-out, background-color .3s ease-in-out; /* Smooth transition */
  cursor: pointer
}
.grid-item.loaded {
  opacity: 1
}
/* Apply hover effects only on devices that can truly hover */
@media (hover: hover) {
    .grid-item:hover video,
    .grid-item:hover img {
        transform: scale(1.09);
    }

    .grid-item:hover .see-more-btn {
        opacity: 1;
        transform: translateY(0);
    }
}

.see-more-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: rgba(255,255,255,.9);
  padding: 4px 8px;
  border-radius: 5px;
  font-size: .7rem;
  font-weight: 400;
  text-decoration: none;
  letter-spacing: -.5px;
  opacity: 0;
  transform: translateY(0);
  transition: opacity .3s ease-in-out,transform .3s ease-in-out;
  z-index: 2;
}

.see-more-btn {
  color:#333 !important;
}

.see-more-btn:hover {
  color:var( --link-hover-color) !important;
}

.grid-item:hover .id-tab {
  opacity: 0;
  transform: translateY(0)
}
.item-1 {
  grid-column: span 4;
  grid-row: span 2
}
.item-18 {
  grid-column: span 8
}
.item-10 {
  grid-column: span 6
}
.item-11,
.item-12,
.item-13,
.item-14,
.item-15,
.item-19,
.item-20,
.item-4,
.item-5,
.item-6,
.item-7,
.item-8 {
  grid-column: span 4
}
.item-16,
.item-17,
.item-2,
.item-3,
.item-9 {
  grid-column: span 2
}
.item-1,
.item-2,
.item-3 {
  aspect-ratio: 4/5
}
.item-9 {
  aspect-ratio: 9/16
}
.item-11,
.item-12,
.item-19,
.item-20,
.item-5,
.item-6,
.item-7,
.item-8 {
  aspect-ratio: 1/1
}
.item-10,
.item-13,
.item-14,
.item-15,
.item-18 {
  aspect-ratio: 16/9
}
.item-16,
.item-17 {
  aspect-ratio: 1/1.163
}
.item-4 {
  aspect-ratio: 16/9.8
}
img,
video {
  width: 101%;
  height: 101%;
  object-fit: cover;
  transition: transform .3s ease-in-out
}
p {
  font-weight: 400;
  font-size: .8rem;
  letter-spacing: -.5px;
  margin: -5px;
  padding: 0
}
h1 {
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -.5px;
  margin: 0;
  padding: 0
}
a:link {
  /* MODIFIED: Use CSS variable */
  color: var(--link-color);
}
a:visited {
  /* MODIFIED: Use CSS variable */
  color: var(--link-color);
}
a:hover {
  /* MODIFIED: Use CSS variable */
  color: var(--link-hover-color);
}
.id-tab {
  position: absolute;
  bottom: 0;
  left: 0;
  background-color: rgba(80,80,80,.5);
  color: #fff;
  padding: 8px 15px;
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: 0;
  z-index: 2;
  border-radius: 0 5px 0 0;
  transition: opacity .3s ease-in-out
}
#reduce-motion-btn {
  position: absolute;
  top: 40px;
  right: 20px;
  background-color: #ffa800;
  color: #fff;
  padding: 5px 10px;
  font-size: .7rem;
  font-weight: 600;
  border-radius: 0 0 5px 5px;
  cursor: pointer;
  z-index: 999;
  transition: background-color .3s
}
#reduce-motion-btn:hover {
  background-color: #333
}

.project-container {
  margin: 0 auto;
  padding-left: 9vw;
  padding-right: 9vw;
  padding-bottom: 9vw
}
.project-component {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 1.5vw
}
.media-container {
  display: flex;
  gap: 1.5vw
}
.media-container.two-column {
  flex-direction: row
}
.media-item {
  flex: 1;
  min-width: 0;
  border-radius: 8px;
  overflow: hidden;
  /* MODIFIED: Use CSS variable */
  background-color: var(--grid-item-bg-color);
  position: relative
}
.media-item img,
.media-item video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover
}
.component-description {
  font-size: .8rem;
  font-style: italic;
  padding-left: 5px
}
/* @media (max-width:768px) {
  .media-container.two-column {
    flex-direction: column
  }
} */
.play-button-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: 80px;
  height: 80px;
  background-color: rgba(255,255,255,.9);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 30px;
  cursor: pointer;
  transition: opacity .3s ease,visibility .3s ease;
  z-index: 3
}

.play-button-overlay i {
  /* color: #333; */
  color: #333;
}

.play-button-overlay .fa-play {
  margin-left: 5px
}


/* For short videos, this moves the button to the corner when playing */
.interactive-video.custom-controls.is-playing .play-button-overlay {
  top: auto;
  left: auto;
  bottom: 15px;
  right: 15px;
  transform: none;
  width: 50px;
  height: 50px;
  font-size: 20px;

}

/* For long videos, this hides the button to show the native controls */
.interactive-video.native-controls-active .play-button-overlay {
  opacity: 0;
  visibility: hidden;
}

/* =========================================
 * Banner Showcase Component
 * ========================================= */

/* Styling for the iframe that holds the banner */

.media-item {
    display: flex;
    justify-content: center;
    align-items: center;
}

iframe {
    border: none;
    background-color: #eeeeee;
    padding: 20px;
}

/* Styling for the code display block */
.code-display {
    /* MODIFIED: Use CSS variable */
    background-color: var(--code-bg-color);
    color: #f8f8f2;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.5rem !important; /* Increased slightly for readability */
    overflow: hidden;
    box-sizing: border-box;
    padding: 20px !important;
    margin: 0 !important;
    width: 100% !important; /* Ensure it takes full width */
    transition: background-color .3s ease-in-out; /* Smooth transition */
}

/* Apply wrapping rules to both the <pre> and <code> tags */
.code-display,
.code-display code {
    white-space: pre-wrap !important;   /* Preserves whitespace and wraps */
    word-break: break-all !important;   /* ADDED: Forcefully breaks long strings like URLs */
}

/* The background container for animations */
#floating-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* Places it behind all other content */
    pointer-events: none; /* Allows clicks to pass through to content behind it */
}


@media (max-width: 768px) and (orientation: portrait) {
  .grid-container {
    grid-template-columns: 1fr
  }
  .grid-item {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: auto
  }

   .media-container.two-column {
    flex-direction: column
  }

  /* For short videos, this moves the button to the corner when playing */
  .interactive-video.custom-controls.is-playing .play-button-overlay {
    top: auto;
    left: auto;
    bottom: 15px;
    right: 15px;
    transform: none;
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
}


.multi-icon-fa {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 16px; /* Adjust size as needed */
  color: rgba(255, 255, 255, 0.85);
  z-index: 2; /* Sits above the video/image */
  pointer-events: none; /* Allows clicks to pass through */
}

