/* Additional custom styles not covered by Tailwind */

/* iOS Safari viewport fix - prevent bottom nav from lifting during scroll */
html {
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height - adapts to iOS Safari toolbar */
  overflow: hidden;
  padding: 0; /* Prevent safe-area insets from adding padding */
  margin: 0;
}

body {
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height */
  overflow: hidden;
  overscroll-behavior: contain; /* Prevent bounce-scroll that can cause nav shift */
  margin: 0;
  padding: 0;
}

/* Hide all scrollbars but keep scrolling */
html, body, main {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

::-webkit-scrollbar {
  display: none;  /* Chrome, Safari, Opera */
}

/* Smooth transitions */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Page Loader - Simple Grey "Chirp" Text */
#chirp-text {
  color: #E1E8ED;
}

/* Audio waveform placeholder */
.waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 40px;
}

.waveform-bar {
  width: 3px;
  background: #1DA1F2;
  border-radius: 2px;
  transition: height 0.1s ease;
}

/* Recording animation */
@keyframes pulse-red {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.recording-indicator {
  animation: pulse-red 1.5s ease-in-out infinite;
}

/* Loader spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  width: 32px;
  height: 32px;
  display: inline-block;
  position: relative;
}

.spinner.hidden {
  display: none;
}

.spinner::before {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid #E1E8ED;
  border-top-color: #1DA1F2;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: block;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 20px;
  border-radius: 8px;
  background-color: white;
  color: #14171a;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  z-index: 1000;
  animation: slideUp 0.3s ease;
  text-align: center;
  max-width: calc(100% - 32px); /* Full width with 16px margin on each side on mobile */
  width: calc(100% - 32px); /* Fill available space on mobile */
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-left: 4px solid;
}

/* Desktop: keep toasts compact */
@media (min-width: 768px) {
  .toast {
    max-width: 400px;
    width: auto; /* Auto width on desktop - only as wide as content */
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.toast-success {
  border-left-color: #17BF63;
}

.toast-error {
  border-left-color: #E1245E;
}

.toast-info {
  border-left-color: #1DA1F2;
}

/* Mobile bottom nav - always fixed to bottom */
.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform; /* Hint for smoother transitions on iOS Safari */
}

/* Safari safe-area support for bottom nav */
@supports (padding: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Mobile sidebar transitions - removed conflicting opacity rules */

/* Equalizer animation */
@keyframes eq-bounce {
  0%, 100% {
    height: 30%;
  }
  50% {
    height: 100%;
  }
}

.eq-bar {
  min-height: 2px;
}

/* Lighter weight for play/pause and volume buttons */
.play-btn .material-symbols-outlined,
.volume-btn .material-symbols-outlined {
  font-size: 35px;
  font-variation-settings: 'opsz' 35, 'FILL' 0, 'wght' 300, 'GRAD' 0;
}

/* ========================================================================
   MOBILE LAYOUT SYSTEM - CSS Custom Properties
   ======================================================================== */

:root {
  /* Mobile Chrome Dimensions */
  --mobile-header-height: 3.5rem;        /* 56px - Fixed top header */
  --mobile-nav-height: 3.5rem;           /* 56px - Fixed bottom nav */

  /* Scrollable Content Padding Variants */
  --mobile-scroll-padding-fab: 10rem;    /* 160px - With integrated FAB (56px nav + FAB visual footprint + card padding + breathing room) */
  --mobile-scroll-padding-nav: 4rem;     /* 64px - Nav only (no FAB) */

  /* Z-Index Hierarchy (documentation only - use Tailwind classes) */
  --z-fixed-chrome: 40;      /* Fixed header/modals/dropdowns */
  --z-fixed-footer: 30;      /* Bottom nav/FAB/Fixed toolbars */
  --z-sticky-content: 20;    /* Sticky headers within scroll */
  --z-content-below: 10;     /* Content intentionally below sticky */
}

/* ========================================================================
   MOBILE LAYOUT SYSTEM - Utility Classes
   ======================================================================== */

/* Mobile Scrollable Content - Standard (with FAB) */
@media (max-width: 1023px) {
  .mobile-scroll-fab {
    padding-bottom: var(--mobile-scroll-padding-fab);
  }
}

@media (min-width: 1024px) {
  .mobile-scroll-fab {
    padding-bottom: 1rem; /* Desktop fallback */
  }
}

/* Mobile Scrollable Content - Nav Only (no FAB) */
@media (max-width: 1023px) {
  .mobile-scroll-nav {
    padding-bottom: var(--mobile-scroll-padding-nav);
  }
}

@media (min-width: 1024px) {
  .mobile-scroll-nav {
    padding-bottom: 1rem;
  }
}

/* Mobile Sticky Footer - For elements that stick at bottom of scroll area */
@media (max-width: 1023px) {
  .mobile-sticky-footer {
    position: sticky;
    bottom: 0;
    z-index: 20; /* Same as sticky headers */
    background: white;
    border-top: 1px solid rgb(239, 243, 244); /* twitter-extra-light-gray */
  }
}

/* ========================================================================
   DELETED/MODERATED CHIRP PLACEHOLDER
   ======================================================================== */

/* Placeholder container for deleted/moderated chirps */
.chirp-placeholder {
  padding: 0.75rem 1rem;
}

.chirp-placeholder-content {
  background: rgb(247, 249, 249); /* gray-50 equivalent */
  border: 1px solid rgb(239, 243, 244); /* twitter-extra-light-gray */
  border-radius: 0.5rem;
  padding: 1rem;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Larger placeholder for chirp detail page */
.chirp-placeholder-large {
  padding: 2rem;
  text-align: center;
}
