/* Temel katman - reset, body, scrollbar, yardimcilar, tooltip, animasyonlar, erisilebilirlik */

/* ============================================================
   2. RESET + BODY
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  height: 100vh; width: 100vw;
  font-family: var(--font); color: var(--text);
  background: radial-gradient(ellipse at top left, #e9e9ef 0%, #d4d4dc 60%, #cfcfd6 100%);
  background-attachment: fixed;
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   19. TOOLTIP
   ============================================================ */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 6px;
  background: #1D1D1F; color: #fff; font-size: 11px; font-weight: 500;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap;
  pointer-events: none; z-index: 100;
}

/* ============================================================
   20. MISC HELPERS
   ============================================================ */
.row-flex { display: flex; align-items: center; gap: 10px; }
.col-flex { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* ============================================================
   21. SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15); border-radius: 4px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.28); background-clip: padding-box; }

/* ============================================================
   29. ANIMATIONS / MICRO-INTERACTIONS
   ============================================================ */

@keyframes p360-fade-in   { from { opacity: 0; }  to { opacity: 1; } }
@keyframes p360-fade-up   { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes p360-fade-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes p360-pop-in    { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes p360-pulse     { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }

.fade-in    { animation: p360-fade-in   0.25s ease-out both; }
.fade-up    { animation: p360-fade-up   0.30s ease-out both; }
.fade-down  { animation: p360-fade-down 0.30s ease-out both; }
.pop-in     { animation: p360-pop-in    0.22s ease-out both; }

/* Success checkmark animation */
.success-check {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--green-bg);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--green-dark);
  animation: p360-pop-in 0.32s ease-out both;
}

/* Row fade-out (delete) */
@keyframes p360-row-out {
  0%   { opacity: 1; transform: translateX(0); max-height: 80px; }
  100% { opacity: 0; transform: translateX(-30px); max-height: 0; padding: 0; }
}
.dtable tr.removing,
.lines-table tr.removing { animation: p360-row-out 0.28s ease-out forwards; }

/* Smooth row hover for tables (override default) */
.dtable tbody tr,
.lines-table tbody tr,
.mac-table tbody tr {
  transition: background 0.12s ease;
}

/* Button micro-interaction (active press) */
.btn:active:not(:disabled) {
  transform: scale(0.97);
  transition: transform 0.06s ease;
}

/* Focus visible (accessibility) */
.btn:focus-visible,
.mac-input:focus-visible,
.mac-textarea:focus-visible,
.icon-btn:focus-visible,
.suite-tab:focus-visible,
.segment-tab:focus-visible {
  outline: 2px solid var(--mac-blue);
  outline-offset: 2px;
}

/* ============================================================
   30. ACCESSIBILITY HELPERS
   ============================================================ */

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
