﻿/* ================================================================
   Linktree Enterprise – Frontend Styles
   Clean, modern Linktree-style layout
   ================================================================ */

/* ─── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:          #0f172a;
  --bg-overlay:  rgba(15, 23, 42, 0.82);
  --text:        #f1f5f9;
  --text-muted:  #94a3b8;
  --btn-radius:  35px;
  --btn-shadow:  0 4px 16px rgba(0, 0, 0, 0.25);
  --transition:  0.2s ease;
  --container-w: 450px;
}

html {
  min-height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
}

/* ─── Page Wrapper ──────────────────────────────────────────────── */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Background image overlay */
.page-wrapper::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 0;
  pointer-events: none;
}

body:not([style*="background-image"]) .page-wrapper::before {
  display: none;
}

/* ─── Container ─────────────────────────────────────────────────── */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 48px 24px 32px;
}

/* ─── Logo ──────────────────────────────────────────────────────── */
.logo-wrap {
  text-align: center;
  margin-bottom: clamp(25px, 5vw, 50px);
}

.logo-img {
  width: clamp(250px, 90%, 400px);
}

/* ─── Header Section ────────────────────────────────────────────── */
.header-section {
  text-align: center;
  margin-bottom: 32px;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.page-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 420px;
  margin: 0 auto;
}

/* ─── Social Icons Row ──────────────────────────────────────────── */
.social-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(15px, 2.5vw, 25px);
  flex-wrap: wrap;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.social-icon:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.3));
  scale: 1.05;
}

.social-icon:active {
  transform: translateY(0);
}

.social-emoji {
  font-size: 1.4rem;
  line-height: 1;
}

.social-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.social-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
}

/* ─── Buttons - Default ────────────────────────────────────────── */
.btn-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition);
  box-shadow: var(--btn-shadow);
  position: relative;
  overflow: hidden;
  cursor: pointer;

  &::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background var(--transition);
  }
  &:hover::after {
    background: rgba(255, 255, 255, 0.08);
  }
  &:active {
    transform: scale(0.98);
  }
  .btn-title {
    flex: 1;
    text-align: center;
  }
}

/* ─── Buttons – Normal (full width) ────────────────────────────── */
.buttons-normal {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2vw, 20px);
  margin: clamp(25px, 5vw, 50px) 0;

  .btn-normal {
    width: 100%;
    padding: 16px 24px;
    min-height: 58px;
  }
}

/* ─── Buttons – Grid (2-col square) ────────────────────────────── */
.buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(15px, 2.5vw, 25px);
  margin-bottom: 20px;

  .btn-grid {
    aspect-ratio: 1;
    flex-direction: column;
    gap: 8px;
    min-height: 120px;
    padding: clamp(8px, 2vw, 12px);
    text-align: center;

    &:hover {
      scale: 0.97;
    }
    .btn-grid-icon-wrapper {
      width: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: clamp(5px, 2vw, 10px);
      
      .btn-icon-img {
        max-width: 100%;
        max-height: 100%;
      }
    }
    .btn-grid-title {
      font-weight: 600;
      line-height: 1.3;
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }
}

/* ─── Empty State ───────────────────────────────────────────────── */
.empty-links {
  text-align: center;
  padding: 48px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ─── Footer ────────────────────────────────────────────────────── */
.page-footer {
  position: relative;
  z-index: 1;
  padding: 24px;
  text-align: center;

  .footer-content {
    color: var(--text);
    line-height: 1.6;
    text-align: center;

    a {
      color: var(--text);
      text-decoration: underline;
      transition: color var(--transition);

      &:hover {
        color: var(--text-muted);
      }
    }
    p {
      margin: 4px 0;
    }
    ul, ol {
      display: inline-block;
      text-align: left;
      margin: 4px 0;
      padding-left: 20px;
    }
  }
}

/* ─── Click Ripple Animation ────────────────────────────────────── */
@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(4); opacity: 0; }
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  width: 60px;
  height: 60px;
  margin-top: -30px;
  margin-left: -30px;
  animation: ripple 0.5s linear;
  pointer-events: none;
  z-index: 10;
}

/* ─── Loading overlay for click ────────────────────────────────── */
.btn-link.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* ─── Mobile Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .container {
    padding: 32px 16px 24px;
  }

  .page-title {
    font-size: 1.3rem;
  }

  .btn-normal {
    padding: 14px 20px;
    min-height: 52px;
  }

  .buttons-grid {
    gap: 10px;
  
	  .btn-grid {
      min-height: 100px;
      padding: 12px 8px;
	  }
  }
}

/* ─── Page Loader ───────────────────────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

#page-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: loaderSpin 0.75s linear infinite;
}

@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

/* ─── Entry Animations ──────────────────────────────────────────── */
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInFromRight {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeScaleIn {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.anim-grid {
  opacity: 0;
  animation: slideUpFade 0.8s ease-in-out forwards paused;
}

.anim-normal {
  opacity: 0;
  animation: slideInFromRight 0.8s ease-in-out forwards paused;
}

.anim-social {
  opacity: 0;
  animation: slideDownFade 0.8s ease-in-out forwards paused;
}
