/* Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    background: #fafafa;
}

/* ===== Top Navbar ===== */
/* NAVBAR */
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 50px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav .logo img {
    height: 40px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

nav .logo img:hover {
    transform: scale(1.1);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    margin-left: auto;
}

nav ul li {
    cursor: pointer;
    position: relative;
}

nav ul li:hover {
    color: #e60000;
}

/* new one css nav bar animation */
nav ul li {
    cursor: pointer;
    position: relative;
    padding: 5px 0;
}

nav ul li::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 2px;
    background: #e60000;
    transition: width 0.3s ease;
}

nav ul li:hover::after {
    width: 100%;
}

nav ul li ul {
    position: absolute;
    top: 40px;
    left: 0;
    background: #fff;
    padding: 10px 0;
    list-style: none;
    border-radius: 6px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: all 0.3s ease;
}

nav ul li:hover ul {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

nav ul li ul li {
    padding: 5px 5px;
    text-align: left;
    white-space: nowrap;
}

nav ul li ul li:hover {
    background: #f6f6f6;
    color: #e60000;
}

nav {
    animation: slideDown 0.6s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-80px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* nav.sticky {
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      transition: 0.3s ease;
    } */

ul li a {
    text-decoration: none;
    /* removes underline */
    color: inherit;
    /* keeps the text color same as the parent */
}

      /* --- BUTTON --- */
    .nav-btn {
      background: #e60000;
      color: #fff;
      border: none;
      padding: 10px 20px;
      border-radius: 6px;
      font-size: 15px;
      cursor: pointer;
      transition: all 0.3s;
    }

    .nav-btn:hover {
      background: #0f4c91;
      transform: scale(1.05);
    }



/* ===== Scroll Progress Bar (will sit under navbar) ===== */
#progress-bar {
    position: fixed;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #78eec4, #FF5722);
    width: 0%;
    z-index: 1500;
    transition: width 0.18s linear;
}

/* ===== Search Section ===== */
.searchbar {
    background: linear-gradient(135deg, #14aae0, #fd9c9a);
    text-align: center;
    padding: 60px 20px;
    color: #fff;
    animation: fadeIn 1.2s ease-in-out;
}

/* Typing effect: use ch units and exact character count for stable animation */
.searchbar h1 {
    font-size: 32px;
    margin-bottom: 20px;
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid rgba(255, 255, 255, 0.9);
    width: 0ch;
    /* start collapsed */
    max-width: 100%;
    /* the text "All the software you need to" is 28 characters long — animate to 28ch */
    animation: typing 2.6s steps(28, end) forwards, blink 0.8s infinite;
    letter-spacing: 0.2px;
}

.searchbar input {
    width: 60%;
    max-width: 600px;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ===== Layout ===== */
.container {
    display: flex;
    margin: 30px;
    gap: 24px;
}

/* Sidebar */
.sidebar {
    width: 220px;
    position: sticky;
    top: calc(25px + 30px + 10px);
    height: fit-content;
    background: #fff;
    padding: 20px;
    border-right: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.sidebar h3 {
    margin-bottom: 15px;
    font-size: 16px;
    color: #444;
}

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

.sidebar li {
    margin-bottom: 12px;
    opacity: 0;
    transform: translateX(-20px);
    animation: sideFade 0.6s forwards;
}

.sidebar li:nth-child(1) {
    animation-delay: 0.3s;
}

.sidebar li:nth-child(2) {
    animation-delay: 0.5s;
}

.sidebar li:nth-child(3) {
    animation-delay: 0.7s;
}

.sidebar li:nth-child(4) {
    animation-delay: 0.9s;
}

.sidebar li:nth-child(5) {
    animation-delay: 1.1s;
}

.sidebar li:nth-child(6) {
    animation-delay: 1.3s;
}

.sidebar a {
    text-decoration: none;
    color: #0e0249;
    transition: color 0.3s, transform 0.2s;
    font-size: 14px;
    display: inline-block;
}

.sidebar a:hover,
.sidebar a:focus {
    color: #FF5722;
    transform: translateX(5px) scale(1.05);
    outline: none;
}

/* Content */
.content {
    flex: 1;
    padding: 0 10px;
}

section {
    padding-top: 80px;
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

section.show {
    opacity: 1;
    transform: translateY(0);
}

h2 {
    margin-bottom: 20px;
    color: #0054A6;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 20px;
}

.card {
    background: #fff;
    padding: 18px;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    opacity: 0;
    transform: translateY(40px);
}

.card.show {
    opacity: 1;
    transform: translateY(0);
    animation: fadeUp 0.8s forwards;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.card img {
    display: block;
    margin-bottom: 12px;
    border-radius: 6px;
}

.card h4 {
    margin-bottom: 10px;
    color: #444;
}

.card p {
    color: #666;
    font-size: 14px;
}

.btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #fa3e05;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.25s, transform 0.25s;
}

.btn:hover,
.btn:focus {
    background: #f06e47;
    transform: scale(1.05);
    outline: none;
}



/* ===== Animations ===== */
@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes navFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sideFade {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes typing {
    from {
        width: 0ch;
    }

    to {
        width: 32ch;
    }
}

@keyframes blink {

    0%,
    100% {
        border-color: transparent;
    }

    50% {
        border-color: rgba(255, 255, 255, 0.9);
    }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }

    .searchbar h1 {
        border-right: none;
        width: auto;
    }
}

/* Responsive tweaks */
/* @media (max-width: 900px) {
    .container {
        flex-direction: column;
        margin: 18px;
    }

    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        margin-bottom: 12px;
    }

    .navbar {
        padding: 10px 18px;
    }

    .searchbar input {
        width: 90%;
    }
} */


/* ----------------------------------- */
/* Navbar entrance */
/* .navbar {
    animation: slideDown 0.8s ease-in-out;
}

.navbar-left ul li {
    opacity: 0;
    transform: translateY(-15px);
    animation: navFade 0.6s forwards;
}

.navbar-left ul li:nth-child(1) {
    animation-delay: 0.2s;
}

.navbar-left ul li:nth-child(2) {
    animation-delay: 0.4s;
}

.navbar-left ul li:nth-child(3) {
    animation-delay: 0.6s;
}

.navbar-left ul li:nth-child(4) {
    animation-delay: 0.8s;
}

.navbar-left ul li:nth-child(5) {
    animation-delay: 1s;
} */

/* Hover animation for navbar items */
/* .navbar-left li a {
    position: relative;
}

.navbar-left li a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0%;
    height: 2px;
    background: #FFCC00;
    transition: width 0.3s ease;
}

.navbar-left li a:hover::after {
    width: 100%;
} */

/* Sidebar items slide in one by one */
.sidebar li {
    opacity: 0;
    transform: translateX(-20px);
    animation: sideFade 0.5s forwards;
}

.sidebar li:nth-child(1) {
    animation-delay: 0.3s;
}

.sidebar li:nth-child(2) {
    animation-delay: 0.5s;
}

.sidebar li:nth-child(3) {
    animation-delay: 0.7s;
}

.sidebar li:nth-child(4) {
    animation-delay: 0.9s;
}

.sidebar li:nth-child(5) {
    animation-delay: 1.1s;
}

.sidebar li:nth-child(6) {
    animation-delay: 1.3s;
}

/* Hover effect: slight slide + highlight */
.sidebar a {
    display: inline-block;
    transition: transform 0.3s ease, color 0.3s ease;
}

.sidebar a:hover {
    color: #FF5722;
    transform: translateX(8px);
}

@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes navFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sideFade {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Sidebar links underline effect */
.sidebar li a {
    position: relative;
    display: inline-block;
    padding-bottom: 4px;
    /* gives room for underline */
    transition: color 0.3s ease;
}

/* underline as pseudo-element */
.sidebar li a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0%;
    background-color: #180901;
    /* underline color */
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* on hover */
.sidebar li a:hover {
    color: #a60011;
    /* optional color change */
}

.sidebar li a:hover::after {
    width: 100%;
}

/* Footer */
/* footer {
    text-align: center;
    padding: 20px;
    background: #f1f1f1;
    color: #555;
    margin-top: 40px;
    animation: fadeIn 1.2s ease-in-out;
} */
/* Footer */
 /* ==============================
       FOOTER
    ============================== */
  footer {
    background-color: #121111;
    color: #cbd5e1;
    padding: 36px 24px;
  }

  .footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
    max-width: 1200px;
    margin: 0 auto;
  }

  footer a,
  footer h4,
  footer p {
    text-align: left;
    color: #cbd5e1;
    display: block;
    margin: 6px 0;
  }

  footer a {
    text-decoration: none;
  }

  footer h4 {
    margin-bottom: 18px;
    /* creates space below the heading */
  }

  footer a:hover {
    color: #f04b4b;
  }

  hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 20px;
  }

  @media (max-width: 600px) {
    footer {
      text-align: center;
    }

    footer a,
    footer h4,
    footer p {
      text-align: center;
    }
  }

  hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 20px;
    /* space above the line */

    /* translucent white */
  }





#About a {
    text-decoration: none;
}

/* === RESPONSIVE NAVBAR (MOBILE) === */
@media (max-width: 768px) {
  nav {
    padding: 12px 20px;
  }

  /* Hide the normal menu */
  nav ul {
    display: none;
    flex-direction: column;
    background: #fff;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    gap: 5px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    padding: 1px 0;
  }

  /* When menu is toggled (via JS), show it */
  nav ul.show {
    display: flex;
  }

  /* Center each item */
  nav ul li {
    margin: 1px 0;
  }

  /* Hamburger icon */
  .hamburger {
    display: block;
    cursor: pointer;
    width: 28px;
    height: 20px;
    position: relative;
  }

  .hamburger span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: #111;
    transition: all 0.3s ease;
  }

  .hamburger span:nth-child(1) { top: 0; }
  .hamburger span:nth-child(2) { top: 8px; }
  .hamburger span:nth-child(3) { top: 16px; }

  /* Animate hamburger toggle */
  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 8px;
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 8px;
  }
}


@media (max-width: 900px) {
  .container {
    flex-direction: column;
    margin: 16px;
  }

  .sidebar {
    width: 100%;
    position: relative;
    top: 0;
    margin-bottom: 20px;
  }
}


@media (max-width: 900px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .cards {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 768px) {
  .searchbar h1 {
    font-size: 1.5rem;
    width: auto;
    border: none;
  }

  .searchbar input {
    width: 90%;
    font-size: 14px;
  }

  h2 {
    font-size: 1.4rem;
  }

  p {
    font-size: 0.9rem;
  }
}

/* --------------------------------------- */


/* Basic nav layout */
nav {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    position: sticky;
}

.logo img {
    height: 40px;
}

/* Nav list */
.nav-list {
    display: flex;
    gap: 32px;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Container relative for proper dropdown placement */
.dropdown {
  position: relative;
}

/* Button */
.dropbtn {
  padding: 10px 16px;
  display: inline-block;
  cursor: pointer;
  position: relative;
}

/* Dropdown content */
.dropdown-content {
  position: absolute; /* critical for accuracy */
  top: 100%;          /* directly under the button */
  left: 0;            /* align to left of parent */
  min-width: 200px;   /* adjust width as needed */
  margin-top: 6px;    /* small gap below button */
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
  padding: 4px 0;
  display: none;
  z-index: 1000;
}

/* Dropdown links */
.dropdown-content li a {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: #111;
  white-space: nowrap; /* prevents text wrap */
}

/* Hover effect */
.dropdown-content li a:hover {
  background: #f2f2f2;
}

/* Show on hover desktop */
@media (min-width: 769px) {
  .dropdown:hover .dropdown-content {
    display: block;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .dropdown-content {
    position: static; /* part of flow */
    padding-left: 12px;
    display: none;
  }

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

  .dropbtn::after { content: "▾"; float: right; }
}


/* Hamburger */
.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 3px;
    margin: 4px 0;
    background: #000;
    border-radius: 2px;
}

/* Mobile styles */
@media (max-width:768px) {
    .hamburger {
        display: block;
        margin-left: auto;
    }

    .nav-list {
        position: absolute;
        top: 64px;
        /* below nav */
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: #fff;
        padding: 10px 8px;
        display: none;
        z-index: 1500;
        border-top: 1px solid #eaeaea;
    }

    .nav-list.show {
        display: flex;
    }

    /* Make each nav item full-width and tappable */
    .nav-list>li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-list>li>a,
    .nav-list>li>button,
    .dropbtn {
        display: block;
        width: 100%;
        padding: 12px 16px;
        box-sizing: border-box;
        text-align: left;
    }

    /* Mobile dropdown content becomes part of flow */
    .dropdown-content {
        position: static;
        box-shadow: none;
        border-radius: 0;
        padding-left: 8px;
        display: none;
    }

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

    .nav-cta {
        padding: 12px 16px;
    }
}