/* Stili personalizzati per FitLog - Mobile Native PWA */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --sat: env(safe-area-inset-top);
  --sab: env(safe-area-inset-bottom);
}

* {
  -webkit-tap-highlight-color: transparent;
}

html, body {
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 12px));
}

main {
  padding-bottom: 2.5rem;
}

#session-tabs-container {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

#session-tabs-container::-webkit-scrollbar {
  display: none;
}

.session-tab-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.font-mono-digits {
  font-family: var(--font-mono);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.4);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.6);
}

/* Glassmorphism & Card styling */
.glass-panel {
  background: rgba(17, 24, 39, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card {
  background: rgba(30, 41, 59, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Bottom Nav Mobile Glass */
.mobile-bottom-nav {
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: calc(0.35rem + env(safe-area-inset-bottom, 8px));
}

/* Pulse animations for active timer states */
@keyframes pulse-ring-emerald {
  0% {
    transform: translate(-50%, 0) scale(0.98);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: translate(-50%, 0) scale(1);
    box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
  }
  100% {
    transform: translate(-50%, 0) scale(0.98);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes pulse-ring-amber {
  0% {
    transform: translate(-50%, 0) scale(0.98);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  }
  70% {
    transform: translate(-50%, 0) scale(1);
    box-shadow: 0 0 0 12px rgba(245, 158, 11, 0);
  }
  100% {
    transform: translate(-50%, 0) scale(0.98);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

.timer-phase-rest {
  border-color: rgba(16, 185, 129, 0.5) !important;
  animation: pulse-ring-emerald 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.timer-phase-work {
  border-color: rgba(245, 158, 11, 0.6) !important;
  animation: pulse-ring-amber 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.timer-paused {
  animation: none !important;
  opacity: 0.92;
}

/* Badge bloccato */
.badge-locked {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-target {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Touch-friendly inputs */
input,
select,
button {
  touch-action: manipulation;
}

/* Active touch state */
button:active {
  transform: scale(0.97);
}

.theme-pink {
  --accent-50: rgb(253 242 248);
  --accent-100: rgb(252 231 243);
  --accent-300: rgb(249 168 212);
  --accent-400: rgb(244 114 182);
  --accent-500: rgb(236 72 153);
  --accent-600: rgb(219 39 119);
}

.theme-pink body,
body.theme-pink {
  background:
    radial-gradient(circle at top center,
      rgba(190, 24, 93, .15),
      transparent 40%),
    #020617;
}

.theme-pink #main-header {
  background: linear-gradient(135deg,
      #9d174d,
      #be185d,
      #db2777);
}

.theme-pink .fitlog-logo {
  background: linear-gradient(135deg,
      #ec4899,
      #f9a8d4);
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   Print Media Styles (Export PDF & Physical Printing)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #0f172a !important;
    padding-bottom: 0 !important;
  }

  header,
  footer,
  nav,
  #bottom-nav,
  #floating-timer-widget,
  #global-timer-bar,
  #floating-notes-indicator,
  .toast,
  .modal,
  button,
  #history-add-new-btn {
    display: none !important;
  }

  main {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .glass-panel,
  .bg-slate-900,
  .bg-slate-800,
  .bg-slate-950 {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 12px !important;
  }

  h1, h2, h3, h4, h5, strong, p, span, div {
    color: #0f172a !important;
    text-shadow: none !important;
  }

  .text-slate-400, .text-slate-500, .text-slate-300 {
    color: #475569 !important;
  }

  .border-slate-700, .border-slate-800, .border-slate-700\/60 {
    border-color: #e2e8f0 !important;
  }

  .bg-indigo-500\/20, .bg-indigo-600\/20, .bg-emerald-500\/20 {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
  }
}