/* -----------------------------------
Homepage (Perfectly Centered Version)
----------------------------------- */
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(to bottom right, #a7f3d0, #38bdf8);
  color: #1e1e1e;
  overflow-x: hidden;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  will-change: transform;
  transform: translateZ(0);
}

h1, h2, h3, .tagline {
  font-family: 'Rubik', 'Poppins', sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

.hidden {
  display: none;
}

/* -----------------------------------
   Master Wrapper
----------------------------------- */
.home-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  margin: 0 auto;
  padding-top: 60px;
  box-sizing: border-box;
}

/* -----------------------------------
   Header
----------------------------------- */
.home-header {
  text-align: center;
  color: #0d315a;
  margin-top: 1rem;
  width: 100%;
}

.logo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.logo {
  width: 85vw;
  max-width: 380px;
  height: auto;
  margin: 0 auto 0.8rem;
  display: block;
}

.tagline {
  font-weight: 700;
  font-size: 1.4rem;
  opacity: 0.9;
  margin-top: 0.2rem;
  letter-spacing: 0.5px;
}

/* -------------------------------
   Frosted Glass Header for Home
---------------------------------- */
.home-glass-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0rem;
  z-index: 1000;
}

.sign-in-text {
  font-weight: 600;
  color: #0d315a;
  font-size: 1.1rem;
  cursor: pointer;
  margin-left: 1.2rem;
}

.menu-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 1.8;
  margin: 0;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  cursor: pointer;
}

.menu-icon span {
  display: block;
  width: 24px;
  height: 3px;
  background-color: #0d315a;
  border-radius: 2px;
}

.menu-icon:hover {
  transform: scale(1.1);
}


/* -----------------------------------
   Daily Challenge Card
----------------------------------- */
.daily-challenge-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 90%;
  max-width: 520px;
  margin: 0 auto 2rem auto;
  padding: 2.2rem 1.8rem;
  color: #1f2937;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  box-sizing: border-box;
}

.daily-challenge-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  filter: brightness(1.05);
}

.daily-challenge-card h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #075e54;
  margin-bottom: 0.4rem;
}

.daily-challenge-card p {
  color: #1e293b;
  font-size: 0.95rem;
  margin-bottom: 1.4rem;
}

/* Frosted Glass Panel inside Daily Challenge */
/* Frosted glass panel for daily challenge */
.daily-info {
  position: relative; /* not absolute anymore */
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.85));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 1.6rem 1.2rem;
  text-align: center;
  width: 85%;
  max-width: 380px;
  margin: 0 auto;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Headings inside daily-info */
.daily-info h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0d315a;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.daily-info h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0.3rem 0 1rem;
}


.daily-info .btn-primary {
  z-index: 2;
}


/* Dynamic photo background (shared with category style) */
.daily-challenge-card.has-photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
}

.daily-challenge-card.has-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0.3)
  );
  backdrop-filter: blur(0.5px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 0;
}

.daily-challenge-card.has-photo h2,
.daily-challenge-card.has-photo h3,
.daily-challenge-card.has-photo p,
.daily-challenge-card.has-photo .btn-primary {
  position: relative;
  z-index: 1;
}

/* -----------------------------------
   Play Button
----------------------------------- */
.btn-primary {
  background: linear-gradient(135deg, #ff9770, #ff6f61);
  color: #fff;
  padding: 0.85rem 1.9rem;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

/* -----------------------------------
   Categories Section
----------------------------------- */
.categories-section {
  text-align: center;
  color: #0d315a;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.categories-section h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: center;
  justify-items: center;
  align-items: center;
  gap: 1.2rem;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.category-card {
  position: relative;
  background-size: cover;
  background-position: center;
  border-radius: 22px;
  overflow: hidden;
  width: 100%;
  max-width: 180px;
  min-height: 190px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.category-card:hover .category-info {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.9));
  transition: background 0.3s ease;
}

.category-info {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 90px; /* fixed consistent height across all cards */
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 16px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.85));
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-sizing: border-box;
}

.category-info .emoji {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.category-info h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

/* Gradient bottom fade */
.category-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(0,0,0,0.10), rgba(0,0,0,0));
  pointer-events: none;
}

/* -----------------------------------
   Footer
----------------------------------- */
.home-footer {
  width: 100%;
  text-align: center;
  padding: 1.6rem 0;
  margin-top: 3rem;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.home-footer p {
  margin: 0;
}


/* -----------------------------------
   Responsive Layout
----------------------------------- */
html, body {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-y: scroll; 
  height: auto;
  min-height: 100%;
  -webkit-overflow-scrolling: touch;
}

/* 📱 Mobile */
@media (max-width: 768px) {
  .home-wrapper {
    max-width: 480px;
    align-items: center;
  }

  .daily-challenge-card {
    width: 90%;
    margin-bottom: 2rem;
  }

  .categories-section {
    max-width: 420px;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 💻 Desktop & Tablet */
@media (min-width: 769px) {
  .categories-section {
    max-width: 850px;
  }

  .categories-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }

  .category-card {
    max-width: 210px;
    min-height: 200px;
  }

  .category-info h3 {
    font-size: 1.1rem;
  }
}

/* Reduce blur intensity on smaller screens */
@media (max-width: 768px) {
  .daily-challenge-card::before {
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
  }

  .daily-info {
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
    background: rgba(255, 255, 255, 0.65); /* more opaque for readability */
  }
}

/* -----------------------------
   Sign-In / Auth Modal Styles
----------------------------- */

.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.auth-modal.hidden {
  display: none;
}

.auth-modal .modal-window {
  position: relative; 
  width: 90%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  color: #1e1e1e;
  font-family: 'Poppins', sans-serif;
}

/* Modal Header */
.auth-modal .modal-window h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0d315a;
}

/* Input Fields */
.auth-modal .modal-window input {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
}

/* Submit Button */
.auth-modal .modal-window .btn-auth {
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff9770, #ff6f61);
  color: white;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.15s;
}
.auth-modal .modal-window .btn-auth:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

/* Toggle view link */
.auth-modal .modal-window .toggle-view {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: #0d315a;
  cursor: pointer;
}

/* OAuth Buttons */
.auth-modal .modal-window .oauth-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.15s;
}
.auth-modal .modal-window .oauth-btn.google {
  background: #fff;
  border: 1px solid #ddd;
  color: #0d315a;
}
.auth-modal .modal-window .oauth-btn.apple {
  background: #000;
  color: #fff;
}
.auth-modal .modal-window .oauth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Close Button */
.close-auth-modal {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #333;
  cursor: pointer;
  font-weight: bold;
  z-index: 10; /* inside the modal, doesn't need to be super high */
}

/* Animation */
@keyframes fadeInTop {
  0% {
    opacity: 0;
    transform: translateY(-30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
