
/* --- Card Icon + Grid Alignment --- */
.header-titles .status-counter {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

#edit-meds-btn,
.menu-trigger-btn {
  font-size: 14px;
  font-weight: 500;
  color: var(--blue-accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* --- Invisible Outer Container --- */
#med-list {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- Empty Vacancy Box (Centered Vertical Stack) --- */
.med-empty-vacancy {
  min-height: 180px;
  border: 3px dashed var(--text-muted)
;
  border-radius: 18px;
  display: flex;
  flex-direction: column; /* Stacks text on top, image directly below */
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  background: var(--other);
  transition: background-color 0.15s ease, transform 0.1s ease;
  user-select: none;
  color:var(--text-4)
}

.med-empty-vacancy:active {
  background-color: #2890ff19;
  border-color: var(--blue-accent);
  color: var(--blue-accent);
  transform: scale(0.99);
}

/* Row wrapper for pen icon + "Tap to Create" text */
.vacancy-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
  margin-top: 10px;
}

.vacancy-label-group svg {
  width: 22px;
  height: 22px;
}

/* Tactile 3D Cluster Image */
.vacancy-cluster-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.1));
  pointer-events: none;
  user-select: none;
}











.med-card-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

/* Circular container using your app's theme tint */
.med-icon-badge {
  width: 74px;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0; /* Box edges align with card */
}


/* 3D PNG scaling & lighting lift */
.med-3d-img {
  width: 48px;
  height: auto;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}


.item-actions{
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- Content Column --- */
.med-info-stack {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 12px 14px;
  flex: 1;
}

.med-name-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.med-sub-details {
  font-size: 11px;
  font-weight: 560;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Right Chevron Anchor */
.med-chevron {
  display: flex;
  align-items: center;
  padding-right: 10px;
  height: 40px;
  margin: auto;
  width: auto;
  color: var(--text-muted);
  user-select: none;
}




.med-item {
  /* Prevents iOS from popping up callout menus / loupes on press & hold */
  -webkit-touch-callout: none;
  
  /* Prevents text highlighting/selection across all browsers */
  -webkit-user-select: none;
  user-select: none;

  /* Crucial for mobile: Tells browser this element handles horizontal swipes */
  touch-action: pan-y;
}
/* Ensure child text elements inherit user-select: none, NOT pointer-events: none */
.med-card-wrapper,
.med-grid,
.med-name,
.med-dosage,
.med-time,
.logged-status {
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto; /* Restore standard pointer events */
}

/* --- Medication List Item Styles --- */
/* Card Container */
.med-item {
  display: flex;
  align-items: stretch; /* Stretches the left badge to full card height */
  background: var(--card-bg);
  border-radius: 18px;
  overflow: hidden; /* Clips the left badge to card corners */
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  position: relative;
  user-select: none;
  touch-action: pan-y;
  transition: opacity 0.25s ease, transform 0.15s ease;
  min-height: 70px;
}


.med-item.completed {
  opacity: 0.4;
  filter: grayscale(40%);
}

.med-item.completed .med-name {
  text-decoration: line-through;
  color: rgba(255, 255, 255, 0.6);
}

/* 2x2 Grid Content Container */
.med-grid {
  display: grid;
  grid-template-columns: 1fr auto; /* Left side expands, Right side fits content */
  grid-template-rows: auto auto;
  gap: 0px 16px;
  width: 100%;
  align-items: center;
}

/* Quadrant Positioning */
.med-name {
  grid-column: 1;
  grid-row: 1;
  font-size: 17px;
  font-weight: 600;
}

.med-dosage {
  grid-column: 1;
  grid-row: 2;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}
.med-time {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  grid-row: 1;
  text-align: right;
  font-size: 14px;
  font-weight: 660;
}





/* Hidden by default */
.med-delete-btn {
  display: none;
  background: #ff4000;
  color: #fffbf6;
  border: none;
  border-radius: 12px;
  width: 32px;
  height: 36px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.4s ease;
}

.med-delete-btn:active {
  transform: scale(0.85);
}

/* When Edit Mode is active on the list */
.med-list.editing .med-delete-btn {
  display: inline-flex;
}

.med-list.editing .logged-status {
  opacity: 0.3; /* Soften checkboxes/status during edit */
  pointer-events: none;
}




/* Compact the reminder section */
.reminder-settings-group {
  margin-top: 10px;
  margin-bottom: 10px;
}




/* ==========================================
   PULL-UP BOTTOM SHEET (MODAL REPLACEMENT)
   ========================================== */

/* Full-screen viewport backdrop */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;;
  height: 100vh;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: auto;
}

.bottom-sheet-overlay.hidden {
  display: none !important;
}

.bottom-sheet-backdrop {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: all 1.2s;
}

/* Floating Bottom Sheet Card */
.bottom-sheet-card {
  position: relative;
  width: 100%;
  margin: 0 auto;
  background: var(--card-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -12px 40px rgba(9, 10, 10, 0.155);
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 82vh;
  transform: translateY(100%);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.bottom-sheet-overlay.open .bottom-sheet-card {
  transform: translateY(0);
}

.bottom-sheet-card.fullscreen {
  height: 92vh;
  border-radius: 20px 20px 0 0;
}

/* iOS-Style Grabber Zone */
.sheet-grabber-zone {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  flex-shrink: 0;
}

.sheet-grabber-bar {
  width: 90px;
  height: 5px;
  border-radius: 10px;
  background: rgba(151, 151, 151, 0.5);
  transition: background-color 0.2s ease, width 0.2s ease;
}

.sheet-grabber-zone:hover .sheet-grabber-bar {
  background: rgba(102, 102, 102, 0.6);
  width: 120px;
}

/* Scrollable Form Body */
.sheet-body {
  padding: 0 20px 28px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sheet-body .card-header h2 {
  font-size:20px;
  font-weight: 500;
  color: var(--text-2);
  margin-top: 10px;
  margin-left: 4px;
}

/* --- FORM LABELS & INPUTS --- */
#med-form label,
#med-form .section-sublabel {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight:600;
  color: var(--text-3);
  margin: 12px 0 4px 4px;
}

#med-form label svg,
#med-form .section-sublabel svg {
  flex-shrink: 0;
}
#med-form input[type="time"]{
    width: 92%;
}
#med-form input[type="text"], #med-form select {
  width: 100%;
}

#med-form input[type="text"],
#med-form input[type="time"],
#med-form select {
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--bg-color);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 500;
  outline: none;
  box-sizing: border-box;
  border: 1px solid #2f2f2f0f;
  box-shadow: inset 0 1px 1px hsla(0, 0%, 0%, 0.04);
  transition: border-color 0.2s ease, background 0.2s ease;
}

#med-form input::placeholder {
  color:var(--text-muted);
  opacity: 1; /* Firefox */
}

#med-form input[type="text"]:focus,
#med-form input[type="time"]:focus,
#med-form select:focus {
  border-color: var(--blue-accent);
}

#med-form select option {
  color: #ffffff;
}

/* --- REMINDER CHIPS --- */
.reminder-chips-grid {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.reminder-chip {
  flex: 1;
  margin: 0 !important;
}

.reminder-chip input[type="checkbox"] {
  display: none;
}



.icon-option {
  margin: 0 !important;
}

.icon-option input[type="radio"] {
  display: none;
}



.icon-box svg {
  width: 22px;
  height: 22px;
}





/* --- BOTTOM ACTION BUTTONS --- */
.modal-btn-group {
  display: flex;
  gap: 12px;
  margin-top: 44px;
  width: 100%;
}

.modal-btn-group button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  border-radius: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  font-size: 15px;
  font-weight: 600;
}



.btn-primary,.btn-secondary, svg{
  height: 25px;
  width: auto;
}
.btn-primary, .btn-secondary {
  flex: 1;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
}
.btn-primary { background: #4f4476; color: #ffffff; border: none;
    box-shadow: 0 1px 20px rgba(48, 134, 255, 0.056);

 }
.btn-secondary { background:var(--other); color: var(--text-2);
  margin-right: 8px; border: none
}

.med-reminder-icon{
  height: 18px;
  width: auto;
}

.med-test-btn{
  border: none;
  padding: 10px;
  margin-top: 10px;
  border-radius: 10px;
  color: var(--blue-accent);
  font-size: 14px;
}








.consistency-card{
  padding: 14px;
  display: none;
  border-radius: 18px;
  border: none;
  background-image: linear-gradient(rgb(250, 164, 26), rgb(236, 78, 5));
}
.consistency-header{
  display: flex;
  align-items: center;
  gap: 14px;
}
.consistency-header h1{
  font-size: 16px;
  color: white;
}












/* Container Wrapper */
.action-menu-wrapper {
  position: relative;
  display: inline-block;
}

/* Trigger Button (Three Dots) */
.menu-trigger-btn {
  background: none;
  border: none;
  color: var(--text-3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.07s ease;
}
.menu-trigger-btn svg{
  height: 34px;
  width: auto;
}

.menu-trigger-btn:active {
  transform: scale(0.8);
  background: var(--other);
}
/* Dark Floating Popover */
.action-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 180px;
  padding: 6px 8px;
  transform-origin: top right;
  opacity: 0;
  transform: scale(0.3) translateY(-6px);
  pointer-events: none;
  visibility: hidden;
  transition: 
    opacity 0.4s ease,
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    visibility 0.3s;
  will-change: transform, opacity;
  z-index: 999;
}

.action-menu-popover:not(.hidden) {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
  visibility: visible;
}
.action-menu-item svg {
  flex-shrink: 0;
  width:24px;
  height: 24px;
}

.action-menu-item:hover,
.action-menu-item:active {
  background: var(--other);
  border-radius: 12px;
}









/* Card container relative position & touch isolation */
.med-item {
  position: relative;
  -webkit-touch-callout: none; /* Disables browser default link/image popups on iOS */
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, opacity 0.3s ease;
}

/* Visual squeeze feedback during the 500ms hold */
.med-item.holding {
  transform: scale(0.9);
  box-shadow: 0 0 0 3px #0099ff;
}
.med-item.holding .med-item{
  background-color: #fd2600;
}

.med-list{
  border-radius: 26px;
  display: flex;
  flex-direction: column;
  gap: 8px; /* Adjust to 8px - 12px depending on how much breathing room you want */
  list-style: none;
  margin: 0;
}
/* Method 1: Existing Batch Edit Mode delete button */
.med-list.editing .med-delete-btn {
  display: inline-flex;
}

/* Method 2: iOS-Style Floating Corner Delete Badge */
.med-hold-delete-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #fd2600;
  color: #ffece9;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 13px;
  padding: 2px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 58, 48, 0.408);
  cursor: pointer;
  z-index: 250000;
  animation: popInBadge 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popInBadge {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}












/* --- ITEM ACTION CONTEXT MENU --- */
.item-action-menu-popover {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 16px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 18px;

  background: rgba(255, 255, 255, 0.202);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(244, 244, 244, 0.1);
  box-shadow: 
    inset 1px 1px 0 rgba(255, 255, 255, 0.747),
    inset -1px -1px 0 rgba(255, 255, 255, 0.503),
    inset 0px 0px 6px 0px rgba(255, 255, 255, 0.484),
    
    0px 8px 300px #16161662;

  z-index: 9999;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  min-width: 180px;
}

.action-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px;
  background: transparent;
  width: 100%;
  text-align: left;
  border: none;
  font-size: 15px;
  font-weight: 560;
  color: var(--text-main);
  border-radius: 8px;
  cursor: pointer;
}

.item-action-menu-popover .action-menu-item svg {
  color: var(--text-2);
  width: 28px;
  height: auto;
}

.item-action-menu-popover .action-menu-item:hover,
.item-action-menu-popover .action-menu-item:active {
  background: var(--other);
}

.item-action-menu-popover .action-menu-item.delete-text {
  color: #f64c1d; 
}
.item-action-menu-popover .action-menu-item.delete-text svg {
  color: #f64c1d;
}


@keyframes popIn {
  from { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
