/* ============================================================
   JooCall - Mobile-First Design System
   Optimized for all screen sizes: 320px to 540px to 768px+
   ============================================================ */

/* CSS Variables */
:root {
  --bg-primary: #0a0b10;
  --bg-secondary: #121520;
  --bg-card: #181c2b;
  --accent-cyan: #00f2fe;
  --accent-pink: #ff5858;
  --btn-gradient: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
  --btn-gradient-pink: linear-gradient(135deg, #f857a6 0%, #ff5858 100%);
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 20px rgba(0, 198, 255, 0.35);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-card: 14px;
  --radius-btn: 22px;
  --touch-min: 44px;
}

/* Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overscroll-behavior: contain;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
a {
  touch-action: manipulation;
}

/* Container */
.container {
  width: 100%;
  max-width: 540px;
  background: var(--bg-secondary);
  min-height: 100vh;
  min-height: 100dvh;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
  position: relative;
  overflow-x: hidden;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(18, 21, 32, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--border-color);
  min-height: 52px;
}

.brand-logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: var(--touch-min);
  padding: 4px 0;
}

.brand-logo span {
  color: var(--accent-cyan);
}

.phone-link {
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.14), rgba(79, 172, 254, 0.14));
  padding: 7px 13px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.18);
  white-space: nowrap;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
}

/* Ad Slots - no extra space or background */
.ad-slot-box {
  width: 100%;
  background: transparent !important;
  background-color: transparent !important;
  color: inherit;
  text-align: center;
  padding: 0 !important;
  margin: 12px auto !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  min-height: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.ad-slot-header {
  margin: 10px auto 14px auto !important;
  width: 100%;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  z-index: 100;
}

.ad-slot-footer-unit {
  margin: 16px auto 14px auto !important;
  width: 100%;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.ad-slot-box div,
.ad-slot-box ins,
.adsbygoogle {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 auto !important;
  max-width: 100% !important;
  text-align: center;
}

/* Profile Grid */
.profiles-section {
  padding: 12px;
}

.section-title {
  font-size: 1.08rem;
  font-weight: 800;
  margin-bottom: 12px;
  text-align: center;
  color: var(--text-main);
  letter-spacing: 0.4px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 420px) {
  .profile-grid {
    gap: 12px;
  }

  .profiles-section {
    padding: 14px;
  }
}

/* Profile Card */
.profile-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 12px 8px;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

.profile-card:active {
  transform: scale(0.97);
}

@media (hover: hover) {
  .profile-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-cyan);
    box-shadow: var(--shadow-glow);
  }
}

.card-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  background: rgba(0, 0, 0, 0.78);
  color: #ffdd57;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 6px;
  border: 1px solid rgba(255, 221, 87, 0.4);
  z-index: 2;
  line-height: 1.4;
}

/* Avatar */
.profile-avatar-wrap {
  width: 80px;
  height: 80px;
  margin: 4px auto 8px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #00f2fe, #ff5858, #00c6ff);
  position: relative;
}

@media (min-width: 380px) {
  .profile-avatar-wrap {
    width: 90px;
    height: 90px;
  }
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #222;
}

.profile-name {
  font-size: 0.92rem;
  font-weight: 800;
  margin-bottom: 7px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Call Button */
.call-btn {
  width: 100%;
  padding: 10px 10px;
  border: none;
  border-radius: var(--radius-btn);
  background: var(--btn-gradient);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: opacity 0.18s ease, transform 0.15s ease;
  box-shadow: 0 4px 12px rgba(0, 198, 255, 0.28);
  min-height: var(--touch-min);
}

.call-btn-pink {
  background: var(--btn-gradient-pink);
  box-shadow: 0 4px 12px rgba(255, 88, 88, 0.28);
}

.call-btn:active {
  opacity: 0.85;
  transform: scale(0.97);
}

@media (hover: hover) {
  .call-btn:hover {
    opacity: 0.9;
  }
}

/* Online count */
.online-users {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 7px;
}

.dot-green {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 7px #10b981;
  flex-shrink: 0;
}

/* SEO Article Section */
.seo-article-section {
  padding: 18px 14px;
  background: #06070a;
  border-top: 1px solid var(--border-color);
}

.article-main-title {
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.35;
}

.article-heading {
  font-size: 0.98rem;
  font-weight: 700;
  margin: 16px 0 7px;
  color: var(--text-main);
  text-align: center;
}

.article-text {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 10px;
  line-height: 1.65;
  text-align: center;
}

.hospital-examples {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 10px 0;
  text-align: center;
}

/* Profile Detail Page */
.profile-page-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(18, 21, 32, 0.97);
  min-height: 52px;
  position: sticky;
  top: 0;
  z-index: 200;
}

.back-btn {
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 800;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  padding-right: 8px;
}

.profile-detail-container {
  padding: 16px 14px;
  text-align: center;
}

.profile-large-avatar {
  width: min(200px, 55vw);
  height: min(200px, 55vw);
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent-cyan);
  box-shadow: var(--shadow-glow);
  margin: 0 auto 14px;
}

.profile-main-title {
  font-size: clamp(1.3rem, 5vw, 1.8rem);
  font-weight: 800;
  margin-bottom: 5px;
  line-height: 1.25;
}

.profile-location-tag {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.profile-big-cta {
  width: 100%;
  max-width: 310px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-btn);
  background: var(--btn-gradient);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  cursor: pointer;
  margin: 10px 0 18px;
  box-shadow: 0 4px 20px rgba(0, 198, 255, 0.4);
  min-height: var(--touch-min);
  transition: opacity 0.18s ease, transform 0.15s ease;
}

.profile-big-cta:active {
  opacity: 0.85;
  transform: scale(0.97);
}

.profile-stats-row {
  display: flex;
  justify-content: space-around;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 12px 6px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

.stat-box {
  text-align: center;
}

.stat-number {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 3px;
}

.profile-bio-box {
  text-align: left;
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.65;
  background: rgba(255, 255, 255, 0.02);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}

/* Gallery */
.gallery-section {
  margin-bottom: 18px;
}

.gallery-grid {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  overflow-x: auto;
  padding: 4px 0 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
}

.gallery-grid::-webkit-scrollbar {
  display: none;
}

.gallery-thumb {
  width: 84px;
  height: 84px;
  min-width: 84px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--border-color);
  scroll-snap-align: start;
  transition: border-color 0.2s;
}

.gallery-thumb:active {
  border-color: var(--accent-cyan);
}

/* Video Call Page */
.video-call-screen {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: 9/16;
  max-height: min(70vh, 560px);
}

@supports not (aspect-ratio: 9/16) {
  .video-call-screen {
    height: min(70vh, 560px);
  }
}

.full-screen-profile-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 1;
}

.main-video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 2;
}

.live-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 10;
  letter-spacing: 0.5px;
}

.pulsing-dot {
  width: 7px;
  height: 7px;
  background: #fff;
  border-radius: 50%;
  animation: pulse-dot 1s infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.7);
  }
}

.call-timer-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 16px;
  z-index: 10;
  letter-spacing: 0.5px;
}

/* User webcam inset */
.user-webcam-container {
  position: absolute;
  bottom: 72px;
  right: 10px;
  width: min(90px, 22vw);
  height: min(120px, 29vw);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: #111;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.user-webcam-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-webcam-off-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  color: #64748b;
  background: #0d0f18;
  text-align: center;
  padding: 4px;
}

/* Controls overlay */
.video-call-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  z-index: 10;
  gap: 10px;
}

.call-btn-flip {
  flex: 1;
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-btn);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: var(--touch-min);
  transition: background 0.2s;
}

.call-btn-flip:active {
  background: rgba(255, 255, 255, 0.2);
}

.call-btn-end-clear {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-radius: var(--radius-btn);
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: var(--touch-min);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  letter-spacing: 0.5px;
  transition: opacity 0.18s, transform 0.15s;
}

.call-btn-end-clear:active {
  opacity: 0.85;
  transform: scale(0.97);
}

/* Connecting overlay */
.connecting-call-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 16, 0.96);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  z-index: 20;
  text-align: center;
}

/* Recirculation Section */
.recirc-header {
  font-size: 1rem;
  font-weight: 800;
  margin: 20px 0 12px;
  color: var(--text-main);
  text-align: center;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

/* Footer */
.site-footer {
  background: #050608;
  border-top: 1px solid var(--border-color);
  padding: 22px 14px 60px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8rem;
  transition: color 0.2s ease;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
}

.footer-links a:hover,
.footer-links a:active {
  color: var(--accent-cyan);
}

.footer-copyright {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 8px;
  line-height: 1.5;
}

/* 10-Second Countdown Modal */
.countdown-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 14, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.countdown-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.countdown-modal-card {
  background: var(--bg-card);
  border: 2px solid var(--accent-cyan);
  border-radius: 20px;
  width: 100%;
  max-width: min(390px, 94vw);
  padding: 20px 12px;
  text-align: center;
  box-shadow: 0 0 40px rgba(0, 242, 254, 0.3);
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.countdown-modal-overlay.active .countdown-modal-card {
  transform: scale(1);
}

.countdown-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 5px;
}

.countdown-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.timer-circle-wrap {
  width: 100px;
  height: 100px;
  margin: 0 auto 16px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-number {
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--accent-cyan);
  text-shadow: 0 0 14px rgba(0, 242, 254, 0.6);
  z-index: 2;
}

.timer-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: -4px;
}

.countdown-progress-bar {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin: 14px 0;
}

.countdown-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00f2fe, #ff5858);
  transition: width 1s linear;
  border-radius: 10px;
}

.countdown-ad-box {
  background: #ffffff;
  color: #222;
  border-radius: 8px;
  padding: 10px 8px;
  margin-top: 12px;
  font-size: 0.73rem;
  font-weight: 700;
}

/* Tablet / Desktop (540px+) */
@media (min-width: 540px) {
  .profile-avatar-wrap {
    width: 96px;
    height: 96px;
  }

  .profile-name {
    font-size: 1rem;
  }

  .call-btn {
    font-size: 0.85rem;
  }

  .article-main-title {
    font-size: 1.25rem;
  }

  .site-header {
    padding: 12px 18px;
  }

  .profiles-section {
    padding: 16px;
  }

  .seo-article-section {
    padding: 20px 18px;
  }

  .profile-detail-container {
    padding: 20px 18px;
  }

  .video-call-screen {
    max-height: 580px;
  }
}

/* Extra Small (360px and below) */
@media (max-width: 360px) {
  html {
    font-size: 14px;
  }

  .profile-avatar-wrap {
    width: 72px;
    height: 72px;
  }

  .profile-name {
    font-size: 0.85rem;
  }

  .call-btn {
    font-size: 0.75rem;
    padding: 9px 6px;
  }

  .brand-logo {
    font-size: 1rem;
  }

  .phone-link {
    font-size: 0.75rem;
    padding: 6px 10px;
  }

  .user-webcam-container {
    width: 74px;
    height: 98px;
    bottom: 64px;
  }

  .countdown-modal-card {
    padding: 18px 14px;
  }

  .timer-number {
    font-size: 2.2rem;
  }

  .gallery-thumb {
    width: 72px;
    height: 72px;
    min-width: 72px;
  }

  .section-title {
    font-size: 0.98rem;
  }
}

/* Safe Area - iPhone notch and home bar */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .site-footer {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }

  .video-call-controls {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .countdown-modal-overlay {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .video-call-screen {
    aspect-ratio: unset;
    height: 100dvh;
    max-height: 100dvh;
  }

  .video-call-controls {
    padding: 6px 14px;
  }

  .countdown-modal-card {
    max-width: 480px;
    padding: 14px 18px;
  }

  .timer-number {
    font-size: 2rem;
  }
}