@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500&display=swap');

/* ---------------- */
/* Custom Properties */
/* ---------------- */
:root {
  /* Colors from style-guide.md */
  --clr-blue-600: hsl(231, 69%, 60%);
  --clr-red-400: hsl(0, 94%, 66%);
  --clr-grey-50: hsl(0, 0%, 97%);
  --clr-blue-950: hsl(229, 31%, 21%);
  --clr-grey-text: hsl(229, 8%, 60%);

  /* Fonts from style-guide.md */
  --ff-primary: 'Rubik', sans-serif;
  --fw-400: 400;
  --fw-500: 500;
  --fs-body: 18px;
}

/* ---------------- */
/* Reset */
/* ---------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--ff-primary);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--clr-grey-text);
  overflow-x: hidden;
}

/* Make body non-scrollable when nav is open */
body.nav-open {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

ul,
li {
  list-style: none;
}

a,
button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
}

h1, h2, h3 {
  color: var(--clr-blue-950);
  font-weight: var(--fw-500);
  line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }

/* ---------------- */
/* Utility Classes */
/* ---------------- */
.container {
  width: 90%;
  max-width: 1100px;
  margin-inline: auto;
}

section {
  padding-block: 6rem;
}

.section-description {
  max-width: 540px;
  margin-inline: auto;
  margin-block: 1.5rem;
}

.btn {
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  font-weight: var(--fw-500);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}
.btn-blue {
  background-color: var(--clr-blue-600);
  color: white;
}
.btn-blue:hover {
  background-color: white;
  color: var(--clr-blue-600);
  border-color: var(--clr-blue-600);
}
.btn-grey {
  background-color: var(--clr-grey-50);
  color: var(--clr-blue-950);
}
.btn-grey:hover {
  background-color: white;
  color: var(--clr-blue-950);
  border-color: var(--clr-blue-950);
}
.btn-red {
  background-color: var(--clr-red-400);
  color: white;
}
.btn-red:hover {
  background-color: white;
  color: var(--clr-red-400);
  border-color: var(--clr-red-400);
}

/* Center text for mobile sections */
h1, h2, .section-description, .hero-text-col, .features-section {
  text-align: center;
}

/* ---------------- */
/* Header & Nav */
/* ---------------- */
.header {
  padding-block: 2.5rem;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.icon-hamburger {
  z-index: 1000; /* Above the nav overlay */
}

/* Mobile Nav - from mobile-active-nav.jpg */
.navbar {
  position: fixed;
  inset: 0;
  background-color: hsla(229, 31%, 21%, 0.95);
  padding: 8rem 2rem 2rem;
  
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  
  transform: translateY(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: 999;
}

.body.nav-open .navbar {
  transform: translateY(0);
}

.navbar-list {
  text-align: center;
}
.navbar-list-item {
  border-top: 1px solid var(--clr-grey-text);
}
.navbar-list-item:last-of-type {
  border-bottom: 1px solid var(--clr-grey-text);
}
.navbar-list a {
  display: block;
  padding-block: 1.5rem;
  color: white;
  font-size: 1.25rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.navbar-list a.login-button {
  border: 2px solid white;
  border-radius: 6px;
  margin-top: 1.5rem;
}

.nav-socials {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
}

/* ---------------- */
/* Hero Section */
/* ---------------- */
.hero-image-col {
  position: relative;
  order: -1; /* Move image above text on mobile */
  margin-bottom: 3.5rem;
}
.hero-bg-shape {
  position: absolute;
  right: -2.5rem;
  bottom: -2rem;
  width: 90%;
  height: 70%;
  background-color: var(--clr-blue-600);
  border-bottom-left-radius: 100px;
  z-index: -1;
}
.hero-image {
  position: relative;
}
.hero-text-col .buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

/* ---------------- */
/* Features (Tabs) */
/* ---------------- */
.tab-nav {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--clr-grey-text);
  margin-bottom: 3rem;
}
.tab-nav li {
  width: 100%;
  border-top: 1px solid var(--clr-grey-text);
}
.tab-link {
  padding-block: 1rem;
  width: 100%;
  font-size: 1.1rem;
  color: var(--clr-grey-text);
  transition: color 0.3s ease;
  position: relative;
}
.tab-link.active {
  color: var(--clr-blue-950);
}
.tab-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 4px;
  background-color: var(--clr-red-400);
}

.tab-panel {
  display: none;
  text-align: center;
}
.tab-panel.active {
  display: block; /* Show the active panel */
}
.tab-panel .tab-image-col {
  position: relative;
  margin-bottom: 4.5rem;
}
.tab-panel .tab-bg-shape {
  position: absolute;
  left: -2.5rem;
  bottom: -4rem;
  width: 90%;
  height: 70%;
  background-color: var(--clr-blue-600);
  border-bottom-right-radius: 100px;
  z-index: -1;
}
.tab-panel h3 {
  margin-block: 1rem 1.5rem;
}
.tab-panel .btn {
  display: none; /* Hidden on mobile per design */
}

/* ---------------- */
/* Download Section */
/* ---------------- */
.extension-grid {
  display: grid;
  gap: 2.5rem;
  margin-top: 3rem;
}
.extension-card {
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  padding: 3rem 1.5rem 1.5rem;
  text-align: center;
}
.extension-card img {
  margin-inline: auto;
}
.extension-card h3 {
  margin-block: 2rem 0.5rem;
}
.extension-card .dots {
  margin-block: 2.5rem;
}

/* ---------------- */
/* FAQ (Accordion) */
/* ---------------- */
.faq-section .container {
  max-width: 540px;
  text-align: center;
}
.accordion {
  text-align: left;
  margin-block: 3.5rem 3rem;
  border-bottom: 1px solid var(--clr-grey-text);
}
.accordion-item {
  border-top: 1px solid var(--clr-grey-text);
}
.accordion-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-block: 1rem;
  font-size: 1.1rem;
}
.accordion-question img {
  transition: transform 0.3s ease;
}
.accordion-question:hover span {
  color: var(--clr-red-400);
}

.accordion-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}
.accordion-answer p {
  padding-bottom: 1.5rem;
}

/* Accordion Active State */
.accordion-item.active .accordion-answer {
  max-height: 200px; /* Adjust as needed */
}
.accordion-item.active .accordion-question img {
  transform: rotate(180deg);
  filter: invert(55%) sepia(80%) saturate(3015%) hue-rotate(328deg) brightness(101%) contrast(101%); /* Makes arrow red */
}


/* ---------------- */
/* Contact Form */
/* ---------------- */
.contact-section {
  background-color: var(--clr-blue-600);
  color: white;
  text-align: center;
}
.contact-section h2 {
  color: white;
  font-size: 1.5rem;
  max-width: 400px;
  margin-inline: auto;
}
.contact-pre-heading {
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: 0.8rem;
  font-weight: var(--fw-500);
  margin-bottom: 1.5rem;
}
.contact-form {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
}
.form-input-wrapper {
  position: relative;
  background-color: white;
  border-radius: 6px;
}
.form-input-wrapper input {
  width: 100%;
  border: 2px solid transparent;
  padding: 0.8rem 1rem;
  border-radius: 6px;
  font-size: 1rem;
}
.error-icon, .error-message {
  display: none;
}
/* Form Error State */
.form-input-wrapper.error {
  border: 2px solid var(--clr-red-400);
}
.form-input-wrapper.error .error-icon {
  display: block;
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
}
.form-input-wrapper.error .error-message {
  display: block;
  font-size: 0.75rem;
  font-style: italic;
  text-align: left;
  padding: 0.4rem 1rem;
  color: white;
  background-color: var(--clr-red-400);
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}
.form-input-wrapper.error input {
  border-radius: 6px 6px 0 0;
}

/* ---------------- */
/* Footer */
/* ---------------- */
.footer {
  background-color: var(--clr-blue-950);
  color: white;
  padding-block: 3rem;
  text-align: center;
}
.footer-links {
  margin-block: 2rem;
  display: grid;
  gap: 1.5rem;
}
.footer-links a {
  color: white;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
}
.footer-links a:hover {
  color: var(--clr-red-400);
}
.footer-socials {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
}
.footer-socials a:hover img {
  filter: invert(55%) sepia(80%) saturate(3015%) hue-rotate(328deg) brightness(101%) contrast(101%);
}


/* ---------------- */
/* Media Query (Desktop) */
/* ---------------- */

@media (min-width: 1024px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.75rem; }

  /* Unset mobile text centering */
  h1, h2, .section-description, .hero-text-col, .features-section {
    text-align: left;
  }
  .features-section h2, .features-section .section-description {
    text-align: center;
  }

  /* Header */
  .icon-hamburger {
    display: none;
  }
  .navbar {
    position: static;
    transform: none;
    background: none;
    padding: 0;
    flex-direction: row;
    justify-content: flex-end;
  }
  .navbar-list {
    display: flex;
    gap: 2rem;
    align-items: center;
  }
  .navbar-list-item {
    border: none;
  }
  .navbar-list a {
    color: var(--clr-blue-950);
    font-size: 0.9rem;
    padding: 0;
  }
  .navbar-list a:hover {
    color: var(--clr-red-400);
  }
  .navbar-list a.login-button {
    margin: 0;
    background-color: var(--clr-red-400);
    color: white;
    padding: 0.6rem 2rem;
    border: 2px solid var(--clr-red-400);
  }
  .navbar-list a.login-button:hover {
    background: white;
    color: var(--clr-red-400);
  }
  .nav-socials {
    display: none;
  }

  /* Hero */
  .hero-section .container {
    display: flex;
    align-items: center;
    gap: 4rem;
  }
  .hero-text-col {
    order: -1;
    flex: 1;
  }
  .hero-image-col {
    flex: 1;
  }
  .hero-text-col .buttons {
    justify-content: flex-start;
  }

  /* Features */
  .tab-nav {
    flex-direction: row;
    max-width: 730px;
    margin-inline: auto;
  }
  .tab-nav li {
    border-top: none;
  }
  .tab-link {
    padding-bottom: 1.5rem;
  }

  .tab-panel {
    display: none;
    text-align: left;
  }
  .tab-panel.active {
    display: flex; /* Now use flex for side-by-side */
    align-items: center;
    gap: 6rem;
    margin-top: 4.5rem;
  }
  .tab-panel .tab-image-col {
    flex: 1;
  }
  .tab-panel .tab-text-col {
    flex: 1;
  }
  .tab-panel .btn {
    display: inline-block; /* Show button on desktop */
  }

  /* Download */
  .extension-grid {
    grid-template-columns: 1fr 1fr 1fr;
    max-width: 900px;
    margin-inline: auto;
  }
  .extension-card {
    /* Staggered effect using the --card-offset var */
    margin-top: calc(var(--card-offset) * 2.5rem);
  }

  /* FAQ */
  .faq-section .container {
    text-align: center;
  }
  .accordion {
    text-align: left;
  }

  /* Contact */
  .contact-section h2 {
    font-size: 2rem;
  }
  .contact-form {
    display: flex;
    gap: 1rem;
    max-width: 540px;
    margin-inline: auto;
  }
  .form-input-wrapper {
    flex: 1;
  }
  .contact-form .btn {
    flex-shrink: 0;
  }

  /* Footer */
  .footer {
    text-align: left;
  }
  .footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .footer-nav {
    display: flex;
    align-items: center;
    gap: 4rem;
  }
  .footer-links {
    margin: 0;
    display: flex;
    gap: 2rem;
  }
}