/* ===========================
   iOS Scroll Fix
=========================== */
html {
  position: fixed;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  background: #f8f7f7;
  margin: 0;
  padding: 0;
}

/* ===========================
   Base / Reset / Safe Area
=========================== */
.main-container {
    padding: 1rem 15px;
    margin-bottom: 35px;;
}

/* Small screens (mobile) adjustments */
@media (max-width: 991.98px) {
    .main-container {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
}

/* ===========================
   Desktop Navbar
=========================== */
.navbar {
    background: #fdfdfd !important;
    position: fixed !important;
    top: 0 !important;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1030;
    padding-top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
    padding-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-light .navbar-nav .nav-link {
    color: #333;
}

.navbar-light .navbar-nav .nav-link.active {
    color: #b60606;
}

.navbar-brand {
    color: #333 !important;
}

/* ===========================
   Mobile Top Bar
=========================== */
.mobile-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1030;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0.5rem env(safe-area-inset-left);
  
  /* iOS scroll fix */
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
}

.mobile-top-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #333;
  text-decoration: none;
  border-radius: 50%;
  transition: all 0.3s ease;
  position: relative;
}

.mobile-top-icon i {
  font-size: 1.4rem;
}

.mobile-top-icon:hover,
.mobile-top-icon:active {
  color: #b60606;
  background: rgba(182, 6, 6, 0.1);
}

/* ===========================
   Mobile Bottom Navigation
=========================== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  z-index: 1030;
  border-top: 1px solid #e9ecef;
  
  /* iOS scroll fix */
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
}

.mobile-bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 0.5rem 0.25rem;
  text-decoration: none;
  color: #6c757d;
  transition: all 0.3s ease;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.mobile-bottom-nav .nav-item i {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
  transition: transform 0.3s ease;
}

.mobile-bottom-nav .nav-item span {
  font-size: 0.65rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

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

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

.mobile-bottom-nav .nav-item:active {
  background: rgba(182, 6, 6, 0.1);
}

/* Active indicator */
.mobile-bottom-nav .nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: #b60606;
  border-radius: 0 0 3px 3px;
  z-index: 1;
}

/* Ripple effect on tap */
.mobile-bottom-nav .nav-item::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(182, 6, 6, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: 0;
}

.mobile-bottom-nav .nav-item:active::after {
  width: 100px;
  height: 100px;
}

/* For devices with 5 or more nav items */
@media (max-width: 374px) {
  .mobile-bottom-nav .nav-item i {
    font-size: 1.1rem;
  }
  
  .mobile-bottom-nav .nav-item span {
    font-size: 0.6rem;
  }
  
  .mobile-topbar {
    font-size: 0.9rem;
  }
  
  .mobile-topbar img {
    width: 36px;
  }
}

/* Prevent iOS rubber band effect from showing behind navbars */
body::before {
  content: '';
  position: fixed;
  top: -100px;
  left: 0;
  right: 0;
  height: 100px;
  background: #f8f7f7;
  z-index: 1029;
}

body::after {
  content: '';
  position: fixed;
  bottom: -100px;
  left: 0;
  right: 0;
  height: 100px;
  background: #f8f7f7;
  z-index: 1029;
}

/* Desktop only */
@media (min-width: 992px) {
  body {
    padding-top: 0;
    padding-bottom: 0;
  }
  
  .main-container {
    padding-top: 60px !important;
  }
}

/* ===========================
   elements
=========================== */


pre {
    font-family: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.pane {
    display: inline-block;
    overflow-y: auto;
    overflow-x: auto;
    width: 100%;
    max-height: 600px;
}

.text-danger {
    color: #b60606 !important;
    caret-color: #b60606;
}

/* ===========================
   Container adjustments
=========================== */


.container.mt-3 {
    padding-top: calc(env(safe-area-inset-top, 0px) + 56px + 1rem);
    margin-top: 0 !important;
}

@supports (padding-top: env(safe-area-inset-top)) {
    body {
        padding-top: calc(env(safe-area-inset-top) + 56px);
    }

    .main-container {
        margin-top: 0;
        padding-top: 1rem;
    }

    .container.py-4 {
        padding-top: 1rem !important;
    }
}

@supports not (padding-top: env(safe-area-inset-top)) {
    body {
        padding-top: 56px;
    }

    .main-container {
        margin-top: 0;
        padding-top: 1rem;
    }

    .container.mt-3 {
        padding-top: calc(56px + 1rem);
    }

    .container.py-4 {
        padding-top: 1rem !important;
    }
}

/* ===========================
   Cards
=========================== */
.login-card {
    background: white;
    border-radius: 10px;
    padding: 40px;
    max-width: 500px;
    margin: 0 auto;
}

.white-card, .white-card-small, .white-card-workout {
    background: white;
    border-radius: 10px;
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
}

.white-card {
    padding: 40px;
}

.white-card-small {
    padding: 15px;
}

.white-card-workout {
    padding: 15px 25px;
    display: flex;
    flex-direction: column;
    height: auto;
}

.white-card-workout .card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0;
    margin-top: 10px;
}

.white-card-workout .workout-content {
    padding: 8px;
    margin: 0;
    white-space: pre-line;
    line-height: 1.1;
    font-size: 0.9rem;
    border-radius: 4px;
    flex-grow: 0;
}

.white-card-workout .card-body > .d-flex {
    margin-bottom: 0;
}

@media (max-width: 576px) {
    .white-card-workout {
        padding: 10px 15px;
    }
    .white-card-workout .card-body {
        padding: 5px 0 5px 0;
    }
}

/* ===========================
   Forms
=========================== */
.form-control:focus {
    border-color: #b60606;
}

textarea {
    caret-color: #b60606;
}

/* ===========================
   Buttons
=========================== */
.btn-primary {
    background: #b60606;
    border: none;
}

.btn-primary:hover {
    background: #b60606;
}

.btn-outline-primary {
    color: #b60606 !important;
    border-color: #b60606 !important;
}

.btn-outline-danger {
    color: #b60606 !important;
    border-color: #b60606 !important;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    color: #fff !important;
    background-color: #b60606 !important;
    border-color: #b60606 !important;
}

.btn-group .btn-check:checked + .btn {
  background-color: #b60606 !important; 
  border-color: #b60606 !important;
  color: #fff !important;
}

/* Optional: hover effect */
.btn-outline-primary:hover {
  background-color: #cfe2ff;
}

/* ===========================
   Backgrounds
=========================== */
.bg-danger {
    background-color: #b60606 !important;
}

.bg-light-grey {
    background-color: var(--light-grey) !important;
    border-bottom: 1px solid #dee2e6;
}

/* ===========================
   Tables
=========================== */
.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    border: 0.5px solid #e0e0e0;
    background: white;
    margin: 0;
    padding: 0;
}

.table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
    color: #212529;
}


.table thead.table-light {
    background: #d8d8d8;
    color: #212529;
    font-weight: 600;
    border-bottom: 0.5px solid #e0e0e0;
}

.thead-dark {
    background-color: #333;
    color: white;
}

.table th,
.table td {
    border: 0.75px solid #e8e8e8;
    padding: 0.75rem;
}

.table th {
    border-top: none;
    border-left: none;
}

.table th:last-child {
    border-right: none;
}

.table td {
    border-left: none;
}

.table td:last-child {
    border-right: none;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table thead tr:first-child th:first-child {
    border-top-left-radius: 10px;
}
.table thead tr:first-child th:last-child {
    border-top-right-radius: 10px;
}
.table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 10px;
}
.table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 10px;
}

.table-striped > tbody > tr {
    background-color: white;
}

.table tbody tr:hover {
    background: #f7f7f7;
    transition: background 0.2s ease;
}

/* ===========================
   Tabs
=========================== */
.nav-tabs {
    border-bottom: none !important;
}

.nav-tabs .nav-link {
    border: none;
    margin: 0 6px;
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 12px 16px;
    color: #555;
    transition: all 0.2s ease;

      padding: 0.25rem 0.5rem;   /* same vertical/horizontal padding as btn-sm */
    font-size: 0.875rem;       /* matches btn-sm font size */
}

.nav-tabs .nav-link.active {
    background-color: #b60606;
    color: white;
    font-weight: 600;
}

.nav-tabs .nav-link:hover {
    background-color: #e9ecef;
}



/* ===========================
   Badges
=========================== */
.badge-type {
    font-size: 0.85rem;
    padding: 0.4em 0.8em;
}

.badge-outline {
    background-color: transparent !important;
    border: 1px solid #b60606;
    color: #b60606;
}

.badge-outline-grey {
    background-color: transparent !important;
    border: 1px solid #b2b2b2;
    color: #b2b2b2;
}

.custom-badge-count {
    position: absolute;
    top: 0;
    left: 100%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.3em;
    height: 1.3em;
    border: 1.5px solid #000;
    border-radius: 50%;
    background-color: #fff;
    color: #000;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
}

  .badge-compact {
    font-size: 0.70rem;        /* smaller text */
    padding: 0.25em 0.5em;     /* tighter padding */
    line-height: 1;            /* reduces height */
    border-radius: 0.35rem;    /* optional: make badge softer */
  }

/* ===========================
   Calendar
=========================== */
.calendar-container {
    border-radius: 12px;
    overflow: hidden;
    background: white;
    border: none; 
     box-shadow: 0 4px 20px rgba(0,0,0,0.08);

}

.calendar-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse; 
    border-spacing: 0;
    background: white;
    color: #333;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);

}

.calendar-table th,
.calendar-table td {
    border: 0.75px solid #e0e0e0 !important;
}

.calendar-table thead th {
   
    background: #333;
    color: #fff;
}


.calendar-header {
    background: #333;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    border-bottom: 0.5px solid #e8e8e8;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.calendar-table thead tr:first-child th:first-child {
    border-top-left-radius: 12px;
}

.calendar-table thead tr:first-child th:last-child {
    border-top-right-radius: 12px;
}

.calendar-day {
    min-height: 100px;
    height: 100px;
    padding: 0.5rem;
    background: white;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #333;
    vertical-align: top;
    border: 0.5px solid #e0e0e0; 
}


.calendar-day.has-workout {
    background: #da8282;
    border: 0.5px solid #e0e0e0;

}

.calendar-day.has-workout:hover {
    background: #b65f5f;
}

.calendar-day:hover {
    background: #f8f9fa;
}

.calendar-day.today {
    background: #f8e1e1;
    border: 0.5px solid #e0e0e0;
    font-weight: 600;
}

.calendar-day.other-month {
    color: #bbb;
    background: #fafafa;
    pointer-events: none;
}

.calendar-day .day-number {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
    text-align: center;
}

.calendar-day .small {
    font-size: 0.65rem;
    line-height: 1.2;
    word-break: break-word;
    text-align: center;
}

.calendar-day .fw-bold {
    font-size: 0.7rem;
    text-align: center;
}

.calendar-day .text-muted {
    font-size: 0.6rem;
    text-align: center;
}

.calendar-day .workout-indicator,
.calendar-day .workout-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin: 1px auto;
}

@media (max-width: 576px) {
    .calendar-day {
        min-height: 60px;
        height: 60px;
        padding: 2px;
        font-size: 0.7rem;
    }
    .calendar-header {
        padding: 6px 1px;
        font-size: 0.65rem;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .calendar-day {
        min-height: 90px;
        height: 90px;
    }
}

/* ===========================
   Stats Cards
=========================== */
.stat-card {
    background: var(--light-grey);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}



/* ===========================
   Favorites / Stars
=========================== */
.favorite-star {
    color: #ffc107;
    font-size: 1.4rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.favorite-star:hover {
    transform: scale(1.2);
}

.favorite-star.far {
    color: #dee2e6;
}

.favorite-star.far:hover {
    color: #ffc107;
}

/* ===========================
   Cards Misc / Containers
=========================== */
.bg-light-grey {
    background-color: var(--light-grey) !important;
    border-bottom: 1px solid #dee2e6;
}

.bg-dark {
  background-color: #333 !important; /* your custom color */
  color: #fff !important;            /* optional: keep text readable */
}

.card {
    border: 1px solid #dee2e6;
}

.card-title {
    color: #495057;
    font-weight: 600;
}

#heatmapContainer {
    max-width: 100%;
    position: relative;
}

#heatmapChart {
    min-width: 800px;
}

/* ===========================
   Modals
=========================== */
.modal-content {
    border: none !important;
}

.modal-header,
.modal-footer {
    border: none !important;
}

/* ===========================
   Dropdowns
=========================== */
.dropdown-item:active,
.dropdown-item:focus {
    background-color: #f0f0f0 !important;
    color: #000 !important;
}

.dropdown-item:hover {
    background-color: #e9e9e9;
    color: #000;
}

/* ===========================
   Status
=========================== */

#status_completed:checked {
  background-color: #198754;
  border-color: #198754;
}

.form-check-input:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#sessionStatusModal .input-group-text {
  min-width: 60px;
}

#sessionStatusModal input[type="number"] {
  text-align: center;
}

/* Animate completed status */
#completedLabel strong {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ===========================
   cards
=========================== */


.design-label {
    background: #333;
    color: white;
    padding: 8px 16px;
    border-radius: 12px 12px 12px 12px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.card-design-1 {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden; /* Changed from visible to hidden */
}

.card-design-1-border {
    background: white;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    padding: 16px;
    overflow: hidden; /* Changed from visible to hidden */
}

.card-design-1-header {
    background: #2c2c2c;
    margin: -16px -16px 16px -16px;
    padding: 12px 16px;
    border-radius: 12px 12px 0 0;
    color: white;
}

.card-design-1-header-2 {
    background: #b60606;
    margin: -16px -16px 16px -16px;
    padding: 12px 16px;
    border-radius: 12px 12px 0 0;
    color: white;
}


.card-design-1 .badge-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.card-design-1 .workout-content {
    border-radius: 6px;
    padding-top: 5px;

    padding: 0px;
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0;
}

.card-design-1 .action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.card-design-1 .action-btn:hover {
    background: #b60606 !important;
    border-color: transparent !important;
    color: white !important;
}


/* ===========================
   account status
=========================== */



 /* Status Badge Styles */
  .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
  }

  .status-badge i {
    font-size: 0.7rem;
    margin-right: 0.25rem;
  }

  .status-active {
    background: linear-gradient(135deg, #089c70);
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
  }

  .status-trialing {
    background: #ffb300;
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
  }

  .status-canceled {
    background: #6c757d;
    color: white;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
  }

  .status-past_due {
    background: l#bd2130;
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
  }

  .status-incomplete {
    background: #e8590c;
    color: white;
    box-shadow: 0 2px 8px rgba(253, 126, 20, 0.3);
  }

  .status-unpaid {
    background: #dc3545;
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
  }

  .status-canceled-active {
    background: #ff5722;
    color: white;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
  }

  .status-trial-canceled {
    background: #ff9800;
    color: white;
    border-radius: 8px;
  }

  /* Pulse animation for trial */
  @keyframes pulse {

    0%,
    100% {
      opacity: 1;
    }

    50% {
      opacity: 0.7;
    }
  }

  .status-trialing {
    animation: pulse 2s infinite;
  }


/* ===========================
   pricing cards
=========================== */



   .pricing-card {
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 28px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    height: 100%;
  }

  .pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15) !important;
  }

  .pricing-card.current-plan {
    background: linear-gradient(135deg, #28a74510 0%, #20c99710 100%);
  }

  .plan-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
  }
