/**
 * Unified Frontend Pages CSS
 * Consolidates all styles from /, login, settings,
 * pricing.html, privacy.html, and terms.html into a single stylesheet
 */

/* ============================================================================
   CSS VARIABLES
   ============================================================================ */

:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-dark: #5568d3;
  --accent-blue: #3b82f6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #aaa;
  --text-white: #fff;
  --bg-light: #f9fafb;
  --bg-lighter: #f5f5f5;
  --border-light: #eee;
  --border-gray: #e5e7eb;
  --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

/* ============================================================================
   GLOBAL STYLES
   ============================================================================ */

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-stack);
  line-height: 1.6;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  background-attachment: fixed;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

button {
  font-family: inherit;
  border: none;
}

/* ============================================================================
   MAIN PAGE WRAPPERS
   ============================================================================ */

main {
  display: flex;
  flex-direction: column;
  margin: 0px auto;
  margin-top: 90px;
  padding: 30px 20px;
  flex: 1;
  max-width: 1200px;
  width: 1200px;
}

.index-main {
  padding: 0;
  margin: 0px auto;
  margin-top: 90px;
  max-width: 100%;
  width: 100%;

}


/* ============================================================================
   HERO SECTION
   ============================================================================ */

.hero {
  background: linear-gradient(0deg, #1a1a2e 0%, #293e74 100%);
  padding: 4rem 0;
  text-align: center;

  .hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
  }

  .hero-text {
    text-align: left;
    color: white;
  }

  h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
  }

  p {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 2rem;
    line-height: 1.8;
  }

  .hero-buttons {
    display: flex;
    gap: 1rem;

    .btn {
      flex: 1;
    }
  }

  .hero-features {
    display: flex;
    gap: 2rem;
    font-size: 20px;
    color: #aaa;

    .hero-feature {
      display: flex;
      align-items: center;
      gap: 0.5rem;

      svg {
        width: 20px;
        height: 20px;
        color: #4caf50;
        flex-shrink: 0;
      }
    }
  }

  .hero-visual {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    overflow: hidden;

    img {
      max-height: 400px;
      height: auto;
      width: 100%;
      max-width: 100%;
      object-fit: contain;
      cursor: -moz-zoom-out;
    }
  }

  .hero-visual-content {
    text-align: center;
    color: #aaa;
    width: 100%;

    svg {
      width: 100px;
      height: 100px;
      opacity: 0.3;
      margin-bottom: 1rem;
    }

    img {
      width: 100%;
      max-width: 100%;
      height: auto;
      object-fit: contain;
    }
  }

  .hero-subtext {
    color: white;
    font-size: 1rem;
  }
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.login-card .btn {
  width: 100%;
}

.btn-primary {
  background: var(--primary-gradient);
  color: var(--text-white);
  padding: 1rem 2rem;
  font-size: 20px;
  margin-bottom: 1rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: #f0f0f0;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.btn-secondary:hover:not(:disabled) {
  background: #e0e0e0;
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

/* ============================================================================
   CTA SECTION
   ============================================================================ */

.cta-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  padding: 4rem 1rem;
  text-align: center;
  color: white;
}

.cta-content {
  max-width: 600px;
  margin: 0 auto;
}

.cta-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.cta-content p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

/* ============================================================================
   FEATURE SECTIONS (WITH TEXT AND VISUAL)
   ============================================================================ */

.feature-section {
  padding: 4rem 1rem;

  &:nth-child(even) {
    background: #f9fafb;
  }

  .feature-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
  }

  .feature-text {
    h2 {
      font-size: 2rem;
      margin-bottom: 1.5rem;
      color: #333;
    }

    &>p {
      font-size: 1.1rem;
      color: #666;
      margin-bottom: 1.5rem;
      line-height: 1.7;
    }
  }

  .feature-bullets {
    list-style: none;
    margin: 0;
    padding: 0;

    li {
      font-size: 1rem;
      color: #666;
      margin-bottom: 0.75rem;
      line-height: 1.6;
    }
  }

  .feature-visual {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .feature-visual-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 1rem;
    font-weight: 500;

    img {
      max-height: 400px;
      height: 400px;
      cursor: -moz-zoom-out;

      &.gif {
        height: auto;
      }
    }
  }

  /* Feature sections layout alternation */
  &.feature-listing {
    .feature-container {
      grid-template-columns: 1fr 1fr;
      direction: rtl;
    }

    .feature-text,
    .feature-visual {
      direction: ltr;
    }
  }

  &.feature-ads {
    .feature-container {
      grid-template-columns: 1fr 1fr;
      direction: rtl;
    }

    .feature-text,
    .feature-visual {
      direction: ltr;
    }
  }
}

/* ============================================================================
   PRICING SECTION (Index page)
   ============================================================================ */

.pricing-section {
  padding: 4rem 1rem;

  .pricing-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
  }

  h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
    line-height: 1.2;
  }
}

.pricing-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 3rem;
  justify-content: center;
}

.pricing-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  flex-shrink: 0;

  &:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    border-color: var(--primary-color);
  }

  h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 700;
  }
}

.pricing-popular {
  background: linear-gradient(135deg, #f0f4ff 0%, #f5f0ff 100%);
  border: 2px solid var(--primary-color);
  transform: scale(1);

  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.2);
  }
}

.pricing-popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  white-space: nowrap;
}

.pricing-amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
  margin-top: 1rem;
}

.pricing-period {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 1.5rem;
  display: block;
}

.pricing-features {
  list-style: none;
  margin: 1.5rem 0 2rem 0;
  padding: 0;
  text-align: left;
  flex-grow: 1;

  li {
    padding: 0.75rem 0 0.75rem 1.75rem;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.5;

    &:before {
      content: "✓";
      position: absolute;
      left: 0;
      color: #10b981;
      font-weight: 700;
      font-size: 1.1rem;
    }

    &:last-child {
      border-bottom: none;
    }
  }
}

.pricing-footer {
  margin-top: 2rem;
  text-align: center;

  .btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    width: auto;
    min-width: 200px;
  }
}

/* ============================================================================
   FINAL CTA SECTION
   ============================================================================ */

.final-cta {
  padding: 4rem 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;

  .final-cta-content {
    max-width: 800px;
    margin: 0 auto;
  }

  h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: white;
    line-height: 1.2;
  }
}

.cta-checklist {
  list-style: none;
  margin: 2rem 0;
  padding: 0;
  font-size: 1.1rem;

  li {
    margin-bottom: 1rem;
    color: white;
  }
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  min-width: 250px;
  margin-top: 1rem;
}

/* ============================================================================
   FOOTER
   ============================================================================ */


@media (max-width: 768px) {
  .feature-section {
    .feature-container {
      grid-template-columns: 1fr;
      direction: ltr;
      gap: 2rem;
    }

    .feature-text {
      h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
      }

      direction: ltr;
    }

    .feature-visual {
      direction: ltr;
    }

    &.feature-listing {
      .feature-container {
        grid-template-columns: 1fr;
        direction: ltr;
      }

      .feature-text,
      .feature-visual {
        direction: ltr;
      }
    }

    &.feature-ads {
      .feature-container {
        grid-template-columns: 1fr;
        direction: ltr;
      }

      .feature-text,
      .feature-visual {
        direction: ltr;
      }
    }
  }
}

@media (max-width: 480px) {
  main {
    margin-top: 60px;
    padding: 30px 1rem;
    width: auto;
  }

  /* Add extra margin when nav-actions is visible */
  body:has(nav .nav-actions:not([style*="display: none"])) main {
    margin-top: 120px;
  }

  .page {
    margin-top: 60px;
  }

  /* Add extra margin when nav-actions is visible */
  body:has(nav .nav-actions:not([style*="display: none"])) .page {
    margin-top: 120px;
  }

  .feature-section {
    padding: 1.5rem;

    .feature-container {
      gap: 1.5rem;
      padding: 0;
    }

    .feature-text {
      h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
        line-height: 1.3;
        color: var(--text-primary);
      }

      &>p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        color: var(--text-secondary);
        line-height: 1.6;
      }
    }

    .feature-bullets {
      li {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
        color: var(--text-secondary);
        line-height: 1.5;
      }
    }

    .feature-visual-placeholder {
      aspect-ratio: 4/3;
      width: 100%;

      img {
        max-height: 280px;
        height: auto;
        width: 100%;
        object-fit: contain;
      }
    }

    &.feature-listing .feature-container,
    &.feature-ads .feature-container {
      gap: 1.5rem;
    }
  }

}

/* ============================================================================
   KEYFRAME ANIMATIONS (Global)
   ============================================================================ */

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   PAGE CONTAINER (Generic for all static pages)
   ============================================================================ */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 90px 20px;

  h1 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.5em;
  }

  &>p {
    text-align: center;
    color: #666;
    margin-bottom: 60px;
    font-size: 1.1em;
  }
}

/* ============================================================================
   STATIC PAGES (PRICING, PRIVACY, TERMS)
   ============================================================================ */

.static-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.static-content {
  text-align: center;
}

.static-container h1 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 1rem;
}

.static-container p {
  text-align: center;
  color: #666;
  font-size: 1.1rem;
}

.static-container a {
  display: inline-block;
  margin-top: 2rem;
  color: var(--primary-color);
  text-decoration: none;
}

.static-container h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
  .hero {
    .hero-content {
      grid-template-columns: 1fr;
    }

    h1 {
      font-size: 2rem;
    }

    .hero-buttons {
      flex-direction: column;
    }

    .hero-features {
      flex-direction: column;
    }
  }

  .how-it-works h2 {
    font-size: 2rem;
  }

  .how-it-works .steps-grid {
    grid-template-columns: 1fr;
  }

  .btn-group {
    flex-direction: column;
  }
}

/* ============================================================================
   HOW IT WORKS SECTION
   ============================================================================ */

.how-it-works {
  padding: 4rem 1rem;
  background: var(--bg-light);

  .how-it-works-content {
    max-width: 1200px;
    margin: 0 auto;
  }

  h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-primary);
  }

  .steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;

    .step {
      display: block;
      background: white;
      padding: 2rem;
      border-radius: 12px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
      text-align: center;

      .step-number {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 50px;
        height: 50px;
        background: var(--primary-gradient);
        color: white;
        border-radius: 50%;
        font-weight: bold;
        font-size: 1.5rem;
        margin-bottom: 1rem;
      }

      h3 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
        color: var(--text-primary);
      }

      p {
        color: var(--text-secondary);
        line-height: 1.6;
        font-size: 0.95rem;
      }
    }
  }
}

@media (max-width: 480px) {
  .page {
    padding: 1.5rem 1rem;

    &>p {
      margin-bottom: 20px;
    }
  }

  .hero {
    padding: 1.5rem 0.5rem;

    .hero-content {
      gap: 1.5rem;
    }

    .hero-text {
      text-align: left;
    }

    h1 {
      font-size: 1.4rem;
      margin-bottom: 1rem;
      line-height: 1.3;
      color: white;
    }

    p {
      font-size: 1rem;
      margin-bottom: 1.5rem;
      color: #aaa;
      line-height: 1.6;
    }

    .hero-buttons {
      flex-direction: column;

      .btn {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1rem;
      }
    }

    .hero-subtext {
      font-size: 0.9rem;
      margin-top: 0.75rem;
      color: #aaa;
    }

    .hero-visual {
      min-height: auto;
      padding: 1rem;
      overflow: hidden;

      img {
        max-height: 280px;
        height: auto;
        width: 100%;
        object-fit: contain;
      }
    }

    .hero-features {
      flex-direction: column;
      font-size: 0.95rem;
      gap: 1rem;
      margin-top: 1rem;

      .hero-feature {
        justify-content: flex-start;

        svg {
          flex-shrink: 0;
        }
      }
    }
  }

  .login-card {
    padding: 1.5rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .how-it-works {
    padding: 1.5rem;

    h2 {
      font-size: 1.3rem;
      margin-bottom: 2rem;
      text-align: center;
    }

    .steps-grid {
      gap: 1.5rem;
    }

    .step {
      padding: 1.5rem;
      background: white;
      border-radius: 12px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

      .step-number {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        margin-bottom: 1rem;
      }

      h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
        color: var(--text-primary);
      }

      p {
        font-size: 0.85rem;
        color: var(--text-secondary);
        line-height: 1.5;
      }
    }
  }

  .cta-section {
    padding: 2rem 1rem;

    .cta-content {
      h2 {
        font-size: 1.5rem;
      }
    }
  }
}

/* ============================================================================
   IMAGE LIGHTBOX
   ============================================================================ */

.image-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;

  &.show {
    display: flex;
  }

  .lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
  }

  .lightbox-container {
    position: relative;
    z-index: 1001;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  }

  .lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    padding: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;

    &:hover {
      color: #ccc;
    }
  }

  /* Clickable images */
  img[data-lightbox] {
    cursor: pointer;
    transition: opacity 0.3s ease;

    &:hover {
      opacity: 0.8;
    }
  }
}