/**
 * ENNU Face Chart - iPad Ultimate Optimization
 * Designed for 90% iPad usage with perfect touch interaction
 *
 * iPad Models Optimized:
 * - iPad Pro 12.9" (2732 x 2048)
 * - iPad Pro 11" (2388 x 1668)
 * - iPad Air (2360 x 1640)
 * - iPad 10.9" (2360 x 1640)
 * - iPad Mini (2266 x 1488)
 * - iPad 9.7" (2048 x 1536)
 *
 * @package ENNU_Face_Charting
 * @version 2.0.0
 */

/* ==========================================================================
   CRITICAL: iPad Viewport & Touch Configuration
   ========================================================================== */

/* Prevent iOS bounce and ensure full viewport usage */
/* REMOVED: position: fixed and overflow: hidden to allow scrolling */
/* CRITICAL: Force scrolling with !important to override any JavaScript attempts to block it */
html,
body {
  position: relative !important;
  width: 100%;
  height: auto !important;
  min-height: 100%;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: none;
  touch-action: pan-x pan-y;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

/* Main container - full iPad screen */
.ennu-face-chart-container {
  width: 100vw;
  min-height: 100vh;
  height: auto;
  height: -webkit-fill-available; /* iOS safe area */
  position: relative; /* Changed from fixed to allow scrolling */
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    sans-serif;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto; /* Allow vertical scrolling */
  user-select: none;
  -webkit-user-select: none;
}

/* ==========================================================================
   Touch-Optimized Header (Minimum 60px touch target)
   ========================================================================== */

.face-chart-header {
  background: #ffffff;
  padding: env(safe-area-inset-top, 20px) 24px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  z-index: 1000;
  min-height: 80px; /* Larger for iPad */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-logo {
  max-width: 320px;
  height: 48px;
  object-fit: contain;
  display: block;
}

.header-left h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  color: #1a1a2e;
  letter-spacing: -0.5px;
}

.patient-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 500;
}

.patient-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

/* ==========================================================================
   iPad Touch-Friendly Buttons (Minimum 44x44px Apple HIG)
   ========================================================================== */

.btn-back,
.btn-save,
.btn-complete,
.btn-canvas-action,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-add-treatment {
  min-height: 52px; /* Larger than 44px minimum */
  min-width: 120px;
  padding: 16px 32px;
  border: none;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Button press effect for touch feedback */
.btn-back:active,
.btn-save:active,
.btn-complete:active,
.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.96);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-save {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-save:hover {
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-complete {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(17, 153, 142, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(235, 51, 73, 0.3);
}

/* ==========================================================================
   Main Canvas Area - Optimized for iPad Drawing
   ========================================================================== */

.face-chart-main {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  padding: 0;
  gap: 0;
}

/* Canvas Container - Full drawing area */
.canvas-container {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  margin: 20px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* Canvas Tools - Floating toolbar */
.canvas-tools {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  display: flex;
  gap: 8px;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.tool-btn {
  width: 56px;
  height: 56px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

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

.tool-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tool-btn i {
  font-size: 24px;
}

/* Color Palette - Touch-optimized */
.color-palette {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.color-option {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-option:active {
  transform: scale(0.9);
}

.color-option.active {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

/* Brush Size Slider - Large touch target */
.brush-size-control {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  width: 320px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.brush-size-control label {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
  color: #495057;
  font-size: 16px;
}

input[type="range"] {
  width: 100%;
  height: 44px;
  -webkit-appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-track {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  cursor: pointer;
  margin-top: -12px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Main Canvas */
#face-canvas {
  flex: 1;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none; /* Critical for drawing */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
}

/* ==========================================================================
   Sidebar Panel - Slide-in for iPad
   ========================================================================== */

.sidebar-panel {
  position: fixed;
  right: -420px;
  top: 0;
  width: 420px;
  height: 100vh;
  background: #ffffff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-panel.active {
  right: 0;
}

.sidebar-header {
  padding: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.btn-close-sidebar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-close-sidebar:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.3);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px;
}

/* Sidebar Toggle Button - Floating */
.btn-toggle-sidebar {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 120px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 30px 0 0 30px;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.btn-toggle-sidebar:active {
  transform: translateY(-50%) scale(0.95);
}

.btn-toggle-sidebar.hidden {
  right: -60px;
}

/* ==========================================================================
   Treatment List - Touch-optimized scrolling
   ========================================================================== */

.treatment-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.treatment-item {
  background: #f8f9fa;
  border-radius: 16px;
  padding: 20px;
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
  min-height: 80px;
}

.treatment-item:active {
  transform: scale(0.98);
  background: #e9ecef;
}

.treatment-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.treatment-name {
  font-size: 18px;
  font-weight: 600;
  color: #212529;
}

.treatment-type-badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.treatment-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
  font-size: 16px;
  color: #6c757d;
}

.treatment-detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.treatment-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn-edit-treatment,
.btn-delete-treatment {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-edit-treatment {
  background: #e3f2fd;
  color: #1976d2;
}

.btn-delete-treatment {
  background: #ffebee;
  color: #d32f2f;
}

/* ==========================================================================
   Modal - Full screen for iPad
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: white;
  border-radius: 24px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 28px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.modal-close {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 28px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.modal-footer {
  padding: 20px 28px;
  background: #f8f9fa;
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  flex-shrink: 0;
}

/* ==========================================================================
   Form Controls - iPad Touch Optimized
   ========================================================================== */

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: #495057;
  font-size: 17px;
}

.form-control,
input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  font-size: 17px;
  background: #ffffff;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  min-height: 56px;
}

/* Ensure select dropdowns have proper styling on iPad */
select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
  padding-right: 50px;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* Checkbox and Radio - Large touch targets */
.form-check {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  min-height: 44px;
}

.form-check-input {
  width: 28px;
  height: 28px;
  margin-right: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.form-check-label {
  font-size: 17px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

/* ==========================================================================
   Treatment Product Grid - Touch-optimized
   ========================================================================== */

#treatment-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  padding: 20px 0;
  max-height: 400px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.product-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-height: 180px;
}

.product-card:active {
  transform: scale(0.95);
  background: #e9ecef;
}

.product-card.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.product-card img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 12px;
  border-radius: 8px;
}

.product-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: #28a745;
}

.product-card.selected .product-price {
  color: white;
}

/* ==========================================================================
   Loading States & Animations
   ========================================================================== */

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 40px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

/* ==========================================================================
   Notifications - iPad positioned
   ========================================================================== */

.notification {
  position: fixed;
  top: 100px;
  right: 20px;
  background: white;
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 320px;
  max-width: 480px;
  z-index: 4000;
  animation: notificationSlideIn 0.3s ease;
}

@keyframes notificationSlideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification.success {
  border-left: 6px solid #28a745;
}

.notification.error {
  border-left: 6px solid #dc3545;
}

.notification.warning {
  border-left: 6px solid #ffc107;
}

.notification-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.notification-message {
  flex: 1;
  font-size: 17px;
  line-height: 1.4;
}

.notification-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f8f9fa;
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==========================================================================
   iPad Landscape Optimizations
   ========================================================================== */

@media only screen and (orientation: landscape) and (min-device-width: 768px) {
  .face-chart-main {
    flex-direction: row;
  }

  .canvas-container {
    flex: 2;
  }

  .sidebar-panel {
    position: relative;
    right: 0;
    width: 480px;
    height: 100%;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.1);
  }

  .btn-toggle-sidebar {
    display: none;
  }

  .treatment-list {
    padding-right: 12px;
  }
}

/* ==========================================================================
   iPad Portrait Optimizations
   ========================================================================== */

@media only screen and (orientation: portrait) and (min-device-width: 768px) {
  .canvas-container {
    margin: 12px;
  }

  .sidebar-panel {
    width: 80%;
    max-width: 600px;
  }

  #treatment-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* ==========================================================================
   iPad Pro 12.9" Specific
   ========================================================================== */

@media only screen and (min-device-width: 1024px) and (max-device-width: 1366px) and (min-device-height: 1366px) and (max-device-height: 1024px) and (orientation: landscape) {
  .face-chart-header {
    padding: 24px 32px;
    min-height: 88px;
  }

  .header-left h1 {
    font-size: 32px;
  }

  .btn-primary,
  .btn-save,
  .btn-complete {
    min-height: 60px;
    padding: 18px 40px;
    font-size: 19px;
  }

  .modal-content {
    max-width: 1000px;
  }

  #treatment-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* ==========================================================================
   Touch Gesture Support
   ========================================================================== */

/* Swipe to close sidebar */
.sidebar-panel {
  touch-action: pan-x;
}

/* Pinch to zoom canvas */
.canvas-wrapper {
  touch-action: pinch-zoom;
}

/* Prevent accidental selection */
* {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Allow text selection in forms */
input,
textarea,
[contenteditable] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* ==========================================================================
   Performance Optimizations
   ========================================================================== */

/* Use GPU acceleration */
.sidebar-panel,
.modal-overlay,
.modal-content,
.btn-primary,
.btn-save,
.btn-complete,
.notification {
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Optimize scrolling */
.sidebar-content,
.modal-body,
#treatment-products-grid {
  -webkit-overflow-scrolling: touch;
  overflow-y: scroll;
  transform: translateZ(0);
}

/* ==========================================================================
   Hide Desktop Elements on iPad
   ========================================================================== */

/* Hide hover effects on touch devices */
@media (hover: none) {
  .btn-primary:hover,
  .btn-save:hover,
  .btn-complete:hover,
  .product-card:hover,
  .treatment-item:hover {
    transform: none;
  }
}

/* Hide scrollbars on iPad but keep functionality */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

/* ==========================================================================
   Accessibility for Touch
   ========================================================================== */

/* Focus styles for keyboard navigation (external keyboards) */
*:focus-visible {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

/* Skip links for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px;
  z-index: 5000;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ==========================================================================
   Print Styles - Optimize for AirPrint
   ========================================================================== */

@media print {
  .face-chart-header,
  .sidebar-panel,
  .btn-toggle-sidebar,
  .canvas-tools,
  .color-palette,
  .brush-size-control {
    display: none !important;
  }

  .canvas-container {
    margin: 0;
    box-shadow: none;
    border-radius: 0;
  }

  #face-canvas {
    width: 100%;
    height: auto;
  }
}

/* ==========================================================================
   PWA Support for iPad Home Screen
   ========================================================================== */

/* Standalone mode (when added to home screen) */
@media (display-mode: standalone) {
  .face-chart-header {
    padding-top: env(safe-area-inset-top, 20px);
  }

  .face-chart-container {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
}

/* Status bar styling for PWA */
@supports (padding: env(safe-area-inset-top)) {
  .face-chart-container {
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
  }
}
