/* ============================================================
   RP SHARED STYLES — común a RPPlanning, RPPartidos, RPStats
   Subir a: renepfull.com/assets/rp-shared-style.css
   ============================================================ */

@font-face {
  font-family: 'Adlery Blockletter';
  src: url('https://renepfull.com/assets/fonts/Adlery-Pro-Blockletter.ttf.woff') format('woff'),
       url('https://renepfull.com/assets/fonts/Adlery-Pro-Blockletter.ttf.svg#AdleryProBlockletter') format('svg');
  font-weight: normal; font-style: normal;
}
@font-face {
  font-family: 'ThisReality';
  src: url('https://renepfull.com/assets/fonts/ThisReality-Regular.woff') format('woff');
  font-weight: normal; font-style: normal;
}

/* ── Variables ── */
:root {
  --app-bg:      #012C1D;
  --app-surface: #01391f;
  --app-surface2:#024a2a;
  --app-border:  rgba(255,255,255,0.25);
  --app-text:    #ffffff;
  --app-muted:   #ffffff;
  --yellow:      #ffffff; /* RPPlanning/RPPartidos */
  --rp-danger:   #DC3545;
  --rp-success:  #1a7a4a;
  --font-card:   'Anton', Impact, 'Arial Narrow', sans-serif;
  --font-ui:     'Oswald', system-ui, -apple-system, sans-serif;
}

/* ── Modo claro ── */
body.light-mode {
  background: #f0f4f2; color: #012C1D;
  --app-bg:      #f0f4f2;
  --app-surface: #ffffff;
  --app-surface2:#e8f0eb;
  --app-border:  rgba(1,44,29,0.2);
  --app-text:    #012C1D;
  --app-muted:   #3a5a4a;
}
body.light-mode .navbar     { background: #012C1D !important; }
body.light-mode .nav-brand  { color: #fff !important; }
body.light-mode .nav-tab    { color: rgba(255,255,255,0.75) !important; }
body.light-mode .nav-tab:hover { background: rgba(255,255,255,0.15) !important; color: #fff !important; }
body.light-mode .nav-tab.active { background: #fff !important; color: #012C1D !important; }
body.light-mode .btn-theme     { border-color: rgba(255,255,255,0.4) !important; color: #fff !important; }
body.light-mode .btn-logout    { border-color: rgba(255,255,255,0.25) !important; color: rgba(255,255,255,0.75) !important; }
body.light-mode .btn-hamburger { border-color: rgba(255,255,255,0.25) !important; color: rgba(255,255,255,0.75) !important; }
body.light-mode .btn-logout:hover    { border-color: #fff !important; color: #fff !important; }
body.light-mode .btn-hamburger:hover { border-color: #fff !important; color: #fff !important; }
body.light-mode #nav-username { color: rgba(255,255,255,0.75) !important; }
body.light-mode .sync-indicator { border-color: rgba(255,255,255,0.3) !important; }
body.light-mode .login-box  { background: #01391f !important; border-color: rgba(255,255,255,0.25) !important; color: #fff !important; }
body.light-mode .login-title { color: #fff !important; }
body.light-mode .login-box input { background: rgba(0,0,0,0.25) !important; border-color: rgba(255,255,255,0.3) !important; color: #fff !important; }
body.light-mode .login-box input::placeholder { color: rgba(255,255,255,0.5) !important; }
body.light-mode .login-box button { background: #fff !important; color: #012C1D !important; }
body.light-mode .btn-back-login { color: rgba(255,255,255,0.6) !important; }
body.light-mode .landing-title { color: #fff !important; }
body.light-mode .btn-landing { background: #fff !important; color: #012C1D !important; }
body.light-mode .app-footer { background: #012C1D !important; color: #fff !important; }
body.light-mode .app-footer .footer-links a { color: #fff !important; }

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  font-size: 16px;
  background: var(--app-bg);
  color: var(--app-text);
  min-height: 100vh;
}
.hidden { display: none !important; }

/* ── Landing ── */
.screen-full { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: #012C1D; }
body.light-mode .screen-full { background: #012C1D !important; }
.screen-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.landing-box { display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; }
.landing-logo { max-height: 350px; width: auto; max-width: 90vw; object-fit: contain; }
.landing-title { font-family: 'ThisReality', sans-serif; font-size: 42px; font-weight: 400; color: #fff; letter-spacing: 2px; margin: 0; }
.btn-landing { padding: 14px 40px; background: #fff; color: #012C1D; border: none;
  border-radius: 8px; font-weight: 700; font-size: 17px; cursor: pointer;
  font-family: var(--font-ui); letter-spacing: 1px; transition: background .2s;
  width: 100%; max-width: 320px; box-sizing: border-box; }
.btn-landing:hover { background: #e0ede6; }

/* ── Login ── */
.login-box { background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: 20px; padding: 48px 40px; display: flex; flex-direction: column;
  align-items: center; gap: 16px; width: 360px; max-width: 90vw; }
.login-logo-img { height: 100px; width: auto; object-fit: contain; }
.login-title { font-family: 'ThisReality', sans-serif; font-size: 32px; font-weight: 400; color: #fff; letter-spacing: 2px; margin: 0; }
.login-box input { width: 100%; padding: 13px 16px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.3); background: rgba(0,0,0,0.25); color: #fff;
  font-size: 16px; text-align: center; font-family: var(--font-ui); }
.login-box input::placeholder { color: rgba(255,255,255,0.5); }
.login-box input:focus { outline: none; border-color: #fff; }
.login-box button { width: 100%; padding: 13px; background: #fff; color: #012C1D;
  font-weight: 700; font-size: 18px; border: none; border-radius: 6px;
  cursor: pointer; letter-spacing: 2px; font-family: var(--font-card); }
.login-box button:hover { background: #e0e0e0; }
.btn-back-login { background: transparent !important; color: rgba(255,255,255,0.6) !important;
  font-size: 14px !important; font-weight: 400 !important; letter-spacing: 0 !important; padding: 6px !important; }
.btn-back-login:hover { color: #fff !important; background: transparent !important; }
.error { color: #ff5555; font-size: 13px; }

/* ── Navbar ── */
.navbar { display: flex; align-items: center; gap: 12px; background: #012C1D;
  padding: 0 20px; height: 58px; border-bottom: 3px solid var(--yellow);
  position: sticky; top: 0; z-index: 200; }
.nav-brand { display: flex; align-items: center; gap: 12px; margin-right: auto;
  font-family: 'ThisReality', var(--font-card); font-size: 32px; color: var(--yellow); letter-spacing: 1px; }
.nav-logo { height: 54px; width: auto; filter: brightness(0) invert(1); }
.nav-tabs { display: flex; gap: 2px; }
.nav-tab { background: transparent; border: none; color: rgba(255,255,255,0.75);
  padding: 9px 18px; border-radius: 6px; cursor: pointer; font-size: 15px;
  font-weight: 600; font-family: var(--font-ui); transition: all .2s; white-space: nowrap; }
.nav-tab:hover { background: rgba(255,255,255,0.15); color: #fff; }
.nav-tab.active { background: #fff; color: #012C1D; }

/* Botones de cabecera */
.btn-logout { background: transparent; border: 1px solid var(--app-border);
  color: var(--app-muted); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 20px; line-height: 1; }
.btn-logout:hover { border-color: #fff; color: #fff; }
.btn-hamburger { display: none; background: transparent; border: 1px solid var(--app-border);
  color: var(--app-muted); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 20px; line-height: 1; }
.btn-hamburger:hover { border-color: #fff; color: #fff; }
.btn-theme { background: transparent; border: 1px solid rgba(255,255,255,0.4);
  color: #fff; padding: 6px 12px; border-radius: 6px; cursor: pointer;
  font-size: 20px; line-height: 1; transition: all .2s; }
.btn-theme:hover { border-color: #fff; }

/* Indicador de sincronización */
.sync-indicator { width: 12px; height: 12px; border-radius: 50%; cursor: pointer;
  flex-shrink: 0; transition: background .3s; border: 1px solid rgba(255,255,255,0.3); }
.sync-indicator[data-state="idle"]    { background: rgba(255,255,255,0.2); }
.sync-indicator[data-state="syncing"] { background: #f5a623; animation: rp-pulse .8s ease-in-out infinite; }
.sync-indicator[data-state="ok"]      { background: #4caf50; }
.sync-indicator[data-state="error"]   { background: #e53935; }
@keyframes rp-pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ── Menú móvil ── */
.mobile-menu { position: fixed; top: 0; left: 0; width: 260px; height: 100vh;
  background: #012C1D; border-right: 2px solid var(--yellow);
  z-index: 1000; display: flex; flex-direction: column;
  padding: 20px 0; gap: 4px;
  transform: translateX(-100%); transition: transform .25s ease; }
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-header { display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px 16px; border-bottom: 1px solid var(--app-border); margin-bottom: 8px;
  font-family: var(--font-card); color: var(--yellow); font-size: 16px; letter-spacing: 2px; }
.mobile-menu-close { background: transparent; border: none; color: var(--app-muted);
  font-size: 22px; cursor: pointer; line-height: 1; }
.mobile-menu-close:hover { color: #fff; }
.mobile-menu-item { background: transparent; border: none; color: var(--app-muted);
  text-align: left; padding: 14px 20px; font-size: 16px; font-weight: 600;
  font-family: var(--font-ui); cursor: pointer; transition: all .15s;
  border-left: 3px solid transparent; width: 100%; display: block; }
.mobile-menu-item:hover { color: #fff; background: rgba(255,255,255,0.08); }
.mobile-menu-item.active { color: #fff; border-left-color: #fff; background: rgba(255,255,255,0.1); }
.mobile-menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 999; display: none; }
.mobile-menu-overlay.open { display: block; }
.mobile-menu-sep { height: 1px; background: var(--app-border); margin: 8px 16px; }
.mm-action { color: rgba(255,255,255,0.6) !important; font-size: 14px !important; font-weight: 400 !important; }
.mm-logout { color: rgba(255,100,100,0.8) !important; }

/* ── Footer ── */
.app-footer { background: #012C1D; border-top: 2px solid var(--yellow);
  padding: 16px 24px; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 12px; color: #fff; font-family: var(--font-ui); }
/* #rp-footer es el hijo directo del flex container en las apps; el margin-top:auto lo empuja al fondo */
#rp-footer { margin-top: auto; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: #fff; text-decoration: none; font-size: 12px; }
.footer-links a:hover { color: rgba(255,255,255,.7); text-decoration: none; }

/* ── Botones comunes ── */
.btn-primary { background: #fff; color: #012C1D; border: none; padding: 10px 20px;
  border-radius: 6px; font-weight: 700; cursor: pointer; font-size: 14px; font-family: var(--font-ui); }
.btn-primary:hover { background: #e0e0e0; }
.btn-secondary { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.35);
  padding: 10px 16px; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 14px; font-family: var(--font-ui); }
.btn-secondary:hover { background: rgba(255,255,255,0.18); border-color: #fff; }
.btn-danger { background: #c62828; color: #fff; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.btn-edit   { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.3); padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 13px; }

/* Modo claro — botones */
body.light-mode .btn-primary   { background: #012C1D; color: #fff; }
body.light-mode .btn-primary:hover { background: #024a2a; }
body.light-mode .btn-secondary { background: rgba(1,44,29,0.08); color: #012C1D; border-color: rgba(1,44,29,0.35); }
body.light-mode .btn-secondary:hover { background: rgba(1,44,29,0.15); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--app-bg); }
::-webkit-scrollbar-thumb { background: var(--app-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--app-muted); }

/* ── Responsive ── */
@media (min-width: 769px) {
  body { font-size: 18px; }
  .nav-tab { font-size: 17px; }
  .app-footer { font-size: 14px; }
  .footer-links a { font-size: 14px; }
  .btn-primary, .btn-secondary { font-size: 16px; }
}

@media (max-width: 768px) {
  .btn-hamburger { display: block; }
  .nav-tabs { display: none; }
  /* En móvil: ocultar del navbar sync, tema, username y logout — van dentro del menú lateral */
  .sync-indicator, .btn-theme, .btn-logout, #nav-username { display: none !important; }
  .app-footer { flex-direction: column; align-items: center; text-align: center; }
  .footer-links { justify-content: center; }

  /* Landing móvil */
  .landing-logo  { max-height: 220px; }
  .landing-title { font-size: 28px; }
  .landing-box   { gap: 18px; }
  .btn-landing   { width: 100%; max-width: 320px; }

  /* Login móvil */
  .login-box { padding: 32px 20px; }
}
