html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  position: relative;
  min-height: 100%;
}

main {
  padding-bottom: 60px;
}

/* ================================
   iOS zoom prevention (FINAL)
   ================================ */

@media (max-width: 768px) {
  .form-control,
  input.form-control,
  textarea.form-control,
  select.form-control {
    font-size: 16px !important;
  }

  html {
    -webkit-text-size-adjust: 100%;
  }
}

/* ================================
   Focus styles
   ================================ */

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ================================
   Form floating tweaks
   ================================ */

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ================================
   Sticky Search Bar
   ================================ */

.search-sticky {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* ================================
   Clickable rows / cards
   ================================ */

.clickable-row {
  cursor: pointer;
}

/* Household member cards */
.household-member,
.card.clickable-row {
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.household-member:hover,
.card.clickable-row:hover {
  background-color: #f8f9fa;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.household-member:focus-visible,
.card.clickable-row:focus-visible {
  outline: none;
  background-color: rgba(37, 140, 251, 0.12);
}

/* ================================
   Inline edit icons
   ================================ */

.inline-edit {
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.7;
  margin-left: 6px;
}

.inline-edit:hover {
  opacity: 1;
}

/* ================================
   Copyable fields (button feel)
   ================================ */

.copyable {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.copyable:hover {
  background-color: rgba(37, 140, 251, 0.12);
}

.copyable:active {
  background-color: rgba(37, 140, 251, 0.22);
  transform: scale(0.97);
}

/* ================================
   Desktop table affordance
   ================================ */

@media (min-width: 768px) {
  table.table-hover tbody tr {
    transition: background-color 0.15s ease, transform 0.08s ease;
  }

  table.table-hover tbody tr:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
  }

  table.table-hover td {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
}

table.table-hover tbody tr:focus-visible {
  outline: none;
  background-color: rgba(37, 140, 251, 0.12);
}

/* ================================
   Table mobile improvements
   ================================ */

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 576px) {
  table.table td,
  table.table th {
    padding: 0.5rem 0.4rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  table.table td:first-child {
    white-space: normal;
    font-weight: 500;
  }
}

table.table a {
  text-decoration: none;
}

table.table a:hover {
  text-decoration: underline;
}

/* ================================
   Mobile Contact Cards
   ================================ */

.contact-card {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 12px;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-card:hover {
  background-color: rgba(0, 0, 0, 0.04);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.contact-card:focus-visible {
  outline: none;
  background-color: rgba(37, 140, 251, 0.12);
}

@media (hover: none) {
  .contact-card:active {
    background-color: rgba(0, 0, 0, 0.06);
  }
}

/* ================================
   Floating Add Contact Button
   ================================ */

.add-contact-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1050;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 576px) {
  .add-contact-fab {
    bottom: 16px;
    right: 16px;
    padding: 10px 14px;
    font-size: 0.95rem;
  }
}

/* ================================
   Toast notifications
   ================================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
}

.toast {
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ================================
   Household member cards (no hover affordance)
   ================================ */

.household-member {
  cursor: default;
  transition: none;
  -webkit-tap-highlight-color: transparent;
}

.household-member:hover,
.household-member:focus-visible {
  background-color: inherit;
  box-shadow: none;
}

/* ================================
   Household member list (non-card style)
   ================================ */

.household-member {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid #e9ecef;
  background-color: transparent;
  box-shadow: none;
}

.household-member:first-child {
  border-top: 1px solid #e9ecef;
}

.household-member .card-body {
  padding: 0.75rem 0.25rem;
}

.address-label {
  user-select: none;
  color: var(--bs-secondary-color);
  margin-right: 6px;
}

.address-value {
  user-select: text;
}

.address-value::selection {
  background-color: rgba(37, 140, 251, 0.18);
}

/* Labels should never be selected */
.field-label {
  user-select: none;
  color: var(--bs-secondary-color);
  margin-right: 6px;
}

/* Values should be selectable */
.field-value {
  user-select: text;
}

/* Optional: nicer selection highlight for values */
.field-value::selection {
  background-color: rgba(37, 140, 251, 0.18);
}

/* Ensure values are isolated so triple-click targets only the value */
.field-value {
  display: inline-block;
  white-space: nowrap;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.address-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.address-label {
  user-select: none;
  color: var(--bs-secondary-color);
  white-space: nowrap;
}

.address-value {
  user-select: text;
}

/* Copy button */
.copy-btn {
  opacity: 0;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 4px;
  color: var(--bs-secondary-color);
}

.address-row:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  color: var(--bs-primary);
}

/* Sidebar nav pills override */
.nav-pills .nav-link {
    color: #212529;
    background-color: transparent;
}

.nav-pills .nav-link:hover {
    background-color: #f1f3f5;
    color: #000;
}

.nav-pills .nav-link.active,
.nav-pills .nav-link:focus {
    background-color: transparent !important;
    color: #212529 !important;
    box-shadow: none;
}

/* Tighten sidebar on mobile */
@media (max-width: 767.98px) {
    nav {
        padding-bottom: 0 !important;
        border-bottom: 1px solid #dee2e6;
    }

    main {
        padding-top: 0 !important;
    }
}

/* ================================
   Smooth collapse / expand panels
   ================================ */
.collapse-panel {
    overflow: hidden;

    /* Motion */
    transition:
        max-height 0.35s ease,
        opacity 0.2s ease,
        transform 0.25s ease;

    /* Expanded state */
    max-height: 900px; /* comfortably above form height */
    opacity: 1;
    transform: translateY(0);
}

.collapse-panel.hidden {
    /* Collapsed state */
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);

    /* Prevent interaction while hidden */
    pointer-events: none;
}
/* Login page subtle entrance */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    animation: fadeUp 380ms ease-out;
}

.login-logo {
    animation: fadeUp 260ms ease-out;
}

/* Mobile login card adjustments */
@media (max-width: 576px) {
    .login-card {
        max-width: none;
        width: 100%;
        min-height: 100vh;
        border-radius: 0;
        padding: 1.75rem 1.25rem;
        box-shadow: none;
    }

    body {
        background: #fff;
    }
}

/* This is for updating Households/Details.cshtml */
.detail-field {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    line-height: 1.4;
}

.detail-label {
    font-weight: 600;
    min-width: 80px;
    color: #6c757d;
    flex-shrink: 0;
}

.detail-value {
    white-space: nowrap;
}

/* Inline icon actions (call / text) */
.icon-action {
    color: var(--bs-secondary-color);
    text-decoration: none;
    line-height: 1;
}

.icon-action:hover {
    color: var(--bs-primary);
}

.phone-action {
    font-size: 1.25rem; /* increase icon size */
    color: #6c757d;     /* subtle, not highlighted */
    text-decoration: none;
}

.phone-action:hover {
    color: #212529;     /* slightly darker on hover */
}

.icon-action i {
    vertical-align: middle;
}

.icon-action i {
    font-size: 1.6rem;   /* 🔥 this is the key */
    color: #6c757d;
}

.icon-action:hover i {
    color: #212529;
}

.icon-action {
    padding: 2px;
}

/* Icons for call, text, email */
a.text-muted {
    cursor: pointer;
}

a.text-muted:hover {
    color: #0d6efd !important;
}

.readonly-field {
    background-color: #f8f9fa;
    color: #495057;
    cursor: not-allowed;
}

select[readonly] {
    pointer-events: none;
    background-color: #f8f9fa;
}

/* Carrier logo sizing in plan tables */
.carrier-logo {
    height: 36px;
    width: auto;
}

/* Spacing for plan table rows */
td[data-plan-id] {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

/* ================================
   Plan cards (Quote Details)
   ================================ */

.plan-card {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem; /* 👈 THIS creates spacing between plans */
    box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
}

.quote-page-bg {
    background-color: #f6f7f9;
    min-height: 100vh;
}

.table-responsive {
    background: transparent;
}

/* ================================
   Plan cards – mobile layout
   ================================ */

@media (max-width: 576px) {

    .plan-card {
        padding: 1rem;
    }

    .plan-grid > div {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Premium: hero on top */
    .plan-grid .col-3:first-child {
        text-align: center;
    }

    .plan-grid .col-3:first-child .fw-bold {
        font-size: 2rem;
    }

    /* Deductible smaller */
    .plan-grid .col-3:nth-child(2) .fw-semibold {
        font-size: 1.25rem;
    }

    @media (max-width: 576px) {

        /* Benefits: two-column grid on mobile */
        .plan-grid .col-3:nth-child(3),
        .plan-grid .col-3:nth-child(4) {
            width: 100%;
        }

        .plan-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            column-gap: 1rem;
            row-gap: 0.5rem;
        }

        /* Benefit labels */
        .plan-grid .col-3:nth-child(3) div {
            text-align: left;
            font-size: 0.9rem;
            color: #6c757d;
        }

        /* Benefit values */
        .plan-grid .col-3:nth-child(4) div {
            text-align: right;
            font-weight: 500;
            font-size: 0.9rem;
        }
    }

    /* Links + button stack */
    .plan-card .d-flex.align-items-center {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .plan-card form button {
        width: 100%;
    }
}

@media (max-width: 576px) {

    /* Center plan links on mobile */
    .plan-card .d-flex.flex-wrap.gap-3.small {
        justify-content: center;
        text-align: center;
    }

    .plan-card .d-flex.flex-wrap.gap-3.small a {
        justify-content: center;
        text-align: center;
    }
}

/* ================================
   Larger Select button (all devices)
   ================================ */

.plan-card form button {
    font-size: 1.1rem;
    padding: 0.75rem 1.25rem;
    min-width: 140px;
}

/* Separator between medications and providers */
.medication-provider-separator {
    border-top: 1px solid #dee2e6;
}

/* ================================
   Calendar styles
   ================================ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 6px 0;
    background: #f8f9fa;
}

.calendar-cell {
    border: 1px solid #dee2e6;
    min-height: 110px;
    padding: 4px;
    overflow-y: auto;
    background: #fff;
}

.calendar-cell.empty {
    background: #f8f9fa;
}

.calendar-day {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.calendar-event {
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 📱 Mobile */
@media (max-width: 768px) {
    .calendar-cell {
        min-height: 80px;
        font-size: 0.65rem;
    }

    .calendar-header {
        font-size: 0.7rem;
    }
}

/* Calendar day link styles */
.calendar-link {
    text-decoration: none;
    color: inherit;
}
.calendar-link:hover {
    background: #f8f9fa;
}
#calendar-wrapper {
    transition: transform .4s ease, opacity .4s ease;
}

#calendar-wrapper.zoomed {
    transform: scale(1.15);
    opacity: 0;
    pointer-events: none;
}

.day-overlay {
    position: fixed;
    inset: 0;
    background: white;
    z-index: 1050;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 60px;
}

.day-panel {
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    animation: zoomIn .35s ease;
}

.day-overlay {
    align-items: stretch;
}

@keyframes zoomIn {
    from { transform: scale(.9); opacity: 0 }
    to   { transform: scale(1); opacity: 1 }
}

/* Day agenda styles */
.day-agenda {
    border-top: 1px solid #e5e7eb;
}

.time-row {
    display: grid;
    grid-template-columns: 84px 1fr; /* ⬅ more room for "10:00 PM" */
    min-height: 32px;
    border-bottom: 1px solid #f1f3f5;
    font-size: 0.85rem;
}

.time-label {
    text-align: right;
    padding: 4px 8px;
    color: #6c757d;
    border-right: 1px solid #f1f3f5;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.time-slot {
    padding: 4px 8px;
    position: relative;
}

.time-slot.event {
    background: #e7f1ff;
    border-left: 3px solid #0d6efd;
    font-weight: 500;
}

/* Sticky day header */
.day-header{
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
    padding: 8px 0 10px 0;
    border-bottom: 1px solid #f1f3f5;
    display: flex;
    gap: 12px;
    align-items: center;
}

.calendar-cell.today {
    outline: 2px solid #0d6efd;
    background: #e7f1ff;
}

/* ================================
   Day view – hour blocks
   ================================ */

.time-slot {
    position: relative;
    height: 48px;              /* one hour height */
    background:
        linear-gradient(
            to bottom,
            transparent 50%,
            #f1f3f5 50%
        );
    background-size: 100% 24px; /* half-hour guide */
}

/* Event block */
.calendar-block {
    position: absolute;
    left: 4px;
    right: 4px;
    height: 20px;
    background: #0d6efd;
    color: #fff;
    font-size: 0.75rem;
    border-radius: 6px;
    padding: 2px 6px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}

/* Half-hour positioning */
.calendar-block.half {
    top: 26px;
}

.calendar-block.full {
    top: 4px;
}

/* Hover affordance */
.calendar-block:hover {
    background: #0b5ed7;
}

/* Clickable empty slot affordance */
.time-slot:hover {
    background-color: rgba(13,110,253,0.04);
    cursor: pointer;
}

.calendar-event {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    line-height: 1.2;
    margin: 0;
    padding: 0;
}

.calendar-event-time {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    flex-shrink: 0;
}

.calendar-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Month header with arrows */
.calendar-month-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.month-title {
    margin: 0;
    min-width: 180px;
    text-align: center;
}

.month-nav {
    font-size: 1.4rem;
    text-decoration: none;
    color: #495057;
    padding: 4px 10px;
    border-radius: 6px;
}

.month-nav:hover {
    background-color: #f1f3f5;
    color: #000;
}

@media (max-width: 767.98px) {
    #mobileSidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 85%;
        max-width: 280px;
        z-index: 1040;
        overflow-y: auto;
        background: #fff;
    }
}

/* ================================
   Mobile sliding sidebar
   ================================ */
@media (max-width: 767.98px) {

    .mobile-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 85%;
        max-width: 280px;
        background: #fff;
        z-index: 1040;

        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .mobile-sidebar.open {
        transform: translateX(0);
    }

    /* Prevent background scroll when open */
    body.sidebar-open {
        overflow: hidden;
    }
}
