.doctor-list * {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
.doctor-list {
    --color-1: #0692ba;
    --color-1-dark: #0692ba2e;
    --color-1-light: #dcfffd99;
    --color-2: #ff9800;
    --color-2-dark: #fee4402e;
    --color-2-light: #fff7db99;
    --color-3: #e9407a;
    --color-3-dark: #9728572e;
    --color-3-light: #fff0f599;

    --gradient-1: linear-gradient(to right, #ff9dcd, #f2a5c0, #db8ea8);
    --gradient-2: linear-gradient(to right, #1a9383, #0294a9, #0095b6);

    --svg-large: 15px;
    --svg-small: 10px;

    direction: rtl !important;
    display: flex;
    flex-direction: column;
    gap: 40px;
  }
  .doctor-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding-top: 20px;
  }
  .doctor-pagination .page-numbers {
    padding: 8px 15px;
    border: 1px solid var(--color-1);
    color: var(--color-1);
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
  }
  .doctor-pagination .page-numbers.current,
  .doctor-pagination .page-numbers:hover {
    background-color: var(--color-1);
    color: white;
  }
  .doctor-pagination .prev, .doctor-pagination .next {
    font-weight: bold;
  }
  .flex-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .flex-column {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .btn {
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    cursor: pointer;
    padding: 2px 12px;
    border-radius: 50px !important;
    color: #ffffff !important;
  }
  .doctor-card {
    display: flex;
    flex-direction: column;
    padding: 25px;
    background: #ffffff;
    border-radius: 25px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.07);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
  }
  .doctor-card:hover {
    border-color: var(--color-1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.07);
  }
  .doctor-card svg {
    width: var(--svg-large);
    height: var(--svg-large);
  }
  .doctor-info {
    align-items: flex-start;
    gap: 1.5rem;
  }
  .doctor-info img {
    width: 200px;
    height: 200px !important; 
    border-radius: 20px !important;
    background: rgba(0, 0, 0, 0.03);
    object-fit: cover;
  }
  .details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
  }
  .details .top-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }
  .titles {
    align-items: flex-start;
    gap: 1rem;
  }
  .titles h3 {
    margin: 0;
    font-size: 2rem;
    color: #1f2937;
  }
  .titles h5 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-1);
  }
  .top-stats {
    gap: 1.5rem;
    color: #6b7280;
    font-size: 1rem;
  }
  .badge {
    display: flex;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-wieght: bold;
    background: var(--gradient-1);
  }
  .central-stats-group {
    display: flex;
    gap: 1.5rem;
    margin: 0;
  }
  .central-stat {
    flex: 1;
    border-radius: 20px;
    padding: 1.5rem 1rem;
    min-width: 0;
    text-align: center;
  }
  .central-stat:nth-child(1) {
    background: var(--color-1-light);
  }
  .central-stat:nth-child(2) {
    background: var(--color-2-light);
  }
  .central-stat:nth-child(3) {
    background: var(--color-3-light);
  }
  .central-stat .caption {
    font-size: 0.75rem;
    justify-content: center;
    margin-top: 5px;
  }
  .central-stat .flex-row {
    justify-content: center;
    gap: 0.5rem;
  }
  .location-container {
    position: relative;
    text-align: right;
}

.address-sub {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}
/* Extra Address Styling */
.extra-address-wrapper {
    margin-top: 4px;
    position: relative;
    display: inline-block;
}
.extra-trigger {
    font-size: 10px;
    color: #0692BA;
    cursor: help;
    background: #e6f4f8;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
}
.address-tooltip {
    visibility: hidden;
    opacity: 0;
    width: 240px;
    background: #ffffff;
    border-radius: 12px;
    padding: 14px;
    position: absolute;
    bottom: 140%;
    right: -10px;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    border: 1px solid #f0f0f0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    text-align: right;
    pointer-events: none;
}

.tooltip-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 6px;
}

.tooltip-header strong {
    font-size: 12px;
    color: #333;
}

.tooltip-address {
    font-size: 11px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.tooltip-footer {
    margin-top: 8px;
    font-size: 10px;
    color: #0692BA;
    background: #f0f9ff;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Show on hover */
.extra-address-wrapper:hover .address-tooltip {
    visibility: visible;
    opacity: 1;
    bottom: 115%;
}

  .service-type-group {
    display: flex;
    gap: 1rem;
  }
  .service-type {
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    font-size: 0.75rem;
  }
 .service-type-online {
    color: var(--color-1);
    background: var(--color-1-dark);
  }
  .service-type-in-person {
    color: var(--color-2);
    background: var(--color-2-dark);
  }
  .service-type-home {
    color: var(--color-3);
    background: var(--color-3-dark);
  }
  .service-type svg {
    width: var(--svg-small);
    height: var(--svg-small);
  }
  .insurance {
    font-size: 0.75rem;
    color: #6b7280;
  }
  .insurance span:not(:first-child) {
    color: #1f2937;
    font-weight: bold;
  }
  .divider {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
    margin: 1.5rem 0 !important;
  }
  .reserve-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .reserve-section > div:first-child {
    display: flex;
    flex-direction: column;
  }
  .btn.reserve {
    display: flex;
    gap: 0.5rem;
    background: var(--gradient-2);
    padding: 10px 20px;
  }
  .reservable-date {
    color: var(--color-1);
    font-size: 1.1rem;
    font-weight: bold;
  }
  .remaining-dates {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 5px;
  }
  .visit-fee-display {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1f2937;
    margin-left: 15px;
  }


/* --- */

.doctor-pagination {
    margin: 40px 0;
    text-align: center;
}

.doctor-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    border-radius: 6px;
    background: #f2f2f2;
    text-decoration: none;
    color: #333;
}

.doctor-pagination .page-numbers.current {
    background: #0692BA;
    color: #fff;
}

.doctor-pagination .page-numbers:hover {
    background: #ddd;
}

.doctor-pagination .first,
.doctor-pagination .last {
    font-weight: bold;
    background: #eee;
}


/* --- RESPONSIVE --- */

@media screen and (max-width: 768px) {
    .doctor-card {
        padding: 15px; /* Reduce padding to save screen estate */
    }

    /* Stack image and details vertically */
    .doctor-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.25rem;
    }

    /* Reduce image size and override inline HTML styles */
    .doctor-info img {
        width: 120px !important;
        height: 120px !important;
        border-radius: 50% !important; /* Circular portrait looks better on mobile */
    }

    .details {
        width: 100%;
        align-items: center;
    }

    .details .top-section {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }

    /* Center title texts */
    .titles {
        align-items: center;
    }

    .titles h3 {
        font-size: 1.4rem;
    }

    .titles h5 {
        font-size: 1.1rem;
    }

    .top-stats {
        justify-content: center;
    }

    /* Stack central stat boxes on top of each other */
    .central-stats-group {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .central-stat {
        width: 100%;
    }

    .central-stat.location-container {
        text-align: center;
    }

    /* Allow address to wrap to multiple lines on mobile */
    .address-sub {
        white-space: normal;
        max-width: 100%;
    }

    /* Center insurance and service badges */
    .service-type-group {
        justify-content: center;
        flex-wrap: wrap;
    }

    .insurance {
        text-align: center;
    }

    /* Stack bottom reservation area */
    .reserve-section {
        flex-direction: column;
        align-items: stretch; /* Allows button to span full width */
        gap: 1.5rem;
    }

    .reserve-section > div:first-child {
        align-items: center;
        text-align: center;
    }

    /* Stack fee display and button */
    .reserve-section > .flex-row:last-child {
        flex-direction: column;
        gap: 1rem;
    }

    .visit-fee-display {
        margin-left: 0;
    }

    .btn.reserve {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 1.1rem;
    }

    /* Center the tooltip to prevent overflowing screen boundaries */
    .address-tooltip {
        right: 50%;
        transform: translateX(50%);
        bottom: 120%;
    }
}
