/* ========================================================================
   PEOPLE'S PERCEPTION - CONSOLIDATED STYLESHEET
   Version: 1.9.26 - January 9, 2026
   Combines: brand.css, mobile.css, ios-mobile-fixes.css, dashboard_nav.css
   ======================================================================== */

/* ========== CSS VARIABLES ========== */
:root {
  /* Brand palette */
  --pp-primary: #4377d1;
  --pp-secondary: #7a94cf;
  --pp-accent: #3b68b6;
  --pp-orange: #f59e0b;
  --pp-orange-dark: #d97706;
  --pp-on-primary: #ffffff;

  --pp-bg: #f7f9fc;
  --pp-surface: #ffffff;
  --pp-text: #244758;
  --pp-text-muted: #637189;
  --pp-text-light: #5f676e;
  --pp-heading: #244758;
  --pp-border: #e5e7eb;

  --pp-success: #22c55e;
  --pp-warning: #f59e0b;
  --pp-error: #ef4444;

  /* Rounded + shadows */
  --pp-radius-sm: 6px;
  --pp-radius-md: 10px;
  --pp-radius-lg: 14px;
  --pp-shadow-sm: 0 2px 6px rgba(0,0,0,0.08);
  --pp-shadow-md: 0 6px 18px rgba(0,0,0,0.12);
  --pp-shadow-lg: 0 12px 32px rgba(0,0,0,0.16);

  /* Vuetify theme bridge */
  --v-theme-primary: var(--pp-primary);
  --v-theme-on-primary: var(--pp-on-primary);
}

/* ========== BASE RESET & GLOBAL STYLES ========== */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  height: -webkit-fill-available;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--pp-text);
  background: var(--pp-bg);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
  color: var(--pp-heading);
  margin: 0 0 8px;
  line-height: 1.3;
  font-weight: 600;
}

h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

p {
  color: var(--pp-text-muted);
  margin: 0 0 10px;
  line-height: 1.5;
}

/* ========== CONTAINERS ========== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
  min-height: -webkit-fill-available;
}

/* ========== CARDS & SURFACES ========== */
.card, .auth-section, .evaluation-section, .questionnaire-card, .report-card {
  background: var(--pp-surface);
  padding: 20px;
  border-radius: var(--pp-radius-md);
  box-shadow: var(--pp-shadow-sm);
  width: 100%;
  overflow: hidden;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.questionnaire-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.questionnaire-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--pp-shadow-md);
}

/* ========== HEADER & NAVIGATION ========== */
.modern-header {
  background: #ffffff;
  padding: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid #e8ecf0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #f8faff;
  border: 1px solid #e8ecf0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: contain;
}

.brand-text {
  color: var(--pp-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  color: var(--pp-text-light);
  text-decoration: none;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link:hover {
  color: var(--pp-primary);
  background: #f8faff;
  transform: translateY(-1px);
}

.nav-link.active {
  color: var(--pp-primary);
  background: #e8f4fd;
  font-weight: 600;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  color: var(--pp-text-light);
}

/* ========== BUTTONS ========== */
.btn, button:not(.mobile-menu-btn):not(.uniform-btn), .button, input[type="submit"], input[type="button"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: var(--pp-primary);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: var(--pp-radius-md);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(58, 102, 179, 0.1);
}

.btn:hover, button:not(.mobile-menu-btn):not(.uniform-btn):hover {
  background: var(--pp-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn:active, button:not(.mobile-menu-btn):not(.uniform-btn):active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--pp-text-muted);
}

.btn-cta {
  background: linear-gradient(135deg, var(--pp-orange) 0%, var(--pp-orange-dark) 100%);
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-cta:hover {
  background: linear-gradient(135deg, var(--pp-orange-dark) 0%, #b45309 100%);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(217, 119, 6, 0.6);
}

/* ========== ORANGE ACTION BUTTONS - SITE-WIDE ========== */
.action-btn-orange,
.btn-action-orange,
button.action-btn-orange {
  background: #ff6b35 !important;
  color: white !important;
  border: none !important;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.action-btn-orange:hover,
.btn-action-orange:hover,
button.action-btn-orange:hover {
  background: #e55a2b !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.action-btn-green,
.btn-action-green,
button.action-btn-green {
  background: #22c55e !important;
  color: white !important;
  border: none !important;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.action-btn-green:hover,
.btn-action-green:hover,
button.action-btn-green:hover {
  background: #16a34a !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* ========== SEARCH CARD BUTTONS - WHITE BACKGROUND ========== */
button.uniform-btn,
.uniform-btn,
div button.uniform-btn,
[class*="card"] button.uniform-btn,
.search-grid button.uniform-btn {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #6c757d !important;
  border: 1px solid #e8ecf0 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 10px 8px !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  font-size: 0.75rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  min-height: auto !important;
  min-width: auto !important;
}

button.uniform-btn:hover,
.uniform-btn:hover,
div button.uniform-btn:hover,
[class*="card"] button.uniform-btn:hover {
  background: #f8faff !important;
  background-color: #f8faff !important;
  color: #3a66b3 !important;
  border-color: #3a66b3 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.btn-success { background: var(--pp-success); }
.btn-warning { background: var(--pp-warning); }
.btn-error { background: var(--pp-error); }

.logout-btn {
  color: var(--pp-text-light);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid #e8ecf0;
  background: #ffffff;
}

.logout-btn:hover {
  color: var(--pp-primary);
  background: #f8faff;
  border-color: var(--pp-primary);
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--pp-text);
  font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
select,
textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--pp-border);
  border-radius: var(--pp-radius-sm);
  font-size: 16px; /* Prevents iOS zoom */
  background: #ffffff;
  color: var(--pp-text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--pp-primary);
  box-shadow: 0 0 0 3px rgba(58,102,179,0.15), 0 2px 6px rgba(0,0,0,0.15);
  outline: none;
}

/* ========== MODALS & POPUPS - CRITICAL MOBILE FIXES ========== */
.modal-overlay, .modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: -webkit-fill-available !important;
  background: rgba(0, 0, 0, 0.75) !important;
  z-index: 10000 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
}

.modal, .popup, .modal-content, .modal-container {
  position: relative !important;
  background: white !important;
  border-radius: 20px !important;
  width: 100% !important;
  max-width: 500px !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 24px !important;
  margin: auto !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3) !important;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Close button - ALWAYS VISIBLE */
.close-btn, .modal-close, [class*="close"] {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 50% !important;
  background: rgba(0, 0, 0, 0.1) !important;
  border: 2px solid rgba(0, 0, 0, 0.2) !important;
  color: #333 !important;
  font-size: 24px !important;
  font-weight: bold !important;
  cursor: pointer !important;
  z-index: 10001 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  transition: all 0.2s ease !important;
}

.close-btn:hover, .modal-close:hover {
  background: rgba(0, 0, 0, 0.2) !important;
  transform: scale(1.1) !important;
}

/* Prevent body scroll when modal open */
body.modal-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
}

/* ========== HERO PROFILE SECTION ========== */
.hero-profile {
  background: white;
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: stretch;
}

.profile-container {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 280px;
}

.avatar-wrapper {
  position: relative;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #e8ecf0;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  margin: 0 auto;
}

/* Level Badge - Green Design */
.level-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  border-radius: 10px;
  padding: 6px 10px;
  min-width: 44px;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.level-badge .level-text {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1px;
  opacity: 0.9;
  text-transform: uppercase;
}

.level-badge .level-number {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
}

.profile-image {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 125%;
  height: 125%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  object-position: center;
}

.welcome-pane {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 280px;
}

.user-name {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 20px 0;
  color: var(--pp-heading);
  line-height: 1.2;
}

.main-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: auto;
}

.main-action-btn {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 12px 16px;
  color: #495057;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.main-action-btn:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* ========== RANKING & STATS CARDS ========== */
.ranking-card, .suggestions-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ranking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 2px solid #e8ecf0;
  margin-bottom: 16px;
}

.rank-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pp-heading);
}

.rank-title .trophy-icon {
  font-size: 1.3rem;
}

.rank-right {
  display: flex;
  align-items: center;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--pp-text-light);
  font-weight: 600;
}

.score-number {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  color: var(--pp-primary);
}

.ranking-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: center;
}

.stat {
  padding: 12px;
  border-radius: 12px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
  color: var(--pp-heading);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--pp-text-light);
  line-height: 1.2;
}

/* ========== SEARCH RESULTS ========== */
.results-grid, .search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.person-card, .person-item {
  width: 100%;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.person-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* ========== IMAGES ========== */
img, video, iframe {
  max-width: 100%;
  height: auto;
}

.profile-image, .person-avatar, .avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ========== UTILITY CLASSES ========== */
.text-center { text-align: center; }
.text-muted { color: var(--pp-text-muted); }
.hidden { display: none; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mb-4 { margin-bottom: 16px; }
.cursor-pointer { cursor: pointer; }

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

.anim-fade-up { animation: fadeUp .5s cubic-bezier(.2,.8,.2,1) both; }
.anim-fade-in { animation: fadeIn .5s ease both; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== TABLET STYLES (768px and below) ========== */
@media (max-width: 768px) {
  /* Container */
  .container {
    padding: 15px;
    max-width: 100%;
  }
  
  /* Typography */
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }
  h4 { font-size: 1rem; }
  
  /* Navigation */
  .mobile-menu-btn {
    display: block;
  }
  
  .nav-links {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: white;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    transition: left 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 999;
    padding: 20px 0;
  }
  
  .nav-links.active {
    left: 0;
  }
  
  .nav-link {
    padding: 16px 20px;
    border-radius: 0;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .header-container {
    padding: 12px 20px;
  }
  
  .brand-text {
    font-size: 1.2rem;
  }
  
  /* Hero Profile */
  .hero-profile {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
  }
  
  .profile-container {
    flex-direction: row;
    gap: 16px;
    text-align: left;
    min-height: auto;
  }
  
  .avatar-wrapper {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
  }
  
  .user-name {
    font-size: 1.5rem;
  }
  
  .main-actions {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* Stats */
  .ranking-stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* Search Results */
  .results-grid, .search-results {
    grid-template-columns: 1fr;
  }
  
  /* Cards */
  .card, .panel, .report-card {
    padding: 15px;
    margin-bottom: 15px;
  }
  
  /* Grids */
  .grid, .reports-grid, .stats-grid, .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  /* Modal fixes for tablet/mobile */
  .modal, .popup, .modal-content {
    width: 95% !important;
    max-width: 95% !important;
    max-height: 90vh !important;
    padding: 20px !important;
    margin: auto !important;
    border-radius: 16px !important;
  }
  
  .modal-overlay {
    padding: 10px !important;
  }
  
  /* Utility classes */
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }
  .mobile-center { text-align: center !important; }
}

/* ========== SMALL MOBILE (480px and below) ========== */
@media (max-width: 480px) {
  .container {
    padding: 10px;
  }
  
  h1 { font-size: 1.25rem; }
  h2 { font-size: 1.1rem; }
  h3 { font-size: 1rem; }
  h4 { font-size: 0.9rem; }
  
  .btn, button:not(.mobile-menu-btn) {
    padding: 10px 15px;
    font-size: 0.9rem;
  }
  
  .card, .panel, .report-card {
    padding: 12px;
  }
  
  .avatar-wrapper {
    width: 80px;
    height: 80px;
  }
  
  .user-name {
    font-size: 1.3rem;
  }
  
  .hide-mobile {
    display: none !important;
  }
}

/* ========== iOS SAFARI SPECIFIC FIXES ========== */
@supports (-webkit-touch-callout: none) {
  /* iOS Safari specific */
  .modal, .popup {
    position: fixed !important;
    top: 10px !important;
    left: 10px !important;
    right: 10px !important;
    bottom: auto !important;
    width: auto !important;
    max-height: calc(100vh - 20px) !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .modal-content {
    max-height: calc(100vh - 100px) !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .container {
    min-height: -webkit-fill-available;
  }
  
  /* Fix iOS Safari bottom padding for notch */
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ========== iPhone Specific (Retina) ========== */
@media screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2) {
  .modal, .popup {
    position: fixed !important;
    top: 5% !important;
    left: 5% !important;
    right: 5% !important;
    bottom: auto !important;
    width: 90% !important;
    max-height: 90vh !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
  }
  
  .modal-content {
    padding: 15px !important;
    max-height: 80vh !important;
  }
}

/* ========== THANK YOU POPUP FIXES ========== */
#thankYouOverlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  background: rgba(0, 0, 0, 0.75) !important;
  z-index: 10000 !important;
}

#thankYouOverlay > div {
  width: 95% !important;
  max-width: 500px !important;
  max-height: 90vh !important;
  padding: 24px !important;
  margin: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  background: white !important;
  border-radius: 20px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3) !important;
}

@supports (-webkit-touch-callout: none) {
  #thankYouOverlay {
    height: 100vh !important;
    height: -webkit-fill-available !important;
  }
  
  #thankYouOverlay > div {
    max-height: calc(100vh - 40px) !important;
    max-height: calc(-webkit-fill-available - 40px) !important;
  }
}

/* ========== RECEIPT MODAL FIXES ========== */
.receipt-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  z-index: 10000 !important;
}

.receipt-modal-content {
  margin: 20px auto !important;
  max-width: 500px !important;
  max-height: calc(100vh - 40px) !important;
  overflow-y: auto !important;
  border-radius: 16px !important;
  background: white !important;
  padding: 24px !important;
}

/* ========== PHOTO GALLERY MODAL ========== */
.photo-gallery-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0,0,0,0.9) !important;
  z-index: 10000 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

@media (max-width: 768px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== LANDSCAPE ORIENTATION ========== */
@media (max-width: 768px) and (orientation: landscape) {
  .modal, .popup, .modal-content {
    max-height: 80vh !important;
  }
  
  .hero-profile {
    padding: 12px;
  }
}

/* ========== ACCESSIBILITY ========== */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--pp-primary);
  outline-offset: 2px;
}

/* Scrollable areas */
.scrollable, [style*="overflow-y: auto"], [style*="overflow: auto"] {
  -webkit-overflow-scrolling: touch;
}

/* ========== PRINT STYLES ========== */
@media print {
  .modal-overlay, .close-btn, button, .nav-links, .mobile-menu-btn {
    display: none !important;
  }
  
  body {
    background: white;
  }
}

/* ========== HARDWARE ACCELERATION ========== */
.card, .btn, .modal-overlay, .modal-content, .main-action-btn {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* ========================================================================
   COMPREHENSIVE MOBILE RESPONSIVE STYLES
   Supports: Android, iOS, Samsung, Tablets, All Browsers
   Breakpoints: 1200px, 992px, 768px, 576px, 480px, 375px, 320px
   ======================================================================== */

/* ========== FIRE AREA RESPONSIVE ========== */
@media (max-width: 992px) {
  #heroBackground {
    flex-direction: column !important;
    align-items: center !important;
    padding: 20px !important;
    gap: 20px !important;
    min-height: auto !important;
  }
  
  .fire-profile-section {
    min-width: 100% !important;
    width: 100% !important;
  }
  
  #overallRatingPanel {
    min-width: 100% !important;
    width: 100% !important;
    max-width: 400px !important;
  }
  
  #quickFactsSection {
    padding: 15px !important;
  }
  
  .quick-facts-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
}

@media (max-width: 768px) {
  #heroBackground {
    padding: 15px !important;
    gap: 15px !important;
  }
  
  #personPhoto {
    width: 100px !important;
    height: 100px !important;
    min-width: 100px !important;
    min-height: 100px !important;
  }
  
  #personName {
    font-size: 1.5rem !important;
  }
  
  #personLocation {
    font-size: 0.9rem !important;
  }
  
  #overallRatingPanel {
    padding: 15px !important;
  }
  
  #overallRatingPanel > div:last-child {
    flex-wrap: wrap !important;
    gap: 10px !important;
    justify-content: center !important;
  }
  
  #personStats {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
  }
  
  #personStats > span {
    font-size: 0.8rem !important;
    padding: 6px 10px !important;
  }
  
  .quick-facts-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 576px) {
  #heroBackground {
    padding: 12px !important;
  }
  
  #personPhoto {
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    min-height: 80px !important;
  }
  
  #personName {
    font-size: 1.3rem !important;
  }
  
  #overallRatingPanel {
    padding: 12px !important;
  }
  
  #overallRatingPanel svg {
    width: 90px !important;
    height: 90px !important;
  }
  
  #overallRatingValue {
    font-size: 1.5rem !important;
  }
  
  #overallRatingLabel {
    padding: 6px 12px !important;
    font-size: 0.75rem !important;
  }
  
  .quick-facts-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  
  .quick-fact-item {
    padding: 10px !important;
  }
}

@media (max-width: 375px) {
  #heroBackground {
    padding: 10px !important;
  }
  
  #personPhoto {
    width: 70px !important;
    height: 70px !important;
    min-width: 70px !important;
    min-height: 70px !important;
  }
  
  #personName {
    font-size: 1.15rem !important;
  }
  
  #overallRatingPanel svg {
    width: 80px !important;
    height: 80px !important;
  }
  
  #personStats > span {
    font-size: 0.7rem !important;
    padding: 5px 8px !important;
  }
}

/* ========== PLACE FIRE AREA RESPONSIVE ========== */
@media (max-width: 768px) {
  .place-hero {
    border-radius: 16px !important;
  }
  
  .place-hero-inner {
    padding: 15px !important;
  }
  
  .place-hero-title {
    font-size: 1.5rem !important;
  }
  
  .place-hero-image {
    width: 100px !important;
    height: 100px !important;
  }
  
  .place-rating-card {
    max-width: 100% !important;
  }
  
  .place-hero-kpis {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
  
  .place-kpi {
    padding: 8px !important;
  }
  
  .place-kpi .value {
    font-size: 1.1rem !important;
  }
}

@media (max-width: 576px) {
  .place-hero-inner {
    padding: 12px !important;
  }
  
  .place-hero-title {
    font-size: 1.3rem !important;
  }
  
  .place-hero-image {
    width: 80px !important;
    height: 80px !important;
  }
  
  .place-hero-kpis {
    grid-template-columns: 1fr 1fr 1fr !important;
  }
  
  .place-kpi .label {
    font-size: 0.6rem !important;
  }
  
  .place-kpi .value {
    font-size: 1rem !important;
  }
}

/* ========== RATING SCALE CAROUSEL RESPONSIVE ========== */
@media (max-width: 768px) {
  #scaleCarousel {
    height: 100px !important;
  }
  
  #scaleTrack .scale-card {
    min-width: 140px !important;
    max-width: 140px !important;
  }
  
  .ranking-card {
    padding: 10px !important;
  }
}

@media (max-width: 480px) {
  #scaleCarousel {
    height: 90px !important;
  }
  
  #scaleTrack .scale-card {
    min-width: 120px !important;
    max-width: 120px !important;
    padding: 8px 10px !important;
  }
  
  #scaleTrack .scale-card[style*="min-width: 180px"] {
    min-width: 130px !important;
    height: 85px !important;
  }
}

/* ========== DASHBOARD GAUGE RESPONSIVE ========== */
@media (max-width: 768px) {
  /* Single gauge container */
  #singleGaugeContainer {
    padding: 15px 10px !important;
  }
  
  #singleGaugeContainer > div {
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  #singleGaugeContainer svg {
    width: 160px !important;
    height: 160px !important;
  }
  
  #overallScore {
    font-size: 2.2rem !important;
  }
  
  /* Dual gauge container */
  #dualGaugeContainer {
    padding: 15px 10px !important;
  }
  
  #dualGaugeContainer > div[style*="display: flex"][style*="gap: 30px"] {
    flex-direction: column !important;
    gap: 20px !important;
    align-items: center !important;
  }
  
  /* VS divider on mobile */
  #dualGaugeContainer > div > div[style*="padding-top: 50px"] {
    padding-top: 0 !important;
    padding: 10px 0 !important;
  }
  
  /* Self and Community gauges */
  #selfScore, #communityScore {
    font-size: 1.8rem !important;
  }
  
  /* Perception insight box */
  #perceptionInsight {
    padding: 10px 15px !important;
    margin-bottom: 15px !important;
  }
  
  #perceptionInsight span {
    font-size: 1rem !important;
  }
  
  /* Difference indicator */
  #differenceIndicator {
    margin-top: 12px !important;
  }
  
  /* Ranking section header */
  #rankingSection > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  
  #rankingSubtitle {
    padding-left: 0 !important;
    text-align: center !important;
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  #singleGaugeContainer svg,
  #dualGaugeContainer svg {
    width: 140px !important;
    height: 140px !important;
  }
  
  #overallScore {
    font-size: 2rem !important;
  }
  
  #selfScore, #communityScore {
    font-size: 1.6rem !important;
  }
  
  .rank-title-display, #currentRankTitle, #selfRankTitle, #communityRankTitle {
    padding: 6px 12px !important;
    font-size: 0.75rem !important;
  }
}

/* ========== PROFILE SECTION RESPONSIVE ========== */
@media (max-width: 768px) {
  .profile-header-content {
    flex-direction: column !important;
    text-align: center !important;
  }
  
  .user-meta {
    justify-content: center !important;
  }
  
  .profile-image-container {
    width: 100px !important;
    height: 100px !important;
  }
  
  .claimed-profiles-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
}

@media (max-width: 480px) {
  .profile-image-container {
    width: 80px !important;
    height: 80px !important;
  }
  
  .claimed-profiles-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ========== DASHBOARD RESPONSIVE ========== */
@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }
  
  .dashboard-sidebar {
    display: none;
  }
  
  .dashboard-main {
    width: 100% !important;
  }
}

@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column !important;
    gap: 10px !important;
    text-align: center !important;
  }
  
  .ranking-gauge-container {
    width: 100% !important;
    max-width: 300px !important;
    margin: 0 auto !important;
  }
  
  .rating-scale-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 10px !important;
  }
  
  .rating-cards-track {
    min-width: max-content !important;
  }
}

/* ========== REPORTS DASHBOARD RESPONSIVE ========== */
@media (max-width: 992px) {
  .reports-container {
    padding: 15px !important;
  }
  
  .question-by-question-report {
    padding: 15px !important;
  }
  
  .question-item {
    padding: 12px !important;
  }
}

@media (max-width: 768px) {
  .question-gauge-container {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  
  .category-breakdown {
    padding: 12px !important;
  }
  
  .category-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
}

/* ========== MODALS & POPUPS RESPONSIVE ========== */
@media (max-width: 768px) {
  .modal-overlay, .popup-overlay {
    padding: 10px !important;
    align-items: flex-start !important;
    padding-top: 20px !important;
  }
  
  .modal, .popup, .modal-content, .popup-content {
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    max-height: calc(100vh - 40px) !important;
    margin: 0 auto !important;
    border-radius: 16px !important;
  }
  
  .modal-header, .popup-header {
    padding: 12px 15px !important;
    font-size: 1rem !important;
  }
  
  .modal-body, .popup-body {
    padding: 15px !important;
    max-height: calc(100vh - 150px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .modal-footer, .popup-footer {
    padding: 12px 15px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  
  .modal-footer button, .popup-footer button {
    flex: 1 1 auto !important;
    min-width: 100px !important;
  }
}

@media (max-width: 480px) {
  .modal, .popup, .modal-content, .popup-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  
  .modal-overlay, .popup-overlay {
    padding: 0 !important;
  }
}

/* ========== SEARCH RESULTS RESPONSIVE ========== */
@media (max-width: 768px) {
  .search-results-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  .search-result-card {
    flex-direction: row !important;
    align-items: center !important;
    padding: 12px !important;
  }
  
  .search-result-photo {
    width: 60px !important;
    height: 60px !important;
    flex-shrink: 0 !important;
  }
  
  .search-result-info {
    flex: 1 !important;
    min-width: 0 !important;
  }
  
  .search-result-name {
    font-size: 1rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* ========== EVALUATION INTERFACE RESPONSIVE ========== */
@media (max-width: 768px) {
  .evaluation-container {
    padding: 15px !important;
  }
  
  .question-card {
    padding: 15px !important;
  }
  
  .response-options {
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  .response-option {
    width: 100% !important;
    padding: 12px 15px !important;
    text-align: left !important;
  }
  
  .evaluation-progress {
    font-size: 0.85rem !important;
  }
  
  .evaluation-nav-buttons {
    flex-direction: column !important;
    gap: 10px !important;
  }
  
  .evaluation-nav-buttons button {
    width: 100% !important;
  }
}

/* ========== TABLES RESPONSIVE ========== */
@media (max-width: 768px) {
  table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
  }
  
  th, td {
    padding: 8px 10px !important;
    font-size: 0.85rem !important;
  }
}

/* ========== FORM ELEMENTS RESPONSIVE ========== */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  textarea,
  select {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
    padding: 12px 15px !important;
    width: 100% !important;
  }
  
  .form-group {
    margin-bottom: 15px !important;
  }
  
  .form-row {
    flex-direction: column !important;
    gap: 15px !important;
  }
}

/* ========== ACCORDION RESPONSIVE ========== */
@media (max-width: 768px) {
  .accordion-header {
    padding: 12px 15px !important;
    font-size: 0.95rem !important;
  }
  
  .accordion-content {
    padding: 12px 15px !important;
  }
}

/* ========== TABS RESPONSIVE ========== */
@media (max-width: 768px) {
  .nav-tabs, .tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 5px !important;
    padding-bottom: 5px !important;
  }
  
  .nav-tab, .tab {
    flex-shrink: 0 !important;
    padding: 10px 15px !important;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
  }
}

/* ========== FLEX UTILITIES RESPONSIVE ========== */
@media (max-width: 768px) {
  .flex-row-mobile-col {
    flex-direction: column !important;
  }
  
  .gap-mobile-sm {
    gap: 8px !important;
  }
  
  .text-center-mobile {
    text-align: center !important;
  }
  
  .w-full-mobile {
    width: 100% !important;
  }
}

/* ========== TOUCH DEVICE OPTIMIZATIONS ========== */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  button, .btn, a.btn, .nav-link, .clickable {
    min-height: 44px !important;
    min-width: 44px !important;
  }
  
  /* Remove hover effects on touch */
  button:hover, .btn:hover {
    transform: none !important;
  }
  
  /* Active states for touch feedback */
  button:active, .btn:active {
    transform: scale(0.98) !important;
    opacity: 0.9 !important;
  }
}

/* ========== SAMSUNG-SPECIFIC FIXES ========== */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: .001dpcm) {
  /* Samsung Internet specific styles */
  .modal, .popup {
    -webkit-transform: translate3d(0,0,0) !important;
    transform: translate3d(0,0,0) !important;
  }
}

/* ========== NOTCH/SAFE AREA SUPPORT ========== */
@supports (padding-top: env(safe-area-inset-top)) {
  .modern-header {
    padding-top: env(safe-area-inset-top);
  }
  
  .modal, .popup {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ========== COMMUNITY PAGE RESPONSIVE ========== */
@media (max-width: 768px) {
  .community-hero {
    padding: 40px 15px !important;
  }
  
  .community-hero h1 {
    font-size: 1.8rem !important;
  }
  
  .community-hero p {
    font-size: 1rem !important;
  }
  
  .community-stats {
    gap: 15px !important;
  }
  
  .stat-number {
    font-size: 1.6rem !important;
  }
  
  .communities-grid {
    grid-template-columns: 1fr !important;
  }
  
  .community-card {
    padding: 18px !important;
  }
}

/* ========== LOGIN/ACCOUNT PAGE RESPONSIVE ========== */
@media (max-width: 768px) {
  .card {
    margin: 10px !important;
    padding: 20px !important;
  }
  
  .account-grid {
    grid-template-columns: 1fr !important;
  }
  
  .account-container {
    padding: 15px !important;
  }
}

/* ========== PRICING PAGE RESPONSIVE ========== */
@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
  
  .pricing-card {
    padding: 20px !important;
  }
}

/* ========== SUPPORT GROUPS RESPONSIVE ========== */
@media (max-width: 768px) {
  .support-groups-container {
    padding: 15px !important;
  }
  
  .support-group-card {
    padding: 15px !important;
  }
}

/* ========== IMPROVEMENT SUGGESTIONS RESPONSIVE ========== */
@media (max-width: 768px) {
  .suggestions-container,
  .improvement-suggestions {
    padding: 12px !important;
  }
  
  .suggestion-item {
    padding: 12px !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
}

/* ========== RESOURCES SECTION RESPONSIVE ========== */
@media (max-width: 768px) {
  .resources-container {
    padding: 15px !important;
  }
  
  .resource-card {
    padding: 12px 15px !important;
  }
  
  .resource-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.2rem !important;
  }
}

/* ========== QUICK FACTS / CHARACTER METRICS RESPONSIVE ========== */
@media (max-width: 768px) {
  #overallRatingPanel {
    min-width: 100% !important;
    padding: 15px !important;
  }
  
  #overallRatingPanel > div[style*="display: flex"][style*="justify-content: space-between"] {
    flex-direction: column !important;
    gap: 15px !important;
    align-items: center !important;
  }
  
  .fire-profile-section {
    min-width: 100% !important;
    width: 100% !important;
  }
  
  .fire-profile-photo, #personPhoto {
    width: 100px !important;
    height: 100px !important;
    min-width: 100px !important;
    min-height: 100px !important;
  }
}

@media (max-width: 480px) {
  .fire-profile-photo, #personPhoto {
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    min-height: 80px !important;
  }
  
  #personName {
    font-size: 1.5rem !important;
  }
  
  #personStats {
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  .stat-badge {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ========== PLACES SEARCH RESPONSIVE ========== */
@media (max-width: 768px) {
  .places-search-container {
    padding: 15px !important;
  }
  
  .place-card {
    padding: 15px !important;
  }
  
  .place-hero {
    min-height: 200px !important;
  }
  
  .place-hero-inner {
    padding: 15px !important;
  }
}

/* ========== HEADER / NAVIGATION RESPONSIVE ========== */
@media (max-width: 768px) {
  .modern-header {
    padding: 10px 15px !important;
  }
  
  .header-logo img {
    height: 36px !important;
  }
  
  .nav-links {
    display: none !important;
  }
  
  .nav-links.active {
    display: flex !important;
    flex-direction: column !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    padding: 15px !important;
    z-index: 1000 !important;
  }
  
  .mobile-menu-btn {
    display: flex !important;
  }
}

/* ========== GLOBAL CARD RESPONSIVE ========== */
@media (max-width: 480px) {
  .ranking-card,
  .card,
  .info-card {
    border-radius: 12px !important;
    margin: 8px 0 !important;
  }
}
