/* PWA Specific Styles for TimeGuardian */

/* ============================
   OFFLINE STATES
   ============================ */

/* Offline state styling removed - only small badge indicator used */

/* Timer starting optimistic feedback */
.timer-starting {
  transform: scale(0.98);
  opacity: 0.7;
  transition: all 0.2s ease;
}

.timer-starting::before {
  content: "⏳";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  z-index: 10;
  animation: pulse 1s infinite;
}

/* ============================
   PWA INSTALL ELEMENTS
   ============================ */

.pwa-install-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem;
  color: white;
  text-align: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.pwa-install-button {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  color: white;
  font-weight: 500;
  transition: all 0.2s ease;
}

.pwa-install-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* ============================
   STANDALONE MODE
   ============================ */

@media (display-mode: standalone) {
  /* Hide browser-specific elements when installed as PWA */
  .browser-only {
    display: none !important;
  }
  
  /* Add safe areas for mobile devices */
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  
  /* Adjust header for standalone mode */
  .app-header {
    background: #3B82F6;
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 40;
  }
}

/* ============================
   SYNC INDICATORS
   ============================ */

.sync-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #3B82F6;
  color: white;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  animation: slideDown 0.3s ease;
}

.sync-indicator.error {
  background: #EF4444;
}

.sync-indicator.success {
  background: #10B981;
}

.sync-indicator.warning {
  background: #F59E0B;
}

/* ============================
   OFFLINE QUEUE VISUAL
   ============================ */

.offline-queue-badge {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  background: #F59E0B;
  color: white;
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  animation: bounce 1s infinite;
}

/* ============================
   TOUCH OPTIMIZATIONS
   ============================ */

@media (hover: none) and (pointer: coarse) {
  /* Touch-friendly button sizes */
  .timer-button {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Larger tap targets for mobile */
  .category-card {
    padding: 1.5rem;
  }
  
  /* Remove hover effects on touch devices */
  .timer-card:hover {
    transform: none;
  }
}

/* ============================
   ANIMATIONS
   ============================ */

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translateY(0);
  }
  40%, 43% {
    transform: translateY(-30px);
  }
  70% {
    transform: translateY(-15px);
  }
  90% {
    transform: translateY(-4px);
  }
}

/* ============================
   ACCESSIBILITY
   ============================ */

@media (prefers-reduced-motion: reduce) {
  .timer-starting,
  .sync-indicator,
  .offline-queue-badge {
    animation: none;
  }
  
  .timer-starting {
    transition: none;
  }
}

/* ============================
   DARK MODE SUPPORT
   ============================ */

@media (prefers-color-scheme: dark) {
  .pwa-install-banner {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  }
  
  .sync-indicator {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  }
}

/* ============================
   PORTRAIT ORIENTATION
   ============================ */

@media (orientation: portrait) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.125rem; /* Minimal gap for portrait */
  }
}

/* ============================
   LANDSCAPE ORIENTATION
   ============================ */

@media (orientation: landscape) and (max-height: 600px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem; /* Slightly larger gap for landscape */
  }
  
  .timer-display {
    font-size: 2rem;
  }
} 