/* ==========================================================
   ThroughInfinityy Website
   Author : Mohammed Sheraj
   File   : style.css
========================================================== */

/* ==========================================================
   Global Settings
========================================================== */

html {
  scroll-behavior: smooth;

  scroll-padding-top: 100px;
}

/* ==========================================================
   CSS Variables
========================================================== */

:root {
  --primary-color: #055e9e;
  --secondary-color: #1d2328;

  --background-color: #ffffff;
  --text-color: #333333;

  --border-radius: 10px;
}

/* ==========================================================
   Body
========================================================== */

body {
  margin: 0;
  padding: 90px 20px 20px;

  font-family: Arial, sans-serif;

  line-height: 1.6;

  color: var(--text-color);

  background: linear-gradient(to bottom, #eef3f8, #dfe9f3), url("favicon.jpg");

  background-repeat: no-repeat;

  background-position: center;

  background-size: cover, 350px;
}

/* ==========================================================
   Header
========================================================== */

header {
  position: fixed;

  top: 0;
  left: 20px;
  right: 20px;

  z-index: 1000;

  padding: 10px 20px;

  background: var(--secondary-color);

  color: white;

  border-radius: var(--border-radius);

  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* ==========================================================
   Navigation
========================================================== */

nav {
  display: flex;

  justify-content: space-between;

  align-items: center;
}

nav h1 {
  margin: 0;
}

nav ul {
  display: flex;

  gap: 25px;

  margin: 0;
  padding: 0;

  list-style: none;
}

nav a {
  position: relative;

  color: white;

  text-decoration: none;

  font-weight: bold;

  transition: color 0.3s ease;
}

nav a::after {
  content: "";

  position: absolute;

  left: 0;
  bottom: -5px;

  width: 0%;
  height: 2px;

  background: white;

  transition: width 0.3s ease;
}

nav a:hover {
  color: #7dc4ff;
}

nav a:hover::after {
  width: 100%;
}

/* ==========================================================
   Mobile Menu Button
========================================================== */

.menu-btn {
  display: none;

  background: none;

  border: none;

  font-size: 28px;

  color: var(--text-color);

  cursor: pointer;

  padding: 5px;
}

/* ==========================================================
   Theme Button
========================================================== */

#themeBtn {
  padding: 10px 18px;

  background: white;

  color: var(--primary-color);

  border: none;

  border-radius: 8px;

  cursor: pointer;

  font-size: 15px;

  font-weight: bold;

  transition: transform 0.3s ease;
}

#themeBtn:hover {
  transform: scale(1.05);
}

#themeBtn:active {
  transform: scale(0.96);
}

/* ==========================================================
   Hero Section
========================================================== */

.hero {
  margin-top: 20px;

  padding: 60px 20px;

  text-align: center;

  color: white;

  background: var(--primary-color);

  border-radius: var(--border-radius);
}

.hero img {
  width: 200px;

  position: relative;

  top: 10px;

  transition: transform 0.4s ease;

  animation: slideDown 0.8s ease;
}

.hero h2 {
  animation: slideDown 0.8s ease 0.3s backwards;
}

.hero p {
  animation: slideDown 0.8s ease 0.6s backwards;
}

.hero button {
  padding: 15px 30px;

  background: white;

  color: var(--primary-color);

  border: none;

  border-radius: 8px;

  font-size: 16px;

  font-weight: bold;

  cursor: pointer;

  transition: all 0.3s ease;

  animation: slideDown 0.8s ease 0.9s backwards;
}

.hero button:hover {
  background: #e6e6e6;

  transform: scale(1.05);
}

.hero button:active {
  transform: scale(0.97);
}

/* ==========================================================
   Explore Button Active State
========================================================== */

.hero button.exploring {
  background: #ff3b30;

  color: white;
}
/* ==========================================================
   Features Section
========================================================== */

.features {
  display: flex;

  gap: 20px;

  margin-top: 30px;
}

/* ==========================================================
   Feature Cards
========================================================== */

.card {
  flex: 1;

  padding: 20px;

  background: white;

  border-radius: var(--border-radius);

  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);

  transition:
    transform 0.5s ease,
    box-shadow 0.3s ease;

  animation: fadeUp 0.8s ease;
}

.card:nth-child(1) {
  animation-delay: 0s;
}

.card:nth-child(2) {
  animation-delay: 0.3s;
}

.card:nth-child(3) {
  animation-delay: 0.6s;
}

.card:hover {
  transform: translateY(-10px) scale(1.02);

  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.card h3 {
  margin-top: 0;
}

.card p {
  margin-bottom: 0;
}

/* ==========================================================
   About Section
========================================================== */

.about {
  max-width: 800px;

  margin: 40px auto;
}

.about h2 {
  text-align: center;
}

.about p {
  text-align: left;

  line-height: 1.8;
}

/* ==========================================================
   Contact Section
========================================================== */

.contact {
  max-width: 700px;

  margin: 50px auto;

  padding: 30px;

  background: white;

  border-radius: var(--border-radius);

  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);

  animation: fadeIn 0.8s ease;
}

.contact h2 {
  text-align: center;

  margin-bottom: 10px;
}

.contact p {
  text-align: center;

  margin-bottom: 30px;

  color: #666;
}

.contact form {
  display: flex;

  flex-direction: column;

  gap: 15px;
}

.contact label {
  font-weight: bold;
}

.contact input,
.contact textarea {
  padding: 12px;

  font-size: 16px;

  font-family: Arial, sans-serif;

  border: 1px solid #ccc;

  border-radius: 8px;

  outline: none;

  transition: border-color 0.3s ease;
}

.contact input:focus,
.contact textarea:focus {
  border-color: var(--primary-color);
}

.contact textarea {
  resize: vertical;
}

.contact button {
  padding: 15px;

  background: var(--primary-color);

  color: white;

  border: none;

  border-radius: 8px;

  font-size: 16px;

  font-weight: bold;

  cursor: pointer;

  transition: all 0.3s ease;
}

.contact button:hover {
  background: #044a7c;

  transform: scale(1.03);
}

.contact button:active {
  transform: scale(0.97);
}
/* ==========================================================
   Featured Videos Section
========================================================== */

.video-carousel {
  margin: 50px auto;

  text-align: center;
}

.video-carousel h2 {
  margin-bottom: 25px;
}

/* ==========================================================
   Video Search
========================================================== */

.video-search {
  display: flex;

  justify-content: center;

  align-items: center;

  gap: 12px;

  margin-bottom: 30px;

  flex-wrap: wrap;
}

#videoSearch {
  width: 320px;

  max-width: 100%;

  padding: 12px 18px;

  font-size: 15px;

  border: 2px solid #d0d7de;

  border-radius: 30px;

  outline: none;

  transition: all 0.3s ease;
}

#videoSearch:focus {
  border-color: var(--primary-color);

  box-shadow: 0 0 10px rgba(5, 94, 158, 0.2);
}

#clearSearch {
  padding: 12px 22px;

  background: var(--primary-color);

  color: white;

  border: none;

  border-radius: 30px;

  cursor: pointer;

  transition: 0.3s ease;
}

#clearSearch:hover {
  background: #044a7c;
}

#noResults {
  width: 100%;

  margin-top: 10px;

  font-weight: bold;

  color: crimson;
}

/* ==========================================================
   Carousel
========================================================== */

.carousel {
  display: flex;

  align-items: center;

  justify-content: center;

  gap: 15px;
}

.carousel-viewport {
  width: 900px;

  max-width: 100%;

  overflow: hidden;
}

.carousel-track {
  display: flex;

  gap: 20px;

  transition: transform 0.4s ease;
}

.carousel-card {
  flex: 0 0 280px;

  background: white;

  border-radius: 10px;

  padding: 18px;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);

  transition: transform 0.3s ease;
}

.carousel-card:hover {
  transform: translateY(-8px);
}

.carousel-card img {
  width: 100%;

  height: 180px;

  object-fit: cover;

  border-radius: 8px;
}

.carousel-card h3 {
  margin: 15px 0 10px;
}

.carousel-card p {
  margin-bottom: 15px;
}

.watch-btn {
  width: 100%;

  padding: 12px;

  background: var(--primary-color);

  color: white;

  border: none;

  border-radius: 8px;

  cursor: pointer;

  transition: 0.3s ease;
}

.watch-btn:hover {
  background: #044a7c;
}

#prevBtn,
#nextBtn {
  padding: 12px 18px;

  font-size: 24px;

  border: none;

  border-radius: 50%;

  background: var(--primary-color);

  color: white;

  cursor: pointer;

  transition: 0.3s ease;
}

#prevBtn:hover,
#nextBtn:hover {
  transform: scale(1.1);
}

/* ==========================================================
   API Section
========================================================== */

.api-section {
  margin: 60px auto;

  text-align: center;
}

.api-section h2 {
  margin-bottom: 30px;
}

#apiContainer {
  display: grid;

  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));

  gap: 20px;
}

.api-card {
  background: white;

  padding: 20px;

  border-radius: 10px;

  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);

  transition: 0.3s ease;
}

.api-card:hover {
  transform: translateY(-8px);
}

/* ==========================================================
   Footer
========================================================== */

footer {
  margin-top: 60px;

  padding: 35px 20px;

  background: var(--secondary-color);

  color: white;

  text-align: center;
}

footer h3 {
  margin-bottom: 10px;
}

footer p {
  margin: 8px 0;
}

.footer-links {
  display: flex;

  justify-content: center;

  gap: 20px;

  flex-wrap: wrap;

  margin: 20px 0;
}

.footer-links a {
  color: white;

  text-decoration: none;

  transition: 0.3s ease;
}

.footer-links a:hover {
  color: #7dc4ff;
}
/* ==========================================================
   Dark Mode
========================================================== */

body.dark-mode {
  background: #0f1720;

  color: #f1f5f9;
}

body.dark-mode header {
  background: #111827;
}

body.dark-mode nav a {
  color: #ffffff;
}

body.dark-mode nav a:hover {
  color: #60a5fa;
}

body.dark-mode .card,
body.dark-mode .carousel-card,
body.dark-mode .api-card,
body.dark-mode .contact {
  background: #1e293b;

  color: #ffffff;
}

body.dark-mode input,
body.dark-mode textarea {
  background: #111827;

  color: white;

  border-color: #374151;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #cbd5e1;
}

body.dark-mode #videoSearch {
  background: #111827;

  color: white;
}

body.dark-mode #clearSearch {
  background: #2563eb;
}

body.dark-mode footer {
  background: #111827;
}

body.dark-mode nav ul.menu-open {
  background: #1a1a1a;
}

body.dark-mode nav ul.menu-open li a {
  color: #ffffff;
}

/* ==========================================================
   Scroll To Top Button
========================================================== */

#scrollTopBtn {
  position: fixed;

  bottom: 25px;

  right: 25px;

  width: 50px;

  height: 50px;

  border: none;

  border-radius: 50%;

  background: var(--primary-color);

  color: white;

  font-size: 22px;

  cursor: pointer;

  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);

  opacity: 0;

  visibility: hidden;

  transform: translateY(20px);

  transition: all 0.3s ease;

  z-index: 999;
}

#scrollTopBtn.show {
  opacity: 1;

  visibility: visible;

  transform: translateY(0);
}

#scrollTopBtn:hover {
  transform: scale(1.1);
}

/* ==========================================================
   Preloader
========================================================== */

#preloader {
  position: fixed;

  inset: 0;

  background: #050b16;

  display: flex;

  justify-content: center;

  align-items: center;

  z-index: 99999;

  transition:
    opacity 0.8s ease,
    visibility 0.8s ease;
}

#preloader.hide {
  opacity: 0;

  visibility: hidden;
}

.loader-content {
  text-align: center;

  color: white;
}

.loader-content h1 {
  margin-bottom: 10px;

  font-size: 42px;
}

.loader-content p {
  margin-bottom: 30px;

  color: #cbd5e1;
}

.loader-dots {
  display: flex;

  justify-content: center;

  gap: 10px;
}

.loader-dots span {
  width: 12px;

  height: 12px;

  border-radius: 50%;

  background: #60a5fa;

  animation: loaderBounce 1s infinite;
}

.loader-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loader-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* ==========================================================
   Animations
========================================================== */

@keyframes slideDown {
  from {
    opacity: 0;

    transform: translateY(-40px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;

    transform: translateY(40px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes loaderBounce {
  0%,
  80%,
  100% {
    transform: scale(0.6);

    opacity: 0.5;
  }

  40% {
    transform: scale(1);

    opacity: 1;
  }
}
/* ==========================================================
   Responsive Design
========================================================== */

/* ==========================================================
   Tablet (768px)
========================================================== */

@media (max-width: 768px) {
  .features {
    flex-direction: column;
  }

  .carousel-viewport {
    width: 560px;
  }

  .contact {
    margin: 30px 15px;
  }
}

/* ==========================================================
   Mobile (480px)
========================================================== */

@media (max-width: 480px) {
  body {
    padding: 135px 10px 10px;
  }

  /* ======================================================
       Hero
    ====================================================== */

  .hero img {
    width: 130px;
  }

  .hero h2 {
    font-size: 28px;
  }

  .hero p {
    font-size: 15px;
  }

  .hero button {
    width: 100%;
  }

  /* ======================================================
       Contact
    ====================================================== */

  .contact {
    padding: 20px;
  }

  /* ======================================================
       Video Search
    ====================================================== */

  .video-search {
    flex-direction: column;

    width: 100%;
  }

  #videoSearch,
  #clearSearch {
    width: 100%;

    box-sizing: border-box;
  }

  /* ======================================================
       Carousel
    ====================================================== */

  .carousel {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
  }

  .carousel-viewport {
    width: 280px;
    max-width: calc(100vw - 40px);
    overflow: hidden;
    box-sizing: border-box;
    border-radius: 15px;
  }
  .carousel-track {
    display: flex;
    width: max-content;
    transition: transform 0.4s ease;
    will-change: transform;
  }

  .carousel-card {
    flex: 0 0 280px;
    width: 280px;
    max-width: 100%;
    box-sizing: border-box;

    padding: 15px;

    border-radius: 15px;

    overflow: hidden;
  }
  .carousel-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
  }

  .carousel-card h3 {
    margin: 12px 0 8px;
    line-height: 1.3;
  }

  .carousel-card p {
    margin: 0 0 12px;
  }

  .carousel-card .watch-btn {
    width: 100%;
    box-sizing: border-box;
  }

  /* Hide desktop arrows */

  #prevBtn,
  #nextBtn {
    display: none;
  }

  /* ======================================================
       Navigation
    ====================================================== */

  nav {
    display: grid;

    grid-template-columns: 42px 1fr 42px;

    align-items: center;

    width: 100%;

    min-height: 50px;

    position: relative;
  }

  nav h1 {
    margin: 0;

    font-size: 20px;

    text-align: center;

    white-space: nowrap;
  }

  nav ul {
    display: none;
  }

  /* ======================================================
       Hamburger Button
    ====================================================== */

  .menu-btn {
    display: flex !important;

    justify-content: center;

    align-items: center;

    width: 42px;

    height: 42px;

    margin: 0;

    padding: 0;

    background: transparent;

    border: none;

    color: white;

    font-size: 26px;

    cursor: pointer;

    z-index: 2001;
  }

  /* ======================================================
       Mobile Theme Button
    ====================================================== */

  #themeBtn {
    width: 42px;

    height: 42px;

    margin: 0;

    padding: 0;

    border-radius: 50%;

    justify-self: end;

    font-size: 0;
  }

  #themeBtn::before {
    font-size: 20px;
  }

  body:not(.dark-mode) #themeBtn::before {
    content: "🌙";
  }

  body.dark-mode #themeBtn::before {
    content: "☀️";
  }

  /* ======================================================
       Slide Menu
    ====================================================== */

  nav ul.menu-open {
    display: flex;

    flex-direction: column;

    position: fixed;

    top: 0;

    left: 0;

    width: 240px;

    height: 100vh;

    margin: 0;

    padding: 80px 0 20px;

    background: #ffffff;

    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25);

    animation: slideMenu 0.35s ease;

    z-index: 2000;
  }

  body.dark-mode nav ul.menu-open {
    background: #1a1a1a;
  }

  nav ul.menu-open li {
    width: 100%;
  }

  nav ul.menu-open li a {
    display: block;

    width: 100%;

    padding: 15px 22px;

    color: var(--text-color);

    text-decoration: none;

    transition: background 0.3s ease;
  }

  body.dark-mode nav ul.menu-open li a {
    color: white;
  }

  nav ul.menu-open li a:hover {
    background: rgba(5, 94, 158, 0.12);
  }

  /* ======================================================
       Scroll Button
    ====================================================== */

  #scrollTopBtn {
    width: 45px;

    height: 45px;

    bottom: 20px;

    right: 20px;

    font-size: 20px;
  }
}

/* ==========================================================
   Mobile Animation
========================================================== */

@keyframes slideMenu {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}
/* ==========================================================
   Contact Form Message
========================================================== */

#formMessage {
  margin-top: 15px;
  min-height: 20px;

  font-size: 14px;
  font-weight: 600;

  text-align: center;

  transition: opacity 0.3s ease;
}

#formMessage.success {
  color: #198754;
}

#formMessage.error {
  color: #dc3545;
}
