/* 
   Happie Morning - Main Stylesheet
   Design Aesthetic: Sunrise Warmth (Premium Dark Mode)
   Typography: Outfit (Headings) & Inter (Body)
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Apple-inspired Light Canvas & Action Blue Color Palette */
  --bg-night: #ffffff;
  --bg-deep: #f5f5f7;
  --bg-slate: #fafafc;
  --card-dark: rgba(255, 255, 255, 0.85);
  --card-border: #e0e0e0;
  
  --sunrise-orange: #0066cc; /* Action Blue */
  --sunrise-gradient: linear-gradient(135deg, #0066cc 0%, #0071e3 50%, #2997ff 100%);
  --orange-glow: rgba(0, 102, 204, 0.15);
  
  --peach-pink: #0066cc;
  --accent-gold: #0071e3;
  --whatsapp-green: #25d366;
  
  --text-main: #1d1d1f; /* Near-Black Ink */
  --text-muted: #7a7a7a;
  --text-dark: #1d1d1f;
  
  /* Typography Variables */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Layout Sizing & Timing */
  --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-lg: 20px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  --shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   1. Global Resets & Basics
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-night);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 102, 204, 0.02) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 102, 204, 0.01) 0%, transparent 50%);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-smooth);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Base utility container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Gradients text utility */
.text-gradient {
  background: var(--sunrise-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Custom premium button */
.btn-premium {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--sunrise-gradient);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: 50px;
  box-shadow: 0 4px 15px var(--orange-glow);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--orange-glow);
  filter: brightness(1.05);
}

.btn-premium:active {
  transform: translateY(0);
}

/* ==========================================================================
   2. Header & Navigation
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--card-border);
  transition: var(--transition-smooth);
}

.header.scrolled {
  padding: 8px 0;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: var(--font-heading);
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo span {
  background: var(--sunrise-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 32px;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
  position: relative;
  padding: 6px 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--sunrise-gradient);
  transition: var(--transition-smooth);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-main);
  margin: 6px 0;
  transition: var(--transition-smooth);
}

/* ==========================================================================
   3. Hero Section
   ========================================================================== */
.hero {
  padding: 140px 0 80px;
  text-align: center;
  position: relative;
}

.hero h1 {
  font-size: 3rem;
  line-height: 1.15;
  margin-bottom: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 35px;
}

/* Dynamic Quote of the Day container */
.quote-day-card {
  background: var(--card-dark);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  max-width: 750px;
  margin: 0 auto 40px;
  box-shadow: var(--shadow-premium);
  position: relative;
  overflow: hidden;
}

.quote-day-card::before {
  content: '“';
  position: absolute;
  top: -10px;
  left: 30px;
  font-size: 12rem;
  font-family: var(--font-heading);
  color: rgba(0, 102, 204, 0.04);
  line-height: 1;
}

.quote-day-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(0, 102, 204, 0.08);
  color: var(--peach-pink);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.quote-day-text {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 20px;
}

.quote-day-author {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

/* ==========================================================================
   4. Grid Layouts & Cards
   ========================================================================== */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--sunrise-gradient);
  margin-top: 8px;
  border-radius: 2px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 4px;
}

.view-all {
  color: var(--peach-pink);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-all:hover {
  color: var(--sunrise-orange);
  transform: translateX(3px);
}

/* Grid wrappers */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

/* Expandable Theory Card */
.theory-card {
  background: var(--card-dark);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-md);
  padding: 30px;
  transition: var(--transition-smooth);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.theory-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 102, 204, 0.25);
  box-shadow: 0 15px 30px rgba(0, 102, 204, 0.04);
}

.theory-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.theory-card h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.theory-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.theory-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.read-more-link {
  color: var(--peach-pink);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Expanded Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(29, 29, 31, 0.4);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-content {
  background: var(--bg-slate);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 40px;
  box-shadow: var(--shadow-premium);
  position: relative;
  animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  background: rgba(0, 102, 204, 0.1);
  color: var(--sunrise-orange);
}

.modal-title {
  font-size: 1.85rem;
  margin-bottom: 12px;
  padding-right: 30px;
}

.modal-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--peach-pink);
  margin-bottom: 24px;
}

.modal-body {
  font-size: 1.05rem;
  color: var(--text-main);
  line-height: 1.7;
}

.modal-body p {
  margin-bottom: 18px;
}

/* ==========================================================================
   5. Quotes Scroll Page (Instagram Style)
   ========================================================================== */
.quotes-page-container {
  max-width: 600px;
  margin: 100px auto 60px;
  padding: 0 16px;
}

.quote-feed-card {
  background: var(--card-dark);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-md);
  margin-bottom: 30px;
  overflow: hidden;
  box-shadow: var(--shadow-premium);
}

.quote-card-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
}

.quote-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quote-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sunrise-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
}

.quote-card-username {
  font-weight: 600;
  font-size: 0.9rem;
}

.quote-card-category {
  font-size: 0.75rem;
  color: var(--peach-pink);
  background: rgba(0, 102, 204, 0.08);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.quote-card-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
}

.quote-card-media::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 3, 12, 0.65); /* darken background image to make text readable */
  backdrop-filter: blur(2px);
}

.quote-card-content {
  position: relative;
  z-index: 10;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.45;
  color: #fff;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

.quote-card-footer {
  padding: 16px;
  border-top: 1px solid var(--card-border);
}

.quote-card-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.quote-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-main);
  padding: 4px;
  transition: var(--transition-smooth);
}

.quote-action-btn:hover {
  color: var(--sunrise-orange);
  transform: scale(1.1);
}

.quote-card-caption {
  font-size: 0.9rem;
  color: var(--text-main);
}

.quote-card-caption span {
  font-weight: 700;
  margin-right: 6px;
}

/* Category horizontal filter bar */
.filter-bar {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 0;
  margin-bottom: 30px;
  scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.filter-bar::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome/Safari */
}

.filter-btn {
  background: var(--bg-deep);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--sunrise-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 10px var(--orange-glow);
}

/* ==========================================================================
   6. Stories List & Reader Page
   ========================================================================== */
.story-card {
  background: var(--card-dark);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
}

.story-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 102, 204, 0.2);
}

.story-img-container {
  height: 200px;
  width: 100%;
  background-size: cover;
  background-position: center;
  position: relative;
}

.story-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.story-card-body h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.story-card-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
  flex-grow: 1;
}

/* ==========================================================================
   7. WhatsApp floating Widget
   ========================================================================== */
.whatsapp-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.whatsapp-icon-btn {
  width: 60px;
  height: 60px;
  background-color: var(--whatsapp-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  position: relative;
}

.whatsapp-icon-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  animation: pulseRing 1.8s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.whatsapp-icon-btn:hover {
  transform: scale(1.08) rotate(5deg);
  background-color: #20ba5a;
}

.whatsapp-icon-btn svg {
  fill: #fff;
  width: 32px;
  height: 32px;
}

.whatsapp-tooltip {
  background: #fff;
  color: var(--text-dark);
  padding: 8px 16px;
  border-radius: 20px 20px 0 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  animation: tooltipIn 0.3s ease-out;
  transform-origin: right bottom;
}

@keyframes tooltipIn {
  from { transform: scale(0.9) translate(10px, 10px); opacity: 0; }
  to { transform: scale(1) translate(0, 0); opacity: 1; }
}

/* WhatsApp Banner CTA */
.whatsapp-banner {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.08) 0%, rgba(0, 102, 204, 0.04) 100%);
  border: 1px solid rgba(37, 211, 102, 0.15);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  text-align: center;
  margin: 60px auto;
  max-width: 850px;
  box-shadow: var(--shadow-premium);
}

.whatsapp-banner h2 {
  font-size: 1.85rem;
  margin-bottom: 12px;
  color: var(--text-main);
}

.whatsapp-banner p {
  color: var(--text-muted);
  max-width: 550px;
  margin: 0 auto 28px;
}

.btn-whatsapp {
  background-color: var(--whatsapp-green);
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
  transition: var(--transition-smooth);
}

.btn-whatsapp:hover {
  transform: translateY(-2px);
  background-color: #22c35e;
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp svg {
  fill: #fff;
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   8. Footer
   ========================================================================== */
.footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--card-border);
  padding: 60px 0 30px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand h4 {
  font-size: 1.25rem;
  color: var(--text-main);
  margin-bottom: 15px;
}

.footer-brand h4 span {
  background: var(--sunrise-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-brand p {
  margin-bottom: 20px;
  max-width: 320px;
}

.footer-socials {
  display: flex;
  gap: 16px;
}

.social-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-night);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.social-icon:hover {
  background: var(--sunrise-gradient);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
}

.footer-title {
  color: var(--text-main);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a:hover {
  color: var(--peach-pink);
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid var(--card-border);
  padding-top: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
}

/* ==========================================================================
   9. Mobile Responsive Rules
   ========================================================================== */
@media (max-width: 991px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  
  .hero h1 {
    font-size: 2.3rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .quote-day-card {
    padding: 30px 20px;
  }
  
  .quote-day-text {
    font-size: 1.35rem;
  }
  
  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 40px 0;
    gap: 28px;
    transition: var(--transition-smooth);
    border-top: 1px solid var(--card-border);
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .nav-toggle {
    display: block;
  }
  
  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
  
  .grid-cards {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .whatsapp-tooltip {
    display: none; /* Hide WhatsApp text tooltip on small devices to avoid blocking text */
  }
  
  .whatsapp-widget {
    bottom: 20px;
    right: 20px;
  }
  
  .whatsapp-icon-btn {
    width: 52px;
    height: 52px;
  }
}
