/* ============================================================
   ITMS TimeTracker — Custom Styles
   Дополняет Tailwind CDN
   ============================================================ */

/* ── Global ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

::selection {
  background: #fed600;
  color: #0f0f0f;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #fed600; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #eec901; }

html { font-size: 16px; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ── Gold gradient text ─────────────────────────────────────── */
.text-gold-gradient {
  background: linear-gradient(135deg, #fed600 0%, #ffe566 50%, #fed600 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Animated shimmer gradient text ────────────────────────── */
.text-shimmer {
  background: linear-gradient(90deg, #fed600 0%, #fff9a0 40%, #fed600 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerText 3s linear infinite;
}
@keyframes shimmerText {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ── Gold button ────────────────────────────────────────────── */
.btn-gold {
  background: linear-gradient(135deg, #fed600 0%, #ffe566 50%, #eec901 100%);
  background-size: 200% auto;
  color: #0f0f0f;
  font-weight: 700;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.btn-gold::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.btn-gold:hover::after { transform: translateX(100%); }
.btn-gold:hover {
  background-position: right center;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(254, 214, 0, 0.4);
}
.btn-gold:active { transform: translateY(0); box-shadow: 0 4px 12px rgba(254,214,0,0.3); }

/* ── Ghost button ───────────────────────────────────────────── */
.btn-ghost {
  border: 1.5px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  transition: all 0.25s ease;
}
.btn-ghost:hover {
  border-color: rgba(254,214,0,0.4);
  color: #fff;
  background: rgba(254,214,0,0.06);
}

/* ── Input focus glow ───────────────────────────────────────── */
.input-field {
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.input-field:focus {
  outline: none;
  border-color: #fed600 !important;
  box-shadow: 0 0 0 3px rgba(254, 214, 0, 0.2);
}

/* ── Type cards ─────────────────────────────────────────────── */
.type-card {
  transition: all 0.25s cubic-bezier(0.34, 1.1, 0.64, 1);
  cursor: pointer;
}
.type-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.dark .type-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.type-card.selected {
  border-color: #fed600 !important;
  box-shadow: 0 0 0 2px rgba(254,214,0,0.25), 0 8px 24px rgba(254,214,0,0.15);
  transform: translateY(-2px);
}

/* ── Tab active ─────────────────────────────────────────────── */
.tab-active {
  background: linear-gradient(135deg, #fed600, #ffe566) !important;
  color: #0f0f0f !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 15px rgba(254,214,0,0.3);
}

/* ── Chips (last values) ────────────────────────────────────── */
.chip {
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
}
.chip:hover {
  background: #fed600 !important;
  color: #0f0f0f !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(254,214,0,0.3);
}

/* ── Quick time buttons ─────────────────────────────────────── */
.time-quick-btn { transition: all 0.2s ease; }
.time-quick-btn:hover {
  background: #fed600 !important;
  color: #0f0f0f !important;
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(254,214,0,0.25);
}

/* ── Progress bars ──────────────────────────────────────────── */
.progress-bar { transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1); }

/* ── History cards ──────────────────────────────────────────── */
.history-card { transition: all 0.25s ease; }
.history-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.dark .history-card:hover { box-shadow: 0 8px 24px rgba(254,214,0,0.08); }

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-card { transition: all 0.25s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.dark .stat-card:hover { box-shadow: 0 8px 24px rgba(254,214,0,0.06); }

/* ── Avatar gold ring ───────────────────────────────────────── */
.avatar-ring {
  box-shadow: 0 0 0 2px #fed600, 0 0 0 5px rgba(254,214,0,0.15);
}

/* ── Modal backdrop ─────────────────────────────────────────── */
.modal-backdrop {
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ── Grid background (login) ────────────────────────────────── */
.grid-bg {
  background-image:
    linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
}
.dark .grid-bg {
  background-image:
    linear-gradient(rgba(254,214,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(254,214,0,0.04) 1px, transparent 1px);
}

/* ── Decorative gold orb ────────────────────────────────────── */
.orb {
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  position: absolute;
}

/* ── Neon focus wrapper ─────────────────────────────────────── */
.neon-focus:focus-within {
  filter: drop-shadow(0 0 8px rgba(254,214,0,0.2));
}

/* ── Delete / Edit action buttons ───────────────────────────── */
.del-btn { transition: all 0.2s ease; }
.del-btn:hover { color: #ef4444; transform: scale(1.1); }
.edit-btn { transition: all 0.2s ease; }
.edit-btn:hover { color: #fed600; transform: scale(1.1); }

/* ── Stat number typography ─────────────────────────────────── */
.stat-number {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

/* ── Skeleton loading ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #1a1a1a 25%, #252525 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.8); }
  70%  { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%) scale(0.9); }
  to   { opacity: 1; transform: translateX(0)   scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0)   scale(1); }
  to   { opacity: 0; transform: translateX(100%) scale(0.9); }
}
@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 0 0   rgba(254,214,0,0.4); }
  50%       { box-shadow: 0 0 0 14px rgba(254,214,0,0); }
}

.anim-fade-up    { animation: fadeUp    0.4s ease forwards; }
.anim-fade-in    { animation: fadeIn    0.3s ease forwards; }
.anim-slide-in   { animation: slideIn   0.35s cubic-bezier(0.34,1.1,0.64,1) forwards; }
.anim-bounce-in  { animation: bounceIn  0.45s cubic-bezier(0.34,1.56,0.64,1) forwards; }
.anim-toast-in   { animation: toastIn   0.3s cubic-bezier(0.34,1.1,0.64,1) forwards; }
.anim-toast-out  { animation: toastOut  0.3s ease forwards; }
.anim-pulse-gold { animation: pulseGold 2.2s ease-in-out infinite; }

/* ── Delayed animations ─────────────────────────────────────── */
.delay-100 { animation-delay: 0.1s; opacity: 0; }
.delay-200 { animation-delay: 0.2s; opacity: 0; }
.delay-300 { animation-delay: 0.3s; opacity: 0; }

/* ── Suggestion dropdown ────────────────────────────────────── */
.sug-item {
  transition: background 0.15s ease;
  cursor: pointer;
}
.sug-item:hover { background: rgba(254,214,0,0.1); }

/* ── Section appear ─────────────────────────────────────────── */
.section { animation: fadeUp 0.35s ease forwards; }

/* ── Responsive tweaks ──────────────────────────────────────── */
@media (max-width: 640px) {
  .stat-number { font-size: 1.2rem; }

  /* Stat cards — меньше паддинг на мобиле */
  .stat-card { padding: 0.625rem !important; }
  .stat-card .mb-3 { margin-bottom: 0.375rem !important; }
  .stat-card .w-8  { width: 1.5rem !important; height: 1.5rem !important; }
  .stat-card .w-4  { width: 0.875rem !important; height: 0.875rem !important; }

  /* Убрать горизонтальный скролл */
  body { overflow-x: hidden; }

  /* Хедер — меньше gap на мобиле */
  header .max-w-3xl { gap: 0.5rem; padding-left: 0.75rem; padding-right: 0.75rem; }

  /* Tabs — меньше паддинг текста */
  .tab-btn { padding-left: 0.5rem !important; padding-right: 0.5rem !important; font-size: 0.75rem !important; }

  /* Quick time buttons — мельче */
  .time-quick-btn { padding: 0.25rem 0.5rem !important; font-size: 0.7rem !important; }

  /* Type cards — убрать hover transform чтобы не ломать layout */
  .type-card:hover { transform: none; }

  /* History card — текст полей не переполняет */
  .history-card .flex-1 { min-width: 0; overflow: hidden; }

  /* Кнопки редактирования/удаления — не сжимаются */
  .history-card [data-edit],
  .history-card [data-delete] { flex-shrink: 0; }

  /* Форма — меньше паддинг */
  #formFields .px-5 { padding-left: 1rem !important; padding-right: 1rem !important; }
}

/* ── Number inputs — hide spin buttons ─────────────────────── */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ── Select element polish ──────────────────────────────────── */
select.input-field { appearance: none; cursor: pointer; }

/* ── Scrollbar inside scrollable containers ─────────────────── */
.overflow-y-auto::-webkit-scrollbar { width: 4px; }
.overflow-y-auto::-webkit-scrollbar-thumb { background: rgba(254,214,0,0.3); border-radius: 99px; }

/* ── Textarea — disable resize handle ───────────────────────── */
textarea { resize: none; }

/* ── Type card icon hover animation ────────────────────────── */
.type-card .w-10 { transition: transform 0.25s cubic-bezier(0.34,1.1,0.64,1); }
.type-card:hover .w-10 { transform: scale(1.1) rotate(-4deg); }
.type-card.selected .w-10 { transform: scale(1.05); }
