/**
 * Mobile Plaza App - Native Touch & UI Stylesheet
 */

:root {
  --app-primary: #2563eb;
  --app-primary-dark: #1d4ed8;
  --app-bg: #f8fafc;
  --app-card: #ffffff;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--app-bg);
  color: #1e293b;
  margin: 0;
  padding: 0;
  padding-bottom: calc(72px + var(--safe-bottom));
  overscroll-behavior-y: contain;
  user-select: none;
}

/* Allow text selection in inputs and descriptions */
input, textarea, .selectable-text {
  user-select: text;
}

/* Safe Area Insets for Notch / Navigation Bar */
.safe-top-padding {
  padding-top: calc(12px + var(--safe-top));
}

.safe-bottom-padding {
  padding-bottom: calc(16px + var(--safe-bottom));
}

/* Bottom Navigation Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(64px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.05);
}

.nav-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  gap: 3px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-tab-btn i {
  font-size: 18px;
  transition: transform 0.2s ease;
}

.nav-tab-btn.active {
  color: var(--app-primary);
}

.nav-tab-btn.active i {
  transform: translateY(-2px);
}

.nav-tab-btn:active {
  transform: scale(0.92);
}

/* Center Highlight Tab (Add Phone) */
.nav-tab-btn.center-action {
  position: relative;
}

.nav-tab-btn.center-action .center-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  margin-top: -18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-tab-btn.center-action:active .center-icon-wrap {
  transform: scale(0.9);
}

.nav-tab-btn.center-action.active .center-icon-wrap {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

/* Horizontal Chip Scroller */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Phone Cards */
.phone-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  will-change: transform;
}

.phone-card:active {
  transform: scale(0.98);
}

/* Modal Bottom Sheet */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.bottom-sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet-content {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 90vh;
  background: #ffffff;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  z-index: 61;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
  padding-bottom: calc(24px + var(--safe-bottom));
}

.bottom-sheet-overlay.open .bottom-sheet-content {
  transform: translateY(0);
}

.sheet-handle-bar {
  width: 40px;
  height: 5px;
  background-color: #cbd5e1;
  border-radius: 999px;
  margin: 12px auto 8px auto;
}

/* Gallery Carousel */
.gallery-scroll {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.gallery-item {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

/* Shimmer Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Image preview thumbnails */
.image-preview-thumb {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.image-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-thumb .remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border: none;
  cursor: pointer;
}
