/* Medical Consultation Chat Design - custom CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary-navy: #0e2f56;
  --clinical-blue: #0f75bc;
  --light-blue: #ebf5fb;
  --bg-color: #f3f7fa;
  --white: #ffffff;
  --text-dark: #1e2e3d;
  --text-muted: #5e6e7d;
  --accent-green: #2ecc71;
  --accent-red: #e74c3c;
  --accent-orange: #f39c12;
  --border-color: #dbe4eb;
  --shadow-sm: 0 2px 8px rgba(15, 117, 188, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 117, 188, 0.08);
  --shadow-lg: 0 16px 36px rgba(15, 117, 188, 0.12);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Base Wrapper */
.app-wrapper {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--white);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.05);
  position: relative;
}

/* Header Styling */
.clinic-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.doctor-avatar-container {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.doctor-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--clinical-blue);
  box-shadow: 0 0 10px rgba(15, 117, 188, 0.2);
}

.status-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-green);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}

.pulse-animation {
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(46, 204, 113, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
  }
}

.doctor-info {
  flex-grow: 1;
}

.doctor-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-navy);
  display: flex;
  align-items: center;
  gap: 6px;
}

.verified-icon {
  color: var(--clinical-blue);
  width: 16px;
  height: 16px;
  display: inline-block;
  fill: currentColor;
}

.doctor-title {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.3;
  margin-top: 2px;
}

.online-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-green);
  background: rgba(46, 204, 113, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
}

/* Chat container */
.chat-container {
  flex-grow: 1;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: linear-gradient(180deg, #f9fbfd 0%, #f3f7fa 100%);
  min-height: calc(100vh - 93px);
}

/* Chat bubbles */
.msg-row {
  display: flex;
  gap: 12px;
  opacity: 0;
  transform: translateY(15px);
  animation: slide-in 0.4s ease forwards;
  max-width: 85%;
}

.msg-row.doctor {
  align-self: flex-start;
}

.msg-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
  max-width: 75%;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.msg-bubble {
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 15px;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.doctor .msg-bubble {
  background: var(--white);
  color: var(--text-dark);
  border-top-left-radius: 4px;
  border: 1px solid rgba(15, 117, 188, 0.08);
}

.user .msg-bubble {
  background: var(--clinical-blue);
  color: var(--white);
  border-top-right-radius: 4px;
}

.msg-bubble img {
  max-width: 100%;
  border-radius: 10px;
  margin: 10px 0;
  display: block;
}

.msg-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}

.user .msg-time {
  color: rgba(255, 255, 255, 0.7);
}

@keyframes slide-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--white);
  padding: 12px 20px;
  border-radius: 18px;
  border-top-left-radius: 4px;
  box-shadow: var(--shadow-sm);
  align-self: flex-start;
  margin-left: 48px;
  display: none;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--clinical-blue);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out;
  opacity: 0.6;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {
  0%, 80%, 100% {
    transform: scale(0.6);
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Options / Choices selection */
.choices-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 5px;
  width: 100%;
  align-self: center;
  max-width: 480px;
}

.choice-btn {
  background: var(--white);
  border: 1px solid var(--border-color);
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--clinical-blue);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.choice-btn:hover {
  background: var(--light-blue);
  border-color: var(--clinical-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.choice-btn::after {
  content: '→';
  font-size: 16px;
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.choice-btn:hover::after {
  transform: translateX(4px);
  opacity: 1;
}

/* Custom interactive voucher game block */
.voucher-game-container {
  background: var(--white);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  margin-top: 15px;
  text-align: center;
  display: none;
  animation: slide-in 0.5s ease forwards;
}

.voucher-game-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-navy);
  margin-bottom: 12px;
  line-height: 1.4;
}

.voucher-game-title span.product-hl {
  color: var(--clinical-blue);
}

.voucher-game-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.voucher-cards {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.voucher-card {
  flex: 1;
  max-width: 90px;
  height: 180px;
  position: relative;
  perspective: 1000px;
  cursor: pointer;
}

.voucher-card-inner {
  width: 100%;
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.voucher-card.flipped .voucher-card-inner {
  transform: rotateY(180deg);
}

.voucher-card-front,
.voucher-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 45px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-shadow: var(--shadow-md);
}

.voucher-card-front {
  color: var(--white);
  border: 2px solid rgba(15, 117, 188, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 24px 8px;
}

.voucher-card-front .capsule-icon {
  font-size: 32px;
  margin-top: 10px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
  transition: transform 0.3s ease;
  line-height: 1;
}

.voucher-card:hover .voucher-card-front .capsule-icon {
  transform: scale(1.15) translateY(-5px);
}

.voucher-card-front span {
  font-size: 11px;
  font-weight: 700;
  color: #6b7c93;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

/* Different front colors - Capsule style */
.voucher-card:nth-child(1) .voucher-card-front {
  background: linear-gradient(to bottom, #1f75fe 50%, #f0f4f8 50%); /* Blue capsule */
}
.voucher-card:nth-child(2) .voucher-card-front {
  background: linear-gradient(to bottom, #e74c3c 50%, #f0f4f8 50%); /* Red capsule */
}
.voucher-card:nth-child(3) .voucher-card-front {
  background: linear-gradient(to bottom, #f1c40f 50%, #f0f4f8 50%); /* Gold capsule */
}

.voucher-card-back {
  background: var(--white);
  color: var(--text-dark);
  transform: rotateY(180deg);
  border: 2px solid var(--border-color);
  border-radius: 45px;
}

.voucher-card-back.win {
  border-color: var(--accent-green);
  background: linear-gradient(180deg, #ffffff 0%, #eefbf3 100%);
}

.discount-value {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent-red);
}

.voucher-card-back.win .discount-value {
  color: var(--accent-green);
}

.discount-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Spin result pop-up window */
.popup-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(14, 47, 86, 0.6);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.popup-wrapper.show {
  opacity: 1;
  pointer-events: auto;
}

.popup-box {
  background: var(--white);
  max-width: 440px;
  width: 100%;
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.popup-wrapper.show .popup-box {
  transform: scale(1);
}

.popup-icon {
  font-size: 54px;
  margin-bottom: 16px;
}

.popup-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-navy);
  margin-bottom: 12px;
}

.popup-text {
  font-size: 16px;
  color: var(--text-dark);
  line-height: 1.5;
  margin-bottom: 24px;
}

.popup-text span.highlight {
  color: var(--accent-red);
  font-weight: 700;
}

.popup-text span.free-badge {
  background: rgba(231, 76, 60, 0.1);
  color: var(--accent-red);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 800;
}

.popup-btn {
  background: var(--clinical-blue);
  color: var(--white);
  border: none;
  padding: 14px 40px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
  box-shadow: 0 4px 12px rgba(15, 117, 188, 0.3);
}

.popup-btn:hover {
  background: #0d63a0;
}

/* Order Form Container styling */
.order-container {
  background: var(--white);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-top: 15px;
  display: none;
  animation: slide-in 0.5s ease forwards;
}

.order-showcase {
  background: linear-gradient(135deg, #ebf5fb 0%, #d4e6f1 100%);
  padding: 30px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-img {
  width: 240px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 15px 25px rgba(14, 47, 86, 0.15));
  transition: transform 0.3s ease;
}

.product-img:hover {
  transform: scale(1.05);
}

.promo-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--accent-red);
  color: var(--white);
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(231, 76, 60, 0.3);
  border: 2px dashed rgba(255, 255, 255, 0.4);
  transform: rotate(-10deg);
}

.promo-badge span {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.9;
}

.promo-badge strong {
  font-size: 16px;
  font-weight: 900;
}

.order-body {
  padding: 30px 24px;
}

.order-header-text {
  text-align: center;
  margin-bottom: 24px;
}

.order-brand {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary-navy);
}

.order-price-title {
  font-size: 18px;
  color: var(--text-muted);
  margin-top: 4px;
}

.order-price-val {
  color: var(--accent-red);
  font-size: 36px;
  font-weight: 900;
  margin-top: 4px;
}

.order-subtext {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Timer Section */
.timer-box {
  background: #fff8f7;
  border: 1px solid rgba(231, 76, 60, 0.2);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.timer-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

.timer-digits {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-red);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

/* Order Form Fields */
.order-promo-label {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(220, 38, 38, 0.1);
  color: var(--accent-red);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.order-form-group {
  margin-bottom: 16px;
  position: relative;
}

.order-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.order-input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.order-input-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.order-input {
  width: 100%;
  height: 56px;
  padding: 0 16px 0 52px;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  font-size: 16px;
  font-family: var(--font-main);
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fbfdff;
}

.order-input:focus {
  border-color: var(--clinical-blue);
  box-shadow: 0 0 0 4px rgba(15, 117, 188, 0.1);
  background: var(--white);
}

.order-submit-btn {
  width: 100%;
  height: 60px;
  background: linear-gradient(180deg, #1f85e4 0%, #075fc7 100%);
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 8px 20px rgba(15, 117, 188, 0.25);
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.order-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 117, 188, 0.35);
  background: linear-gradient(180deg, #2c93f5 0%, #086ada 100%);
}

.order-submit-btn:active {
  transform: translateY(1px);
}

.order-note {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
}

/* Security reassurance banner */
.security-banner {
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-color);
  border-radius: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border-color);
}

.security-icon {
  width: 32px;
  height: 32px;
  background: rgba(15, 117, 188, 0.1);
  color: var(--clinical-blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.security-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.security-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: left;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .clinic-header {
    padding: 12px 14px;
  }
  .doctor-avatar-container {
    width: 50px;
    height: 50px;
  }
  .doctor-name {
    font-size: 16px;
  }
  .doctor-title {
    font-size: 11px;
  }
  .online-label {
    font-size: 11px;
    padding: 3px 8px;
  }
  
  .chat-container {
    padding: 16px 12px;
    gap: 16px;
  }
  
  .msg-bubble {
    font-size: 14px;
    padding: 12px 14px;
  }
  
  .voucher-cards {
    gap: 10px;
  }
  
  .voucher-card {
    height: 160px;
    max-width: 80px;
  }
  
  .voucher-card-front,
  .voucher-card-back {
    border-radius: 40px;
  }
  
  .voucher-card-front .capsule-icon {
    font-size: 24px;
  }
  
  .voucher-card-front span {
    font-size: 9px;
  }
  
  .discount-value {
    font-size: 13px;
  }
}
