/* Timer Suite v1 - Base Styles */
:root {
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  
  --bg-primary: #0f0f1e;
  --bg-secondary: #1a1a2e;
  --bg-card: rgba(255, 255, 255, 0.05);
  
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --text-muted: rgba(255, 255, 255, 0.5);
  
  --border-radius: 24px;
  --border-radius-sm: 16px;
  --blur-amount: 16px;
  
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  touch-action: manipulation;
}

/* hidden özniteliği her zaman gizlesin (flex/grid bileşenlerde bile) */
[hidden] {
  display: none !important;
}

html {
  color-scheme: dark; /* site her zaman koyu: tarih/saat ikonları, açılır listeler, kaydırma çubukları koyu temalı */
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'SF Pro Display', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  touch-action: manipulation;
}

/* Simple Diagonal Gradient Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
background: #0f0c29; /* fallback for old browsers */
background: -webkit-radial-gradient(ellipse at top left, #302b63, #0f0c29);
background: radial-gradient(ellipse at top left, #302b63, #0f0c29);
  z-index: -1;
  pointer-events: none;
}

/* Main Container */
.tool-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--spacing-xl) var(--spacing-md) var(--spacing-lg);
  transition: var(--transition);
}

/* Fullscreen Mode */
body.fullscreen {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

body.fullscreen .tool-container {
  padding: var(--spacing-md);
  min-height: 100vh;
  min-height: 100dvh;
}

body.fullscreen .site-footer {
  display: none;
}

body.fullscreen .ad-slot {
  display: none !important;
}

body.fullscreen .fixed-controls {
  background: transparent;
  backdrop-filter: none;
}

/* Fixed Controls */
.fixed-controls {
  position: fixed;
  bottom: var(--spacing-md);
  right: var(--spacing-md);
  display: flex;
  gap: var(--spacing-sm);
  z-index: 1100;
  transition: var(--transition);
}

.control-btn {
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(var(--blur-amount));
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.control-btn:active {
  transform: translateY(0);
}

.control-btn svg {
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s, transform 0.2s;
}

.control-btn .icon-default {
  opacity: 1;
}

.control-btn .icon-close {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-90deg);
}

.control-btn.active .icon-default {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg);
}

.control-btn.active .icon-close {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg);
  display: block !important;
}

/* Drawer */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.drawer.open {
  opacity: 1;
  visibility: visible;
}

.drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  width: min(400px, 90vw);
  height: 100%;
  background: var(--bg-secondary);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.drawer.open .drawer-content {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.drawer-header h2 {
  font-weight: 700;
  color: var(--text-primary);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-lg);
  -webkit-overflow-scrolling: touch;
}

/* Tool Menu */
.tool-menu {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* Menu Category */
.menu-category {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.menu-category-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: var(--spacing-xs) var(--spacing-sm);
  margin-bottom: var(--spacing-xs);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.menu-item.active {
  background: var(--gradient-primary);
}

.menu-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-icon svg {
  width: 22px;
  height: 22px;
}

.menu-label {
  flex: 1;
}

.drawer-logo {
  display: inline-flex;
}

.drawer-logo img {
  height: 26px;
  width: auto;
}

/* Ad Slots */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
}

.ad-placeholder {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Mobile Ads */
.ad-mobile-top,
.ad-mobile-bottom {
  display: flex;
  width: 100%;
  min-height: 100px;
  margin: var(--spacing-md) auto;
}

.ad-mobile-bottom {
  margin-bottom: calc(var(--spacing-md) + 80px);
}

/* Desktop Ads */
.ad-desktop-left,
.ad-desktop-right {
  display: none;
}

/* Form Elements - Prevent Zoom */
input,
select,
textarea,
button {
  font-family: inherit; /* butonlar/inputlar tarayıcı varsayılan fontunu (Arial) değil site fontunu kullansın */
  font-size: 16px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

select {
  font-size: 16px;
}

/* Mobilde inputa odaklanınca tarayıcı zoom'unu kesin engelle
   (araç CSS'leri rem ile 16px altına düşürebiliyor → !important ile sabitle) */
@media (max-width: 640px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

@media (min-width: 1024px) {
  .ad-mobile-top,
  .ad-mobile-bottom {
    display: none;
  }
  
  .ad-desktop-left,
  .ad-desktop-right {
    display: flex;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    min-height: 600px;
    z-index: 10;
  }
  
  .ad-desktop-left {
    left: var(--spacing-md);
  }
  
  .ad-desktop-right {
    right: var(--spacing-md);
  }
  
  .fixed-controls {
    right: calc(160px + var(--spacing-md) * 2 + var(--spacing-sm));
  }
}

/* Responsive Typography */
@media (max-width: 640px) {
  html {
    font-size: 14px;
  }

  /* Mobilde araç üstüne nefes payı: H1 topbar'a ve ayarlar ipucu balonuna yapışmasın */
  .tool-container {
    padding: var(--spacing-xl) var(--spacing-sm) var(--spacing-lg);
  }

  .fixed-controls {
    bottom: var(--spacing-sm);
    right: var(--spacing-sm);
    gap: var(--spacing-xs);
  }

  .control-btn {
    width: 48px;
    height: 48px;
  }
}

/* Focus Styles */
:focus-visible {
  outline: 2px solid rgba(102, 126, 234, 0.6);
  outline-offset: 2px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
}

/* === FOOTER === */
.site-footer {
  background: rgba(10, 10, 20, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: var(--spacing-lg) var(--spacing-md);
  margin-top: auto;
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-sm) var(--spacing-lg);
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.62); /* WCAG AA kontrast (eskiden muted + opacity .7 ≈ 3:1) */
  font-size: 0.8rem;
}

/* === REKLAM BİRİMİ (araç üstü/altı) === */
/* Nötr, "Reklam" etiketli; tam ekranda gizli. ADS_ENABLED açılınca render edilir. */
.ad-unit {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.ad-unit .ad-label {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.ad-unit .adsbygoogle { display: block; }
body.fullscreen .ad-unit { display: none !important; }