/* Secretos App - Global Styles & Utilities */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700;800&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  --bg: #07080c;
  --bg-alt: #0f1118;
  --card: rgba(19, 22, 31, 0.86);
  --card-bg: rgba(19, 22, 31, 0.86);
  --text: #f8f9fb;
  --gray: #9aa3b2;
  --accent: #ff2d6d;
  --accent-soft: rgba(255, 45, 109, 0.16);
  --border: rgba(255, 255, 255, 0.09);
  --accent-rgb: 255, 0, 79;
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.38);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.28);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

html, body {
  min-height: 100%;
}

body {
  color: var(--text);
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 45, 109, 0.18), transparent 26%),
    radial-gradient(circle at 82% 4%, rgba(255, 183, 77, 0.14), transparent 20%),
    radial-gradient(circle at 50% 100%, rgba(88, 145, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #050608 0%, #090b11 42%, #07080c 100%);
  background-attachment: fixed;
}

body.auth-page,
body.app-page {
  position: relative;
  overflow-x: hidden;
}

body.auth-page::before,
body.app-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 35%),
    linear-gradient(315deg, rgba(255, 45, 109, 0.04), transparent 42%);
  pointer-events: none;
  z-index: -1;
}

body.auth-page::after,
body.app-page::after {
  content: '';
  position: fixed;
  left: -12vw;
  bottom: -18vh;
  width: 34vw;
  height: 34vw;
  background: radial-gradient(circle, rgba(255, 45, 109, 0.12) 0%, transparent 72%);
  pointer-events: none;
  z-index: -1;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-lockup h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.06em;
}

.brand-lockup span {
  font-size: 12px;
  color: var(--gray);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: stretch;
  padding: 22px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(255, 45, 109, 0.16), rgba(18, 22, 33, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.hero-copy {
  flex: 1;
  min-width: 0;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--gray);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-copy h2 {
  margin: 12px 0 8px;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.hero-copy p {
  margin: 0;
  max-width: 38ch;
  color: rgba(248, 249, 251, 0.78);
  font-size: 15px;
  line-height: 1.6;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-self: center;
}

.metric-pill {
  min-width: 98px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(8, 10, 16, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.metric-pill strong {
  display: block;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-pill span {
  display: block;
  margin-top: 6px;
  color: var(--gray);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.surface-panel,
.glass-panel,
.card,
.create-post,
.post-card,
.slider-panel,
.comment-modal {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.surface-panel,
.glass-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(255, 45, 109, 0.18);
}

.field-input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(7, 8, 12, 0.72);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.field-input:focus {
  border-color: rgba(255, 45, 109, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 45, 109, 0.12);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray);
}

.section-label::before {
  content: '';
  width: 18px;
  height: 1px;
  background: rgba(255, 255, 255, 0.22);
}

/* ===== FLEX UTILITIES ===== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; }
.flex-center-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center-gap8 { display: flex; align-items: center; gap: 8px; }
.flex-center-gap10 { display: flex; align-items: center; gap: 10px; }
.flex-center-gap12 { display: flex; align-items: center; gap: 12px; }
.flex-center-gap14 { display: flex; align-items: center; gap: 14px; }
.flex-center-wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.flex-between { display: flex; justify-content: space-between; }
.flex-between-center { display: flex; justify-content: space-between; align-items: center; }
.flex-center-justify { display: flex; align-items: center; justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.gap4 { gap: 4px; }
.gap6 { gap: 6px; }
.gap8 { gap: 8px; }
.gap10 { gap: 10px; }
.gap12 { gap: 12px; }
.gap14 { gap: 14px; }

/* ===== TEXT UTILITIES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-white { color: white; }
.text-gray { color: var(--gray); }
.text-accent { color: var(--accent); }
.text-green { color: #00e676; }
.text-red { color: #ff3b30; }
.text-pink { color: #ff0055; }
.text-11 { font-size: 11px; }
.text-12 { font-size: 12px; }
.text-13 { font-size: 13px; }
.text-14 { font-size: 14px; }
.text-15 { font-size: 15px; }
.text-16 { font-size: 16px; }
.text-18 { font-size: 18px; }
.text-20 { font-size: 20px; }
.fw-bold { font-weight: bold; }
.fw-600 { font-weight: 600; }
.fw-500 { font-weight: 500; }
.lh-14 { line-height: 1.4; }
.lh-16 { line-height: 1.6; }
.text-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pre-wrap { white-space: pre-wrap; }

/* ===== PADDING & MARGIN ===== */
.p4 { padding: 4px; }
.p8 { padding: 8px; }
.p10 { padding: 10px; }
.p12 { padding: 12px; }
.p15 { padding: 15px; }
.p20 { padding: 20px; }
.px10 { padding-left: 10px; padding-right: 10px; }
.px12 { padding-left: 12px; padding-right: 12px; }
.px15 { padding-left: 15px; padding-right: 15px; }
.py6 { padding-top: 6px; padding-bottom: 6px; }
.py8 { padding-top: 8px; padding-bottom: 8px; }
.py10 { padding-top: 10px; padding-bottom: 10px; }
.py15 { padding-top: 15px; padding-bottom: 15px; }
.pt18 { padding-top: 18px; }
.pb10 { padding-bottom: 10px; }
.m0 { margin: 0; }
.mt4 { margin-top: 4px; }
.mt5 { margin-top: 5px; }
.mt6 { margin-top: 6px; }
.mt8 { margin-top: 8px; }
.mt10 { margin-top: 10px; }
.mt12 { margin-top: 12px; }
.mt15 { margin-top: 15px; }
.mt20 { margin-top: 20px; }
.mt30 { margin-top: 30px; }
.mb4 { margin-bottom: 4px; }
.mb6 { margin-bottom: 6px; }
.mb8 { margin-bottom: 8px; }
.mb10 { margin-bottom: 10px; }
.mb12 { margin-bottom: 12px; }
.mb15 { margin-bottom: 15px; }
.mb20 { margin-bottom: 20px; }
.ml8 { margin-left: 8px; }
.ml10 { margin-left: 10px; }
.mr6 { margin-right: 6px; }
.mr8 { margin-right: 8px; }

/* ===== BACKGROUNDS ===== */
.bg-card { background: var(--card-bg); }
.bg-dark { background: #0d0d0d; }
.bg-accent { background: var(--accent); }
.bg-transparent { background: transparent; }
.bg-hover:hover { background: #2a2a2a; }
.bg-input { background: #111; }
.bg-input-alt { background: #1a1a1a; }

/* ===== BORDERS & RADIUS ===== */
.border-card { border: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }
.border-top { border-top: 1px solid var(--border); }
.border-accent-left { border-left: 4px solid var(--accent); }
.border-accent { border: 1px solid var(--accent); }
.border-gray { border: 1px solid #333; }
.border-none { border: none; }
.radius4 { border-radius: 4px; }
.radius8 { border-radius: 8px; }
.radius10 { border-radius: 10px; }
.radius12 { border-radius: 12px; }
.radius14 { border-radius: 14px; }
.radius16 { border-radius: 16px; }
.radius20 { border-radius: 20px; }
.radius-full { border-radius: 50%; }

/* ===== DISPLAY ===== */
.hidden { display: none; }


input, select, textarea { font-size: 16px; }


.block { display: block; }
.inline-block { display: inline-block; }

/* ===== WIDTH & HEIGHT ===== */
.w-full { width: 100%; }
.h-full { height: 100%; }
.w-auto { width: auto; }

/* ===== CURSOR ===== */
.pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* ===== OVERFLOW ===== */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* ===== POSITION ===== */
.relative { position: relative; }
.absolute { position: absolute; }

/* ===== MISC ===== */
.object-cover { object-fit: cover; }
.no-select { user-select: none; }
.transition { transition: 0.2s; }
.opacity-40 { opacity: 0.4; }
.opacity-60 { opacity: 0.6; }
.opacity-80 { opacity: 0.8; }

/* ===== LOADING SPINNER ===== */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Loading overlay for AJAX content areas */
.loading-overlay { position: absolute; inset: 0; background: rgba(11,11,11,0.7); display: flex; align-items: center; justify-content: center; z-index: 50; border-radius: 12px; }
.loading-overlay .spinner { width: 28px; height: 28px; }

/* Loading state for buttons (disable + spinner inline) */
.btn-loading { opacity: 0.6; pointer-events: none; position: relative; }
.btn-loading::after { content: ''; display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; margin-left: 6px; vertical-align: middle; }

/* Inline spinner for "loading more" (infinite scroll) */
.load-more-spinner { text-align: center; padding: 20px; color: var(--gray); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* ===== MI CUENTA - MENU ITEMS ===== */
.menu-item { cursor: pointer; border: 1px solid var(--border); transition: 0.2s; }
.menu-item:hover { border-color: var(--accent) !important; background: #222 !important; }
.menu-icon-box { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }

/* ===== PERFORMANCE ===== */
.slider-panel { will-change: right; }
.slider-content { contain: layout style paint; }

/* ===== TOAST NOTIFICATION (global) ===== */
.toast {
    position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
    background: #161616; border: 1px solid #333; border-radius: 12px;
    padding: 14px 20px; text-align: center; z-index: 99999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5); max-width: 90%;
    animation: slideUp 0.3s;
    font-size: 14px; color: #fff; line-height: 1.4;
}
.toast.success { border-color: #00e676; }
.toast.error { border-color: #ff3b30; }
.toast.info { border-color: #ff0055; }
@keyframes slideUp { from{ transform:translateY(100%); opacity:0; } to{ transform:translateY(0); opacity:1; } }

/* ===== PAGE LOADING OVERLAY ===== */
.page-loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(11, 11, 11, 0.85); z-index: 99998;
    display: none; align-items: center; justify-content: center;
    flex-direction: column; gap: 12px;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.page-loader.active { display: flex; }
.page-loader .spinner-lg { width: 40px; height: 40px; border-width: 4px; }
.page-loader .loader-text { font-size: 13px; color: var(--gray); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* Button loading state (reusable) */
/* Button loading state */
.btn-loading { opacity: 0.6; pointer-events: none; position: relative; }
.btn-loading::after { content: ''; display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; margin-left: 6px; vertical-align: middle; }

/* =============================================================
   RESPONSIVE GLOBAL — Mobile-first adjustments
   Se aplican a todas las páginas que cargan este style.css
   ============================================================= */

/* Pantallas muy pequeñas (< 400px) */
@media (max-width: 400px) {
  html { font-size: 14px; }
  .feed, .app-container, .container { padding-left: 10px; padding-right: 10px; }
  .nav-top h1 { font-size: 20px; }
  .nav-bottom i { font-size: 20px; }
  .slider-panel { max-width: 100%; border-left: none; }
  .msg { max-width: 85% !important; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 2px; }
}

/* Pantallas extra pequeñas (< 340px) */
@media (max-width: 340px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 1px; }
  .product-grid { grid-template-columns: 1fr !important; }
  .nav-icons { gap: 12px; }
  .profile-name { font-size: 20px; }
  .avatar-wrapper { width: 100px; height: 100px; }
}

/* Safe area para notches/island (iPhone, etc) */
@supports (padding: max(0px)) {
  .nav-bottom {
    padding-bottom: max(0px, env(safe-area-inset-bottom, 0px));
    height: max(60px, calc(60px + env(safe-area-inset-bottom)));
  }
  .feed { padding-bottom: max(80px, calc(80px + env(safe-area-inset-bottom))); }
  body { padding-top: max(130px, calc(130px + env(safe-area-inset-top, 0px))); }
  .chat-input { padding-bottom: max(10px, env(safe-area-inset-bottom, 10px)); }
}

/* Landscape en mobile — oculta stories y create-post para ganar espacio */
@media (max-height: 450px) and (orientation: landscape) {
  .stories-container { display: none; }
  .create-post { display: none; }
  body { padding-top: 60px; }
}

/* Desktop/tablet — grid de shop a 3 columnas */
@media (min-width: 768px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .slider-panel { max-width: 400px; }
}
