/* ===================================================================
   FeminaCare - Sức Khỏe & Chu Kỳ Phái Đẹp
   Styles, Mobile-First PWA & Auth Keypad
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap');

:root {
  --primary-pink: #f43f5e;
  --soft-rose: #fff1f2;
  --accent-rose: #fda4af;
  --fertile-purple: #c084fc;
  --safe-green: #34d399;
  --period-red: #f87171;
  --warning-amber: #fbbf24;
}

html {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #fff9fa;
  color: #334155;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(253, 164, 175, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(192, 132, 252, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(254, 205, 211, 0.1) 0%, transparent 60%);
  background-attachment: fixed;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Triệt tiêu 100% hiện tượng Safari tự ý phóng to (Auto-Zoom) khi chạm vào bất kỳ ô input nào */
input, select, textarea {
  font-size: 16px !important;
}
@media (min-width: 768px) {
  input.text-xs, select.text-xs, textarea.text-xs {
    font-size: 0.75rem !important;
  }
}

.font-serif-title {
  font-family: 'Playfair Display', serif;
}

/* Glassmorphism Card Effect */
.glass-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 228, 230, 0.85);
  box-shadow: 0 10px 30px -5px rgba(244, 63, 94, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

.glass-card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 35px -5px rgba(244, 63, 94, 0.12), 0 6px 10px -2px rgba(0, 0, 0, 0.03);
  border-color: rgba(253, 164, 175, 0.9);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #fff1f2;
}
::-webkit-scrollbar-thumb {
  background: #fda4af;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #fb7185;
}

/* Calendar Day Styles */
.calendar-day {
  transition: all 0.2s ease-in-out;
  position: relative;
  min-height: 48px;
}

.calendar-day:hover {
  transform: scale(1.05);
  z-index: 10;
}

.day-period {
  background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%);
  color: #e11d48;
  font-weight: 600;
  border: 1px solid #fda4af;
}

.day-fertile {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  color: #7e22ce;
  font-weight: 600;
  border: 1px solid #d8b4fe;
}

/* Các cấp độ màu tím theo tỷ lệ thụ thai trước và sau ngày rụng trứng */
.day-fertile-very-high {
  background: linear-gradient(135deg, #c084fc 0%, #a855f7 100%);
  color: #ffffff;
  font-weight: 700;
  border: 1px solid #9333ea;
  box-shadow: 0 3px 10px rgba(168, 85, 247, 0.3);
}

.day-fertile-high {
  background: linear-gradient(135deg, #d8b4fe 0%, #c084fc 100%);
  color: #4c1d95;
  font-weight: 700;
  border: 1px solid #a855f7;
  box-shadow: 0 2px 6px rgba(168, 85, 247, 0.15);
}

.day-fertile-medium {
  background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%);
  color: #6b21a8;
  font-weight: 600;
  border: 1px solid #c084fc;
}

.day-fertile-low {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  color: #7e22ce;
  font-weight: 500;
  border: 1px solid #d8b4fe;
}

.day-fertile-minimal {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  color: #9333ea;
  font-weight: 500;
  border: 1px solid #e9d5ff;
}

.day-ovulation {
  background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%) !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(126, 34, 206, 0.45);
  border: 1.5px solid #6b21a8;
  animation: pulse-ovulation 2.5s infinite;
}

.day-safe-absolute {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  color: #047857;
  font-weight: 600;
  border: 1px solid #a7f3d0;
}

.day-safe-relative {
  background: linear-gradient(135deg, #fefce8 0%, #fef08a 100%);
  color: #a16207;
  font-weight: 600;
  border: 1px solid #fde047;
}

.day-today {
  outline: 2.5px solid #f43f5e;
  outline-offset: -1px;
}

@keyframes pulse-ovulation {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(192, 132, 252, 0.5);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(192, 132, 252, 0);
  }
}

/* Privacy Blur Shield */
body.privacy-mode .privacy-sensitive {
  filter: blur(7px);
  user-select: none;
  transition: filter 0.3s ease;
}

body.privacy-mode .privacy-sensitive:hover {
  filter: blur(0);
}

/* PIN Keypad Styling (Mobile App Feel) - Chống Auto-Zoom & Double-Tap Zoom */
#lockScreen {
  touch-action: manipulation !important;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#lockScreen button {
  touch-action: manipulation !important;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  border: 2px solid #fda4af;
  background-color: transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pin-dot.filled {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  border-color: #e11d48;
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

.keypad-btn {
  width: 68px;
  height: 68px;
  border-radius: 9999px;
  background: white;
  border: 1px solid #fecdd3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  box-shadow: 0 4px 6px -1px rgba(244, 63, 94, 0.08);
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation !important;
}

.keypad-btn:active {
  background: #ffe4e6;
  transform: scale(0.92);
  border-color: #fb7185;
}

/* View transitions & Modern Tab Navigation */
.app-view {
  animation: fadeInView 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.desktop-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.desktop-tab-btn:hover {
  color: #e11d48;
  background-color: #fff1f2;
}

.desktop-tab-btn.active {
  color: #e11d48;
  background-color: #ffffff;
  box-shadow: 0 4px 12px -2px rgba(244, 63, 94, 0.15), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  border: 1px solid #fecdd3;
}

/* StepFit Emerald Styling */
.step-glass-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(167, 243, 208, 0.85);
  box-shadow: 0 10px 30px -5px rgba(16, 185, 129, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

.step-recording-pulse {
  animation: recordingPulse 1.8s infinite;
}

@keyframes recordingPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
}

.mobile-nav-item.active {
  color: #e11d48;
}

.mobile-nav-item.active svg {
  transform: scale(1.1);
}

/* Water Tracker Aqua Styling */
.water-glass-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(186, 230, 253, 0.85);
  box-shadow: 0 10px 30px -5px rgba(14, 165, 233, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

.water-progress-wave {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.water-progress-wave::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: waveShine 2.5s infinite;
}

@keyframes waveShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.water-slot-card {
  transition: all 0.2s ease;
}

.water-slot-card:hover {
  transform: translateY(-1px);
}

.water-slot-card.completed {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: #7dd3fc;
}

/* DocScan Scanner & Document Styling */
.doc-cat-filter.active {
  background-color: #4f46e5 !important;
  color: #ffffff !important;
  border-color: #4f46e5 !important;
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.25) !important;
}

.doc-filter-btn.active {
  background-color: #4f46e5 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3) !important;
}

.doc-card-hover {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.doc-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* Femina AI Chat Styling */
.ai-chat-bubble-user {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: white;
  border-radius: 1.25rem 1.25rem 0.25rem 1.25rem;
  box-shadow: 0 4px 12px -2px rgba(244, 63, 94, 0.25);
}

.ai-chat-bubble-bot {
  background: white;
  color: #334155;
  border: 1px solid #ffe4e6;
  border-radius: 1.25rem 1.25rem 1.25rem 0.25rem;
  box-shadow: 0 4px 14px -3px rgba(244, 63, 94, 0.08);
}

.ai-typing-dot {
  width: 6px;
  height: 6px;
  background-color: #f43f5e;
  border-radius: 50%;
  animation: aiTypingBounce 1.4s infinite ease-in-out both;
}

.ai-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-typing-dot:nth-child(2) { animation-delay: -0.16s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes aiTypingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* BioVital Styles: Pulse & Breathing Animations */
@keyframes heartBeatPulse {
  0% { transform: scale(1); }
  14% { transform: scale(1.15); }
  28% { transform: scale(1); }
  42% { transform: scale(1.12); }
  70% { transform: scale(1); }
}

.animate-heartbeat {
  animation: heartBeatPulse 1.1s infinite;
}

.breath-circle {
  transition: transform 4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 4s ease-in-out;
}

.breath-inhale {
  transform: scale(1.42);
  box-shadow: 0 0 50px 15px rgba(244, 63, 94, 0.4);
}

.breath-hold {
  transform: scale(1.42);
  box-shadow: 0 0 60px 25px rgba(168, 85, 247, 0.45);
}

.breath-hold-empty {
  transform: scale(0.88);
  box-shadow: 0 0 35px 10px rgba(99, 102, 241, 0.35);
}

.breath-exhale {
  transform: scale(0.88);
  box-shadow: 0 0 25px 6px rgba(56, 189, 248, 0.3);
}

.breath-tech-chip.active-tech {
  border-color: #f43f5e !important;
  background-color: #fff1f2 !important;
  box-shadow: 0 4px 12px -2px rgba(244, 63, 94, 0.25) !important;
}

body.dark-mode .breath-tech-chip.active-tech {
  border-color: #f43f5e !important;
  background-color: rgba(244, 63, 94, 0.2) !important;
  color: #fff !important;
}

/* Print Styles for Medical Report */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .no-print, header, nav, button, .modal, .toast-container, .mobile-bottom-nav, #authScreen {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  .glass-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    background: white !important;
  }
}

/* ===================================================================
   DARK MODE THEME (CHẾ ĐỘ BAN ĐÊM DỊU MẮT CHO NÀNG)
   =================================================================== */
body.dark-mode {
  background-color: #0b0f19 !important;
  color: #e2e8f0 !important;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(244, 63, 94, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(147, 51, 234, 0.14) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.9) 0%, transparent 60%) !important;
}

body.dark-mode header {
  background-color: rgba(15, 23, 42, 0.92) !important;
  border-bottom-color: rgba(51, 65, 85, 0.7) !important;
}

body.dark-mode .glass-card,
body.dark-mode .water-glass-card,
body.dark-mode .step-glass-card {
  background: rgba(17, 24, 39, 0.92) !important;
  border-color: rgba(51, 65, 85, 0.7) !important;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5) !important;
  color: #e2e8f0 !important;
}

body.dark-mode .text-slate-800,
body.dark-mode .text-slate-900,
body.dark-mode .text-slate-700 {
  color: #f1f5f9 !important;
}

body.dark-mode .text-slate-600,
body.dark-mode .text-slate-500 {
  color: #94a3b8 !important;
}

body.dark-mode .bg-white {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
}

body.dark-mode .bg-white\/98,
body.dark-mode .bg-white\/95,
body.dark-mode .bg-white\/90,
body.dark-mode .bg-white\/85 {
  background-color: rgba(26, 34, 52, 0.96) !important;
}

body.dark-mode .bg-rose-50,
body.dark-mode .bg-pink-50 {
  background-color: rgba(244, 63, 94, 0.12) !important;
}

body.dark-mode .bg-slate-50,
body.dark-mode .bg-slate-100 {
  background-color: #1e293b !important;
}

body.dark-mode .border-rose-100,
body.dark-mode .border-rose-200,
body.dark-mode .border-slate-200,
body.dark-mode .border-slate-100 {
  border-color: #334155 !important;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: #475569 !important;
}

body.dark-mode .mobile-bottom-nav {
  background-color: rgba(15, 23, 42, 0.96) !important;
  border-top-color: #334155 !important;
}

body.dark-mode #authScreen,
body.dark-mode #lockScreen {
  background: #0b0f19 !important;
  color: #e2e8f0 !important;
}

body.dark-mode .keypad-btn {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

body.dark-mode .keypad-btn:active {
  background: #334155 !important;
}

