/* CSS Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: hsl(257, 7%, 63%);
  overflow-x: hidden;
}

/* CSS Variables */
:root {
  --primary-cyan: hsl(180, 66%, 49%);
  --primary-dark-violet: hsl(257, 27%, 26%);
  --secondary-red: hsl(0, 87%, 67%);
  --neutral-gray: hsl(0, 0%, 75%);
  --neutral-grayish-violet: hsl(257, 7%, 63%);
  --neutral-very-dark-blue: hsl(255, 11%, 22%);
  --neutral-very-dark-violet: hsl(260, 8%, 14%);
  --white: #ffffff;
  --container-max-width: 1110px;
  --mobile-padding: 1.5rem;
  --desktop-padding: 2rem;
}

/* Utility Classes */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--mobile-padding);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--desktop-padding);
  }
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 28px;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn--primary {
  background-color: var(--primary-cyan);
  color: var(--white);
}

.btn--primary:hover {
  background-color: hsl(180, 66%, 69%);
}

.btn--large {
  padding: 1rem 2.5rem;
  font-size: 18px;
}

/* Header Styles */
.header {
  padding: 2rem 0;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--mobile-padding);
}

.nav__logo img {
  height: 32px;
}

.nav__menu {
  display: none;
  align-items: center;
  gap: 3rem;
}

.nav__list {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav__link {
  color: var(--neutral-grayish-violet);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: color 0.3s ease;
}

.nav__link:hover {
  color: var(--neutral-very-dark-blue);
}

.nav__auth {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__login {
  color: var(--neutral-grayish-violet);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: color 0.3s ease;
}

.nav__login:hover {
  color: var(--neutral-very-dark-blue);
}

.nav__signup {
  padding: 0.5rem 1.5rem;
  font-size: 15px;
}

/* Mobile Navigation Toggle */
.nav__toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 0.5rem;
}

.nav__toggle span {
  width: 24px;
  height: 3px;
  background-color: var(--neutral-grayish-violet);
  transition: all 0.3s ease;
}

/* Mobile Navigation Menu */
@media (max-width: 767px) {
  .nav__menu {
    position: absolute;
    top: 100%;
    left: var(--mobile-padding);
    right: var(--mobile-padding);
    background-color: var(--primary-dark-violet);
    border-radius: 10px;
    padding: 2rem;
    flex-direction: column;
    gap: 2rem;
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .nav__menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav__list {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
    width: 100%;
  }

  .nav__link {
    color: var(--white);
    font-size: 18px;
  }

  .nav__auth {
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    border-top: 1px solid var(--neutral-grayish-violet);
    padding-top: 2rem;
  }

  .nav__login {
    color: var(--white);
    font-size: 18px;
  }

  .nav__signup {
    width: 100%;
    padding: 0.75rem;
    font-size: 18px;
  }
}

@media (min-width: 768px) {
  .nav {
    padding: 0 var(--desktop-padding);
  }

  .nav__menu {
    display: flex;
  }

  .nav__toggle {
    display: none;
  }
}

/* Hero Section */
.hero {
  display: flex;
  align-items: center;
  min-height: 60vh;
  padding: 2rem 0 8rem;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding-left: var(--mobile-padding);
  padding-right: var(--mobile-padding);
  flex-direction: column-reverse;
  text-align: center;
  gap: 2rem;
}

.hero__content {
  flex: 1;
}

.hero__title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--neutral-very-dark-blue);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero__description {
  font-size: 18px;
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.hero__image {
  flex: 1;
  max-width: 100%;
}

.hero__image img {
  width: 100%;
  height: auto;
  max-width: 500px;
}

@media (min-width: 768px) {
  .hero {
    flex-direction: row;
    text-align: left;
    padding-left: var(--desktop-padding);
    padding-right: var(--desktop-padding);
    gap: 4rem;
  }

  .hero__title {
    font-size: 4rem;
  }

  .hero__description {
    margin-left: 0;
    margin-right: 0;
  }

  .hero__image {
    order: 2;
  }

  .hero__content {
    order: 1;
  }
}

/* Shorten Section */
.shorten {
  background-color: #f0f1f6;
  padding: 4rem 0 2rem;
  position: relative;
}

.shorten__container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--mobile-padding);
  transform: translateY(-50%);
}

.shorten__form {
  background: var(--primary-dark-violet) url('./images/bg-shorten-mobile.svg') no-repeat top right;
  background-size: cover;
  padding: 1.5rem;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.shorten__input-group {
  position: relative;
}

.shorten__input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 3px solid transparent;
  border-radius: 5px;
  font-family: inherit;
  font-size: 16px;
  outline: none;
}

.shorten__input.error {
  border-color: var(--secondary-red);
}

.shorten__input::placeholder {
  color: var(--neutral-grayish-violet);
}

.shorten__error {
  color: var(--secondary-red);
  font-size: 12px;
  font-style: italic;
  margin-top: 0.25rem;
  display: none;
}

.shorten__error.show {
  display: block;
}

.shorten__btn {
  width: 100%;
  padding: 0.75rem;
  border-radius: 5px;
  font-size: 18px;
}

@media (min-width: 768px) {
  .shorten__container {
    padding: 0 var(--desktop-padding);
  }

  .shorten__form {
    background-image: url('./images/bg-shorten-desktop.svg');
    flex-direction: row;
    align-items: flex-start;
    padding: 3rem;
    gap: 1.5rem;
  }

  .shorten__input-group {
    flex: 1;
  }

  .shorten__input {
    padding: 1rem 1.5rem;
    font-size: 18px;
  }

  .shorten__btn {
    width: auto;
    padding: 1rem 2rem;
    white-space: nowrap;
  }
}

/* Shortened Links */
.shortened-links {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--mobile-padding);
}

.shortened-link {
  background-color: var(--white);
  border-radius: 5px;
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.shortened-link__content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shortened-link__original {
  color: var(--neutral-very-dark-blue);
  font-weight: 500;
  word-break: break-all;
  border-bottom: 1px solid var(--neutral-gray);
  padding-bottom: 0.75rem;
}

.shortened-link__result {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shortened-link__short {
  color: var(--primary-cyan);
  font-weight: 500;
  text-decoration: none;
}

.shortened-link__copy {
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-size: 16px;
}

.shortened-link__copy.copied {
  background-color: var(--primary-dark-violet);
}

@media (min-width: 768px) {
  .shortened-links {
    padding: 0 var(--desktop-padding);
  }

  .shortened-link__content {
    flex-direction: row;
    align-items: center;
    padding: 1rem 1.5rem;
  }

  .shortened-link__original {
    flex: 1;
    border-bottom: none;
    padding-bottom: 0;
  }

  .shortened-link__result {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
  }

  .shortened-link__copy {
    white-space: nowrap;
  }
}

/* Statistics Section */
.stats {
  background-color: #f0f1f6;
  padding: 4rem 0;
  text-align: center;
}

.stats__header {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--mobile-padding);
  margin-bottom: 4rem;
}

.stats__title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--neutral-very-dark-blue);
  margin-bottom: 1rem;
}

.stats__description {
  max-width: 500px;
  margin: 0 auto;
}

.stats__cards {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--mobile-padding);
  display: flex;
  flex-direction: column;
  gap: 4rem;
  position: relative;
}

.stats__cards::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 8px;
  background-color: var(--primary-cyan);
  transform: translateX(-50%);
  z-index: 1;
}

.stats__card {
  background-color: var(--white);
  padding: 2rem 1.5rem;
  border-radius: 5px;
  position: relative;
  z-index: 2;
}

.stats__icon {
  width: 88px;
  height: 88px;
  background-color: var(--primary-dark-violet);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
}

.stats__icon img {
  width: 40px;
  height: 40px;
}

.stats__card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--neutral-very-dark-blue);
  margin-bottom: 1rem;
}

.stats__card-description {
  font-size: 15px;
  line-height: 1.7;
}

@media (min-width: 768px) {
  .stats__header {
    padding: 0 var(--desktop-padding);
  }

  .stats__title {
    font-size: 2.5rem;
  }

  .stats__cards {
    flex-direction: row;
    gap: 2rem;
    padding: 0 var(--desktop-padding);
    align-items: flex-start;
  }

  .stats__cards::before {
    left: 0;
    right: 0;
    top: 50%;
    bottom: auto;
    width: auto;
    height: 8px;
    transform: translateY(-50%);
  }

  .stats__card {
    flex: 1;
    text-align: left;
    padding: 2rem;
  }

  .stats__card:nth-child(1) {
    transform: translateY(0);
  }

  .stats__card:nth-child(2) {
    transform: translateY(2rem);
  }

  .stats__card:nth-child(3) {
    transform: translateY(4rem);
  }

  .stats__icon {
    margin: 0 0 2rem 0;
  }
}

/* CTA Section */
.cta {
  background: var(--primary-dark-violet) url('./images/bg-boost-mobile.svg') no-repeat center;
  background-size: cover;
  padding: 4rem 0;
  text-align: center;
}

.cta__title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .cta {
    background-image: url('./images/bg-boost-desktop.svg');
  }

  .cta__title {
    font-size: 2.5rem;
  }
}

/* Footer */
.footer {
  background-color: var(--neutral-very-dark-violet);
  padding: 3rem 0 2rem;
  color: var(--white);
}

.footer__content {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--mobile-padding);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-align: center;
}

.footer__logo img {
  height: 32px;
  filter: brightness(0) invert(1);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.footer__column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.footer__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer__link {
  color: var(--neutral-gray);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.3s ease;
}

.footer__link:hover {
  color: var(--primary-cyan);
}

.footer__social {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.footer__social-link {
  display: block;
  transition: transform 0.3s ease;
}

.footer__social-link:hover {
  transform: scale(1.1);
}

.footer__social-link img {
  width: 24px;
  height: 24px;
}

.footer__social-link:hover img {
  filter: brightness(0) saturate(100%) invert(64%) sepia(98%) saturate(1217%) hue-rotate(154deg) brightness(91%) contrast(87%);
}

@media (min-width: 768px) {
  .footer__content {
    flex-direction: row;
    text-align: left;
    padding: 0 var(--desktop-padding);
    gap: 4rem;
  }

  .footer__logo {
    flex: 1;
  }

  .footer__links {
    flex: 2;
    flex-direction: row;
    gap: 4rem;
  }

  .footer__social {
    flex: 1;
    justify-content: flex-end;
  }
}

/* Attribution */
.attribution {
  font-size: 11px;
  text-align: center;
  padding: 1rem;
  color: var(--neutral-grayish-violet);
}

.attribution a {
  color: var(--primary-cyan);
  text-decoration: none;
}

.attribution a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 374px) {
  .hero__title {
    font-size: 2rem;
  }

  .stats__title {
    font-size: 1.75rem;
  }

  .cta__title {
    font-size: 1.75rem;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
