/* ======================================================
  COMPONENTS CSS – PRO SYSTEM VERSION
  Reusable UI blocks (Header, Nav, Layout, Cards, Footer)
  Upgraded: Green + Orange Balanced Identity
  Safe Drop-in Replacement
====================================================== */

/* ======================================================
   GLOBAL LINK RESET
====================================================== */

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

/* ======================================================
   TYPOGRAPHY
====================================================== */

.nav-list a {
  font-size: 0.75rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.life-card h2,
.blog-card h2,
.service-card h2 {
  letter-spacing: -0.3px;
}

.life-card p,
.blog-card p,
.service-card p,
.connect-card p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-text,
.footer-right {
  line-height: 1.6;
}

/* ======================================================
   HEADER (Premium Glass + Brand Tint)
====================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  z-index: 1000;
  backdrop-filter: blur(18px) saturate(160%);
  transition: background 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow:
    0 8px 30px rgba(0,0,0,0.15),
    0 0 0 1px var(--brand-green-soft);
}

body.theme-dark .site-header {
  background: rgba(0,0,0,0.65);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

body.theme-light .site-header {
  background: rgba(255,255,255,0.88);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.header-inner {
  max-width: var(--container);
  margin: auto;
  padding: var(--space-sm) 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ======================================================
   BRAND
====================================================== */

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 50px;
  height: 50px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-name {
  font-weight: 600;
  line-height: 1.1;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--brand-green);
  opacity: 0.8;
}

/* ======================================================
   NAVIGATION (Green Structure, Orange Interaction)
====================================================== */

.nav-list {
  list-style: none;
  display: flex;
  gap: 28px;
}

.nav-list a {
  opacity: 0.75;
  position: relative;
}

.nav-list a:hover {
  opacity: 1;
  color: var(--brand-green);
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0%;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--brand-green),
    var(--brand-orange)
  );
  transition: width 0.3s ease;
}

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

.nav-list a.active {
  opacity: 1;
  color: var(--brand-green);
}

/* ======================================================
   BUTTONS (Unified Gradient System)
====================================================== */

.btn-primary,
.btn-signup {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  background: linear-gradient(
    135deg,
    var(--brand-green),
    var(--brand-orange)
  );
  color: #fff;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary:hover,
.btn-signup:hover {
  transform: translateY(-3px);
  box-shadow:
    0 10px 25px rgba(4,106,56,0.25),
    0 8px 20px rgba(255,103,31,0.25);
}

.btn-login {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--brand-green-soft);
}

.btn-login:hover {
  border-color: var(--brand-green);
  color: var(--brand-green);
}

/* ======================================================
   MAIN LAYOUT
====================================================== */

.site-main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ======================================================
   GRID SYSTEM
====================================================== */

.life-grid,
.blog-grid,
.services-grid,
.connect-grid,
.contact-actions {
  display: grid;
  gap: 32px;
  padding: var(--space-lg) 0;
}

.life-grid,
.blog-grid {
  grid-template-columns: repeat(3, 1fr);
}

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

/* ======================================================
   CARD SYSTEM – PREMIUM BRAND
====================================================== */

.life-card,
.blog-card,
.service-card,
.connect-card,
.action-card {
  position: relative;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

body.theme-dark .life-card,
body.theme-dark .blog-card,
body.theme-dark .service-card,
body.theme-dark .connect-card,
body.theme-dark .action-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border-dark);
  box-shadow: var(--card-shadow-dark);
}

body.theme-light .life-card,
body.theme-light .blog-card,
body.theme-light .service-card,
body.theme-light .connect-card,
body.theme-light .action-card {
  background: #fff;
  border: 1px solid var(--card-border-light);
  box-shadow: var(--card-shadow-light);
}

/* Subtle dual glow overlay */

.life-card::before,
.blog-card::before,
.service-card::before,
.connect-card::before,
.action-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top left,
    var(--brand-green-soft),
    transparent 60%
  );
  opacity: 0.5;
  pointer-events: none;
}

/* Brand edge indicator */

.life-card::after,
.blog-card::after,
.service-card::after,
.connect-card::after,
.action-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(
    180deg,
    var(--brand-green),
    var(--brand-orange)
  );
  opacity: 0.9;
}

/* Hover */

.life-card:hover,
.blog-card:hover,
.service-card:hover,
.connect-card:hover,
.action-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 50px rgba(0,0,0,0.25),
    0 0 0 1px var(--brand-green-soft);
}

.life-card:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: 4px;
}

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

.site-footer {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
}

body.theme-dark .site-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
}

body.theme-light .site-footer {
  border-top: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.9);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
}

.footer-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--brand-green);
}

.footer-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-right {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ======================================================
   MOBILE SYSTEM
====================================================== */

@media (max-width: 768px) {

  .header-inner {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }

  .nav-list {
    justify-content: center;
    gap: 18px;
  }

  .life-grid,
  .blog-grid,
  .services-grid,
  .connect-grid,
  .contact-actions {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-right {
    text-align: left;
  }
}

/* ======================================================
   AUTH PAGES
====================================================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--brand-green);
}

.auth-btn {
  padding: 14px;
  border-radius: 999px;
  font-weight: 600;
  background: linear-gradient(
    135deg,
    var(--brand-green),
    var(--brand-orange)
  );
  color: #fff;
  transition: 0.3s ease;
}

.auth-btn:hover {
  transform: translateY(-3px);
  box-shadow:
    0 12px 30px rgba(4,106,56,0.25),
    0 8px 20px rgba(255,103,31,0.25);
}
/* ======================================================
   FOOTER SOCIAL ICON FIX
====================================================== */

.social-icons {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;          /* prevents overflow breaking */
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: transform 0.25s ease, background 0.25s ease;
}

.social-icons img {
  width: 18px;
  height: 18px;
  object-fit: contain;      /* prevents distortion */
  display: block;
  opacity: 0.85;
  transition: opacity 0.25s ease;
}

.social-icons a:hover {
  transform: translateY(-3px);
  background: linear-gradient(
    135deg,
    var(--brand-green),
    var(--brand-orange)
  );
}

.social-icons a:hover img {
  opacity: 1;
  filter: brightness(0) invert(1); /* makes icon white on gradient */
}


/* ======================================================
   THEME TOGGLE FIX
====================================================== */

.footer-right .theme-toggle {
  display: inline-flex;       /* FIX alignment */
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  border: 1px solid var(--card-border-light);
  background: transparent;
  transition: all 0.3s ease;
}

.footer-right .theme-toggle:hover {
  background: linear-gradient(
    135deg,
    var(--brand-green),
    var(--brand-orange)
  );
  color: #fff;
  border-color: transparent;
  transform: rotate(15deg);
}

/* Dark theme border correction */

body.theme-dark .footer-right .theme-toggle {
  border: 1px solid var(--card-border-dark);
}


/* ======================================================
   MOBILE ALIGNMENT FIX
====================================================== */

@media (max-width: 768px) {

  .social-icons {
    justify-content: flex-start;
  }

  .footer-right {
    text-align: left;
    align-items: flex-start;
  }

  .footer-right .theme-toggle {
    align-self: flex-start;
  }
}
/* ======================================================
   FOOTER COPYRIGHT CENTER + TOGGLE RIGHT FIX
====================================================== */

/* Desktop Layout */

.footer-inner {
  position: relative;
}

.footer-bottom {
  text-align: center;
  width: 100%;
}

/* Make footer-right push to right on PC */

.footer-right {
  text-align: right;
  margin-left: auto;   /* pushes it to right */
  align-items: flex-end;
}

/* Toggle button always right on desktop */

.footer-right .theme-toggle {
  align-self: flex-end;
}


/* ======================================================
   MOBILE FIX
====================================================== */

@media (max-width: 768px) {

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-right {
    text-align: left;
    align-items: flex-start;
    margin-left: 0;
  }

  .footer-right .theme-toggle {
    align-self: flex-start;
  }

  .footer-bottom {
    text-align: center;   /* keep copyright centered */
  }
}
/* ======================================================
   FINAL FOOTER STRUCTURE FIX (PRO STABLE)
====================================================== */

/* Make footer layout flexible */

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
}

/* Left section stays normal */
.footer-left {
  text-align: left;
}

/* Right section always right on desktop */
.footer-right {
  text-align: right;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Toggle button clean alignment */
.footer-right .theme-toggle {
  margin-top: 12px;
  align-self: flex-end;
}

/* Copyright ALWAYS center */
.footer-bottom {
  text-align: center;
  width: 100%;
  margin-top: 20px;
}


/* ======================================================
   MOBILE LAYOUT
====================================================== */

@media (max-width: 768px) {

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .footer-right {
    text-align: left;
    justify-self: start;
    align-items: flex-start;
  }

  .footer-right .theme-toggle {
    align-self: flex-start;
  }

  .footer-bottom {
    text-align: center;
  }
}
/* ================= MODAL SYSTEM ================= */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal.active {
  display: flex;
}

/* Dark Overlay */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

/* Modal Box */
.modal-content {
  position: relative;
  width: 95%;
  max-width: 500px;
  padding: 40px;
  border-radius: 24px;
  animation: fadeUp 0.3s ease;
}

.modal-content h2 {
  margin-bottom: 20px;
}

/* Close Button */
.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
}

/* Form Styling */
.modal form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal input,
.modal textarea {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--brand-green);
  background: transparent;
  color: inherit;
}

.modal textarea {
  min-height: 100px;
}

/* Animation */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
