﻿/* Mobile Specialized Styles for Bingo 75 Pro */

/* Safe area support for iOS Notch / Dynamic Island */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

html, body {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

/* Install PWA Toast Banner */
#pwa-install-banner {
  display: none;
  position: fixed;
  top: 12px;
  left: 16px;
  right: 16px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid #3b82f6;
  border-radius: 14px;
  padding: 12px 16px;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  animation: slideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.pwa-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pwa-banner-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pwa-banner-icon {
  font-size: 26px;
}

.pwa-banner-text {
  display: flex;
  flex-direction: column;
}

.pwa-banner-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.pwa-banner-subtitle {
  font-size: 11px;
  color: #94a3b8;
}

.pwa-banner-actions {
  display: flex;
  gap: 8px;
}

.btn-pwa-install {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-pwa-close {
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 18px;
  padding: 4px;
  cursor: pointer;
}

/* Mobile Bottom Navigation Bar (visible only on <= 768px) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  padding: 6px 10px calc(6px + var(--sab)) 10px;
  z-index: 500;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
}

.bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 500px;
  margin: 0 auto;
  gap: 4px;
}

.bottom-nav-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.bottom-nav-btn .b-icon {
  font-size: 20px;
  line-height: 1;
}

.bottom-nav-btn.active {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
}

.bottom-nav-btn.active .b-icon {
  transform: translateY(-2px);
  filter: drop-shadow(0 2px 6px rgba(59, 130, 246, 0.6));
}

/* Responsive Breakpoints for Mobile Phones */
@media (max-width: 768px) {
  /* Hide desktop header nav tabs */
  .app-header .nav-tabs {
    display: none !important;
  }

  /* Show mobile bottom nav */
  .mobile-bottom-nav {
    display: block !important;
  }

  /* Header compact */
  .app-header {
    padding-top: var(--sat);
  }

  .header-inner {
    padding: 8px 16px;
  }

  .brand-title {
    font-size: 17px;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  /* Give space at bottom for mobile bottom nav */
  .main-content {
    padding: 14px 12px calc(80px + var(--sab)) 12px;
  }

  /* Caller View on Mobile */
  .caller-layout {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .ball-display-card {
    padding: 20px 16px;
  }

  .ball-sphere-stage {
    width: 160px;
    height: 160px;
    margin-bottom: 16px;
  }

  .ball-inner {
    width: 140px;
    height: 140px;
  }

  .ball-letter {
    font-size: 26px;
  }

  .ball-number {
    font-size: 52px;
  }

  .btn-draw-main {
    padding: 14px 20px;
    font-size: 17px;
  }

  /* Master Board on Mobile */
  .master-board-card {
    padding: 16px 12px;
  }

  .board-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .board-stats {
    width: 100%;
    justify-content: space-between;
  }

  .board-row {
    grid-template-columns: 36px 1fr;
    gap: 8px;
    padding: 6px 8px;
  }

  .board-row-header {
    font-size: 20px;
  }

  .board-numbers-group {
    grid-template-columns: repeat(8, 1fr) !important;
    gap: 4px;
  }

  .board-cell {
    font-size: 12px;
    border-radius: 6px;
  }

  /* Virtual Player Card on Mobile */
  .player-layout {
    width: 100%;
    max-width: 100%;
  }

  .player-card-box {
    padding: 10px;
    border-radius: 16px;
  }

  .player-grid-header {
    font-size: 20px;
    margin-bottom: 6px;
  }

  .p-head {
    padding: 6px 0;
  }

  .player-grid-body {
    gap: 6px;
  }

  .player-row {
    gap: 6px;
  }

  .player-cell {
    font-size: 19px;
    border-radius: 8px;
  }

  .player-cell:active {
    transform: scale(0.95);
  }

  /* Printable Studio preview scrollable on mobile */
  .preview-wrapper {
    padding: 12px;
  }

  .print-page {
    margin: 0 auto 20px auto;
    max-width: 100%;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  }

  /* Form controls touch sizing */
  .form-input, .form-select, .btn-gen, .btn-print, .btn-auto {
    min-height: 44px;
  }
}