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

html,
body {
  font-family: "Geist", "Inter", "Roboto", "Helvetica Neue", Arial, sans-serif;
  height: 100%;
  background-color: #fff;
  color: #111;
}

/* Typography */
strong {
  font-size: 1.1rem;
  color: #000;
  font-weight: 600;
}

/* Banner (optional) */
.banner {
  background-color: #6e46e7;
  color: #fff;
  padding: 8px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.banner a {
  color: inherit;
  text-decoration: underline;
  font-weight: 500;
}

.close-banner-btn {
  position: absolute;
  right: 0;
  margin-right: 1rem;
  cursor: pointer;
}

/* Navbar */
.navbar {
  padding: 2rem 1rem 0 1rem;
}

.navbar-sub-heading {
  color: #444; /* improved contrast */
  margin-top: 0.6rem;
}

.divider {
  width: 100%;
  height: 1px;
  background-color: #ececec;
  margin: 1rem 0 2rem 0;
}

.container-centered {
  max-width: fit-content;
  margin: auto;
}

/* Inputs */
.input-container {
  display: flex;
  align-items: center;
}

.input-container label {
  color: #555;
  background-color: #fafafa;
  border: 1px solid #eaeaea;
  height: 42px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  min-width: 90px; /* prevents shrinking */
  border-top-left-radius: 3px;
  border-bottom-left-radius: 3px;
}

.input-container input {
  border: 1px solid #eaeaea;
  height: 42px;
  width: 100%;
  padding: 0 1rem;
  outline: none;
  border-top-right-radius: 3px;
  border-bottom-right-radius: 3px;
  transition: border 0.3s ease, box-shadow 0.3s ease;
  font-size: 1rem;
}

.input-container input:focus {
  border-color: #6e46e7;
  box-shadow: 0 0 0 2px rgba(110, 70, 231, 0.2);
}

/* Input group container */
.user-input-container {
  max-width: 20rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Dropdown */
.percentage-select-container {
  margin-bottom: 1rem;
  height: 42px;
  max-width: 20rem;
}

.percentage-select {
  height: 42px;
  font-size: 1rem;
  border: 1px solid #eaeaea;
  transition: border 0.3s ease, box-shadow 0.3s ease;
  background-color: transparent;
  border-top-right-radius: 3px;
  border-bottom-right-radius: 3px;
  padding: 0 0.5rem;
}

.percentage-select:focus {
  outline: none;
  border-color: #6e46e7;
  box-shadow: 0 0 0 2px rgba(110, 70, 231, 0.2);
}

/* Button */
.calculate-btn {
  height: 42px;
  width: 100%;
  font-family: inherit;
  background-color: #000;
  color: #fff;
  border-radius: 3px;
  outline: none;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.calculate-btn:hover {
  cursor: pointer;
  opacity: 0.92;
  background-color: #111;
  transform: scale(1.02);
}

/* Output */
.output-text {
  color: #333;
  text-align: center;
  font-size: 1rem;
  margin: 1rem;
  line-height: 1.5;
}

/* Media query for mobile */
@media screen and (max-width: 480px) {
  .navbar-sub-heading {
    font-size: 0.95rem;
  }

  .banner {
    font-size: 0.9rem;
  }

  .banner p {
    max-width: 30ch;
  }
}

/* Ad Component Styles */
.ad-container {
  position: fixed;
  overflow: hidden;
  z-index: 50;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  border: 1px solid #eaeaea;
  padding: 1rem;
  background-color: #fff;
  height: 100px;
  opacity: 0;
  transform: translateY(100%);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.ad-container.show {
  opacity: 1;
  transform: translateY(0);
}

.ad-container.fade-out {
  opacity: 0;
  transform: translateY(20px);
}

.ad-icon {
  position: absolute;
  left: 4px;
  top: 1rem;
  object-fit: contain;
  width: 50px;
  height: 50px;
}

.ad-content {
  display: flex;
  justify-content: space-between;
  padding-left: 8px;
}

.ad-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding-left: 40px;
}

.ad-title {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
}

.ad-description {
  font-size: 0.75rem;
  color: #878787;
}

.ad-close-btn {
  position: absolute;
  right: 0.375rem;
  top: 0.375rem;
  color: #878787;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.ad-close-icon {
  width: 1rem;
  height: 1rem;
}

/* Desktop ads */
@media screen and (min-width: 768px) {
  .ad-container {
    left: auto;
    max-width: 365px;
    height: 88px;
  }
}

/* Heading + GitHub */
.heading-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap; /* fix squishing on small screens */
}

.github-link {
  color: #666;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
}

.github-link:hover {
  color: #000;
}

.github-icon {
  width: 1.5rem;
  height: 1.5rem;
}

.blog-section {
  margin: 3rem auto;
  max-width: 700px;
  line-height: 1.6;
  color: #333;
}

.blog-section h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #000;
}

.blog-section h3 {
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: #111;
}

.blog-section p {
  margin-bottom: 1rem;
}

.blog-section ul {
  margin: 1rem 0;
  padding-left: 1.2rem;
}

.blog-section li {
  margin-bottom: 0.5rem;
}
