/* Mobile Device Frame CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --app-bg: #0B1329;
  --app-panel: #1E293B;
  --app-gold: #14B8A6;
  --app-gold-muted: rgba(20, 184, 166, 0.15);
  --app-text: #F8FAFC;
  --app-text-muted: #94A3B8;
  --app-border: rgba(20, 184, 166, 0.12);
  --app-font: 'Inter', sans-serif;
  --app-serif: 'Outfit', sans-serif;
  --app-success: #10B981;
  --app-danger: #EF4444;
  --app-warning: #F59E0B;
}

* {
  box-sizing: border-box;
}

body.simulator-body {
  background-color: #0F172A;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: var(--app-font);
  color: #fff;
  overflow: hidden;
  background-image: radial-gradient(circle at 80% 20%, #152238 0%, #0F172A 100%);
}

/* Smartphone Wrapper */
.phone-frame {
  width: 375px;
  max-width: 100%;
  height: 812px;
  background: #000;
  border-radius: 48px;
  padding: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 40px rgba(20, 184, 166, 0.1);
  border: 4px solid #222;
  position: relative;
  overflow: hidden;
}

/* Phone notch/island */
.phone-island {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 28px;
  background: #000;
  border-radius: 20px;
  z-index: 100;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px;
}

.phone-camera {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #111;
  border: 1px solid #222;
}

.phone-speaker {
  width: 40px;
  height: 4px;
  background: #222;
  border-radius: 2px;
}

/* Inner screen content */
.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--app-bg);
  border-radius: 36px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid #111;
}

/* Status Bar */
.status-bar {
  height: 40px;
  padding: 12px 24px 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--app-text);
  font-weight: 600;
  z-index: 90;
}

.status-bar-icons i {
  margin-left: 6px;
}

/* Screen Wrapper */
.screen-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 16px 20px;
  padding-bottom: 64px; /* Space for navbar */
  display: none;
  animation: slideIn 0.3s ease;
}

.screen-content.active {
  display: block;
}

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

/* Scrollbar styling for phone view */
.screen-content::-webkit-scrollbar {
  width: 3px;
}
.screen-content::-webkit-scrollbar-thumb {
  background: rgba(20, 184, 166, 0.3);
  border-radius: 2px;
}

/* Login Screen specific */
#screen-login.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding-bottom: 20px;
}

.phone-screen.authenticated #screen-login {
  display: none !important;
}


.app-logo {
  height: 90px;
  align-self: center;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 8px rgba(20, 184, 166, 0.3));
}

.app-welcome {
  text-align: center;
  margin-bottom: 30px;
}

.app-welcome h2 {
  font-family: var(--app-serif);
  font-size: 26px;
  color: var(--app-gold);
  margin-bottom: 6px;
}

.app-welcome p {
  color: var(--app-text-muted);
  font-size: 13px;
}

.app-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  padding: 0 16px;
  box-sizing: border-box;
}

.app-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.app-input-group label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--app-gold);
  letter-spacing: 0.5px;
  font-weight: 600;
}

.app-input {
  width: 100%;
  background: var(--app-panel);
  border: 1px solid var(--app-border);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-family: var(--app-font);
  font-size: 14px;
  transition: all 0.3s;
}

.app-input:focus {
  outline: none;
  border-color: var(--app-gold);
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.2);
}

.app-btn {
  background: linear-gradient(135deg, #3B82F6 0%, #14B8A6 100%);
  color: #0c101a;
  border: none;
  padding: 13px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(20, 184, 166, 0.2);
  transition: all 0.2s;
  margin-top: 10px;
  text-align: center;
  text-decoration: none;
}

.app-btn:active {
  transform: scale(0.98);
}

.app-error {
  color: var(--app-danger);
  font-size: 12px;
  text-align: center;
  display: none;
}

/* Home / Dashboard Screen */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.patient-profile-brief {
  display: flex;
  align-items: center;
  gap: 12px;
}

.patient-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--app-gold-muted);
  border: 1.5px solid var(--app-gold);
  color: var(--app-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.patient-welcome-text h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.patient-welcome-text p {
  font-size: 11px;
  color: var(--app-text-muted);
}

/* Overview Cards */
.app-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--app-gold);
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.progress-banner {
  background: #1E293B;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
}

.progress-banner h4 {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--app-gold);
}

.progress-banner p {
  font-size: 13px;
  color: #F8FAFC;
  margin-bottom: 12px;
}

.progress-bar-container {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--app-gold);
  width: 0%;
  transition: width 0.8s ease;
}

.progress-percentage {
  align-self: flex-end;
  font-size: 11px;
  font-weight: 700;
  color: var(--app-gold);
}

/* Next Appointment Widget */
.next-appt-card {
  background: var(--app-panel);
  border: 1px solid var(--app-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 24px;
}

.appt-info-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.appt-date-box {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--app-gold-muted);
  border: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--app-gold);
  font-weight: 800;
}

.appt-date-box .month {
  font-size: 10px;
  text-transform: uppercase;
}

.appt-date-box .day {
  font-size: 20px;
  line-height: 20px;
}

.appt-details h5 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.appt-details p {
  font-size: 11px;
  color: var(--app-text-muted);
}

/* Timeline/Records screen */
.timeline-list {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 20px;
  margin-left: 10px;
  border-left: 2px dashed rgba(20, 184, 166, 0.15);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

/* Circle marker on dashed line */
.timeline-dot {
  position: absolute;
  left: -29px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--app-bg);
  border: 3px solid var(--app-text-muted);
  z-index: 10;
  transition: all 0.3s;
}

.timeline-item.completed .timeline-dot {
  border-color: var(--app-success);
  background: var(--app-success);
}

.timeline-item.pending .timeline-dot {
  border-color: var(--app-gold);
}

.timeline-item.missed .timeline-dot {
  border-color: var(--app-danger);
  background: var(--app-danger);
}

.timeline-card {
  background: var(--app-panel);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
}

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

.timeline-date {
  font-size: 11px;
  color: var(--app-text-muted);
  font-weight: 600;
}

.timeline-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}

.timeline-status.completed {
  background: rgba(16, 185, 129, 0.1);
  color: var(--app-success);
}

.timeline-status.pending {
  background: rgba(20, 184, 166, 0.1);
  color: var(--app-gold);
}

.timeline-status.missed {
  background: rgba(239, 68, 68, 0.1);
  color: var(--app-danger);
}

.timeline-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
}

.timeline-card p {
  font-size: 11px;
  color: var(--app-text-muted);
}

/* Feedback section in Timeline items */
.timeline-feedback-area {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: flex-end;
}

.feedback-badge {
  font-size: 11px;
  color: var(--app-gold);
  background: var(--app-gold-muted);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--app-border);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-feedback-trigger {
  background: transparent;
  border: 1.5px solid var(--app-gold);
  color: var(--app-gold);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-feedback-trigger:hover {
  background: var(--app-gold);
  color: #000;
}

/* Feedback Form Screen */
.feedback-summary-proc {
  background: var(--app-panel);
  border: 1px solid var(--app-border);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.feedback-summary-proc h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--app-gold);
}

.feedback-summary-proc p {
  font-size: 12px;
  color: var(--app-text-muted);
}

/* Rating Star Input */
.star-rating-widget {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 15px 0 25px 0;
}

.star-rating-widget i {
  font-size: 32px;
  color: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform 0.2s;
}

.star-rating-widget i:active {
  transform: scale(0.9);
}

.star-rating-widget i.active {
  color: #fbbf24;
}

/* Category select pill-buttons */
.feedback-type-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.type-pill {
  padding: 10px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.08);
  background: var(--app-panel);
  color: var(--app-text-muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.type-pill:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.type-pill.active[data-type="Appreciation"] {
  background: rgba(16, 185, 129, 0.1);
  color: var(--app-success);
  border-color: var(--app-success);
}

.type-pill.active[data-type="Suggestion"] {
  background: rgba(20, 184, 166, 0.1);
  color: var(--app-gold);
  border-color: var(--app-gold);
}

.type-pill.active[data-type="Complaint"] {
  background: rgba(239, 68, 68, 0.1);
  color: var(--app-danger);
  border-color: var(--app-danger);
}

.feedback-textarea {
  min-height: 120px;
  resize: none;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 56px;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: 4px; /* Space for indicator */
  z-index: 95;
  border-bottom-left-radius: 36px;
  border-bottom-right-radius: 36px;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--app-text-muted);
  cursor: pointer;
  transition: all 0.2s;
  width: 60px;
}

.nav-tab i {
  font-size: 16px;
  margin-bottom: 2px;
}

.nav-tab span {
  font-size: 9px;
  font-weight: 600;
}

.nav-tab:hover, .nav-tab.active {
  color: var(--app-gold);
}

/* Home Indicator Bar */
.home-indicator {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2.5px;
  z-index: 100;
}

/* Bills & Invoices card layouts */
.bills-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bill-card {
  background: var(--app-panel);
  border: 1px solid var(--app-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
  margin-bottom: 4px;
}

.bill-card-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.bill-card-id {
  font-size: 13px;
  font-weight: 700;
  color: var(--app-gold);
}

.bill-card-date {
  font-size: 11px;
  color: var(--app-text-muted);
}

.bill-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.bill-card-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--app-text);
}

.bill-card-item small {
  color: var(--app-gold);
}

.bill-card-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
  font-weight: 700;
}

.bill-card-total-label {
  font-size: 13px;
  color: var(--app-text-muted);
}

.bill-card-total-val {
  font-size: 15px;
  color: var(--app-gold);
}

/* Patient App Reschedule Modal */
.app-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.app-modal-content {
  background: var(--app-panel);
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

/* Responsive Overrides for Mobile Viewports */
@media (max-width: 480px) {
  body.simulator-body {
    padding: 0;
    background-image: none;
    background-color: var(--app-bg);
    align-items: stretch;
  }
  .phone-frame {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    border-radius: 0;
    border: none;
    padding: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
  }
  .phone-island {
    display: none;
  }
  .phone-screen {
    border-radius: 0;
    border: none;
    height: 100%;
    width: 100%;
  }
  .bottom-nav {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
}

/* Deals and Collapsible categories styles */
.deals-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.deal-card {
  background: var(--app-panel);
  border: 1px solid var(--app-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.deal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.deal-card-title {
  font-family: var(--app-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--app-gold);
}

.deal-card-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(20, 184, 166, 0.15);
  color: var(--app-gold);
  padding: 2px 6px;
  border-radius: 4px;
}

.deal-card-body {
  font-size: 12px;
  color: var(--app-text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.deal-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
  font-weight: 700;
}

.deal-card-price {
  font-size: 15px;
  color: #fff;
}

.timeline-category {
  margin-bottom: 16px;
  border: 1.5px solid rgba(20, 184, 166, 0.08);
  border-radius: 12px;
  overflow: hidden;
  background: var(--app-panel);
}

.timeline-category-header {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  font-weight: 700;
  font-size: 13px;
  transition: background 0.2s;
  user-select: none;
}

.timeline-category-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.timeline-category-header.completed {
  border-left: 4px solid var(--app-success);
  color: var(--app-success);
}

.timeline-category-header.scheduled {
  border-left: 4px solid var(--app-gold);
  color: var(--app-gold);
}

.timeline-category-header.missed {
  border-left: 4px solid var(--app-danger);
  color: var(--app-danger);
}

.timeline-category-content {
  display: none;
  padding: 12px 16px;
  flex-direction: column;
  gap: 12px;
  background: var(--app-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.timeline-category-content.active {
  display: flex;
}

.timeline-category-header i {
  transition: transform 0.2s;
}

.timeline-category-header.active i {
  transform: rotate(180deg);
}

.timeline-card-v2 {
  background: var(--app-panel);
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 10px;
  padding: 12px;
  position: relative;
}

.clinic-contact-card .call-btn {
  background: linear-gradient(135deg, #3B82F6 0%, #14B8A6 100%) !important;
  color: #0c101a !important;
  box-shadow: 0 4px 10px rgba(20, 184, 166, 0.2);
}

/* Records Subtabs styling */
.records-subtabs {
  display: flex;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.subtab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--app-text-muted);
  font-family: var(--app-font);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  text-align: center;
}

.subtab-btn.active {
  color: var(--app-gold);
  border-bottom-color: var(--app-gold);
}

/* Timeline Flat chronological cards */
.timeline-list-flat {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-card-flat {
  background: var(--app-panel);
  border: 1.5px solid rgba(20, 184, 166, 0.05);
  border-radius: 12px;
  padding: 14px;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Pull to refresh visual styling */
.pull-to-refresh-indicator {
  position: absolute;
  top: 40px;
  left: 0;
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--app-gold);
  font-size: 12px;
  font-weight: 600;
  transform: translateY(-50px);
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
}

.pull-to-refresh-indicator.pulling {
  transition: none;
}

.pull-to-refresh-indicator.loading {
  transform: translateY(0);
  opacity: 1;
}

.pull-to-refresh-indicator .spinner {
  transition: transform 0.1s linear;
}

.pull-to-refresh-indicator.loading .spinner {
  animation: spin 1s infinite linear;
}

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

/* Ensure the home screen has enough bottom padding to scroll past floating buttons */
#screen-home {
  padding-bottom: 150px !important;
}


