/**
 * Tutoring Marketplace Frontend Styles
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --primary: #107896;
    --primary-light: rgba(16, 120, 150, 0.1);
    --primary-fg: #ffffff;
    --accent: #e56e43;
    --accent-fg: #ffffff;
    --save: #16a34a;
    --save-light: rgba(22, 163, 74, 0.1);
    --star: #facc15;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --card-bg: #ffffff;
    --bg: #eef1f5;
    --secondary: #f3f4f6;
    --overlay: rgba(255, 255, 255, 0.6);
    --overlay-dark: rgba(255, 255, 255, 0.7);
}

/* ============================================
   Utility Classes
   ============================================ */
.rounded-4 { border-radius: 4px !important; }
.tracking-wide { letter-spacing: 0.05em; }
.tracking-wider { letter-spacing: 0.15em; }
.tracking-widest { letter-spacing: 0.2em; }
.text-11 { font-size: 0.6875rem; }
.text-13 { font-size: 0.8125rem; }
.text-10 { font-size: 0.625rem; }
.text-primary-c { color: var(--primary) !important; }
.text-muted-c { color: var(--text-muted) !important; }
.text-accent-c { color: var(--accent) !important; }
.bg-primary-c { background: var(--primary) !important; }
.bg-accent-c { background: var(--accent) !important; }
.bg-secondary-c { background: var(--secondary) !important; }
.bg-primary-light { background: var(--primary-light) !important; }
.view-hidden { display: none !important; }

/* ============================================
   Buttons
   ============================================ */
.btn-cta {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.625rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 6px rgba(229, 110, 67, 0.2);
    transition: filter 0.2s, box-shadow 0.2s, transform 0.1s;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}
.btn-cta:hover { filter: brightness(1.1); box-shadow: 0 10px 15px rgba(229, 110, 67, 0.3); color: #fff; }
.btn-cta:active { transform: scale(0.98); }

.btn-subscribe {
    border: 2px solid rgba(16, 120, 150, 0.7);
    border-radius: 4px;
    background: transparent;
    color: var(--primary);
    padding: 0.35rem 1rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
}
.btn-subscribe:hover { background: var(--primary); color: #fff; box-shadow: 0 4px 6px rgba(16, 120, 150, 0.2); }

.btn-close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    background: var(--secondary);
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-close-modal:hover { background: var(--border); color: var(--text); }

.btn-back {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
    background: var(--secondary);
    border: none;
    border-radius: 4px;
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}
.btn-back:hover { background: var(--border); color: var(--text); }

/* ============================================
   Sidebar
   ============================================ */
.sidebar-inner {
    position: sticky;
    top: 20px;
}

.sidebar-header {
    border-radius: 4px;
    background: var(--primary);
    padding: 0.625rem 1rem;
    box-shadow: 0 4px 6px rgba(16, 120, 150, 0.2);
}
.sidebar-header h3 {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--primary-fg);
    margin: 0;
}

.sidebar-item {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    border-radius: 4px;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card-bg);
    color: var(--text);
    text-align: left;
}
.sidebar-item:hover { background: var(--secondary); }
.sidebar-item.active { background: var(--accent); color: #fff; box-shadow: 0 1px 3px rgba(229, 110, 67, 0.2); }

.sidebar-children {
    margin-left: 0.75rem;
    padding-left: 0.5rem;
    border-left: 2px solid rgba(16, 120, 150, 0.2);
}

.sidebar-child {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.sidebar-child:hover { background: var(--secondary); color: var(--text); }
.sidebar-child.active { background: rgba(229, 110, 67, 0.8); color: #fff; }

/* ============================================
   Video Promo (Sidebar)
   ============================================ */
.video-promo {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s;
}
.video-promo:hover { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
.video-promo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; filter: brightness(0.65); transition: filter 0.3s; }
.video-promo:hover img { filter: brightness(0.5); }

.video-promo-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.video-promo-play {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: var(--accent);
    box-shadow: 0 4px 6px rgba(229, 110, 67, 0.3);
    margin-bottom: 0.5rem;
    transition: transform 0.2s;
}
.video-promo:hover .video-promo-play { transform: scale(1.1); }

.video-promo-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary);
    padding: 0.75rem 1rem;
}

/* ============================================
   Tutor Card
   ============================================ */
.tutor-card {
    border: 1px solid rgba(229, 231, 235, 0.6);
    border-radius: 4px;
    background: var(--card-bg);
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.tutor-card:hover { transform: translateY(-2px); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); border-color: rgba(16, 120, 150, 0.2); }

.tutor-card-left {
    width: 10rem;
    flex-shrink: 0;
    gap: 0.75rem;
}

.tutor-photo {
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(16, 120, 150, 0.2);
    box-shadow: 0 4px 6px rgba(16, 120, 150, 0.1);
}

.fw-800 { font-weight: 800 !important; }
.star-icon { color: var(--star); }

/* Read More toggle */
.tm-toggle-bio {
    text-decoration: none;
    border-bottom: 1px solid transparent !important;
    transition: border-color 0.2s;
}
.tm-toggle-bio:hover {
    border-bottom-color: var(--primary) !important;
}

/* Clickable rating (reviews) */
.tm-rating-clickable {
    cursor: pointer;
    border-radius: 4px;
    padding: 0.125rem 0.375rem;
    margin-left: -0.375rem;
    transition: background 0.2s;
}
.tm-rating-clickable:hover { background: rgba(16, 120, 150, 0.08); }
.tm-rating-clickable:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Reviews modal */
.tm-reviews-widget-container {
    min-height: 200px;
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
.tm-reviews-widget-container .ruk_rating_snippet {
    font-family: 'Poppins', sans-serif !important;
}
#tm-reviews-overlay .modal-box {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
#tm-reviews-overlay .modal-box > .p-4 {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}

/* Feature list (used in tutor cards, pricing cards, info modal) */
.feature-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.feature-list li {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.8125rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.feature-list li:last-child { margin-bottom: 0; }
.feature-list li::before { display: none; }

.feature-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ============================================
   Modal Overlays (Video, Info)
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: overlayIn 0.5s ease forwards;
}
.modal-overlay.bg-standard { animation-name: overlayIn; }
.modal-overlay.bg-dark { animation-name: overlayInDark; }
.modal-overlay.closing { animation: overlayOut 0.4s ease forwards; }

.modal-box {
    background: var(--card-bg);
    border-radius: 4px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    position: relative;
    animation: contentIn 0.5s ease;
}
.modal-overlay.closing .modal-box,
.modal-overlay.closing .modal-frameless { animation: contentOut 0.4s ease forwards; }

.modal-frameless {
    animation: contentIn 0.5s ease;
    position: relative;
    width: 100%;
}

/* Info modal */
.info-benefit {
    border-radius: 4px;
    background: rgba(243, 244, 246, 0.5);
    padding: 0.75rem;
    text-align: center;
}
.info-tier {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(229, 231, 235, 0.6);
    border-radius: 4px;
    padding: 0.75rem 1rem;
}

/* ============================================
   Pricing Card (shared)
   ============================================ */
.pricing-card {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--card-bg);
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); border-color: rgba(16, 120, 150, 0.2); }
.pricing-card.popular { border-color: rgba(16, 120, 150, 0.4); outline: 2px solid rgba(16, 120, 150, 0.3); outline-offset: -2px; transform: scale(1.03); z-index: 10; box-shadow: 0 10px 15px -3px rgba(16, 120, 150, 0.1); }

.card-title-sm { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.2em; color: var(--primary); }
.card-subtitle { font-size: 0.6875rem; color: var(--text-muted); }
.price-dollar { font-size: 1.125rem; font-weight: 600; color: var(--text-muted); vertical-align: top; line-height: 2.5; }
.price-value { font-size: 3.75rem; font-weight: 800; line-height: 1; color: var(--text); }
.price-value-sm { font-size: 3rem; font-weight: 800; line-height: 1; color: var(--text); }
.price-per { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); margin-top: 0.5rem; }
.card-divider { height: 1px; background: var(--border); margin-bottom: 1.5rem; }

.badge-popular {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 0.35rem 1.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 6px rgba(16, 120, 150, 0.2);
    white-space: nowrap;
}

.save-badge {
    display: inline-block;
    background: var(--save-light);
    color: var(--save);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.625rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}
.free-badge {
    display: inline-block;
    background: var(--save-light);
    color: var(--save);
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.35rem 1rem;
    border-radius: 4px;
}
.card-spacer { visibility: hidden; pointer-events: none; }
.subscribe-info { font-size: 0.625rem; color: var(--text-muted); line-height: 1.6; margin-top: 0.625rem; }
.then-label { font-size: 0.6875rem; color: var(--text-muted); margin-bottom: 0.25rem; }

/* ============================================
   Pricing Modal (Bootstrap modal wrapper)
   ============================================ */
.modal-backdrop {
    background-color: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(0) !important;
    -webkit-backdrop-filter: blur(0) !important;
    opacity: 0 !important;
    transition: opacity 0.5s ease, backdrop-filter 0.5s ease, -webkit-backdrop-filter 0.5s ease !important;
}
.modal-backdrop.show {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    opacity: 1 !important;
}

/* Slower modal dialog entrance/exit */
.tm-pricing-modal.fade .modal-dialog {
    transition: transform 0.5s ease, opacity 0.5s ease !important;
    transform: scale(0.95) translateY(0);
    opacity: 0;
}
.tm-pricing-modal.show .modal-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}
.tm-pricing-modal .modal-content {
    font-family: 'Poppins', sans-serif;
    border-radius: 4px;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: visible;
}
.tm-pricing-modal .modal-dialog { max-width: 1100px; }
.tm-pricing-modal .modal-header,
.tm-pricing-modal .modal-body { border: none; padding: 0; }
.tm-pricing-modal .pricing-grid { padding: 1rem 1.5rem 1.5rem; }

/* Clickable free card */
.tm-pricing-modal .clickable { cursor: pointer; }

/* View toggle */
.tm-pricing-modal .tm-view-main,
.tm-pricing-modal .tm-view-trial { display: none; }
.tm-pricing-modal .tm-view-main.active,
.tm-pricing-modal .tm-view-trial.active { display: block; }

/* Total price in modal */
.tm-pricing-modal .total-price { text-align: center; margin-bottom: 1rem; }
.tm-pricing-modal .total-price .amount { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.tm-pricing-modal .total-price .price-period {
    font-size: 0.85rem;
    font-weight: 500;
    color: #6b7280;
    margin-top: 2px;
}

/* Price wrap centered */
.price-wrap { text-align: center; }

/* ============================================
   Cart Loading & Toast
   ============================================ */
.btn-cta.tm-loading,
.btn-subscribe.tm-loading {
    opacity: 0.8;
    pointer-events: none;
}

.tm-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(1rem);
    z-index: 1100;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}
.tm-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.tm-toast-success { background: var(--save); color: #fff; }
.tm-toast-error { background: #ef4444; color: #fff; }

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.skeleton-card .d-flex { gap: 1rem; }
.skeleton-bone {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite ease-in-out;
    border-radius: 4px;
}
.skeleton-avatar {
    width: 10rem;
    height: 10rem;
    border-radius: 50%;
    flex-shrink: 0;
}
.skeleton-btn {
    width: 10rem;
    height: 2.5rem;
    margin-top: 0.75rem;
    border-radius: 4px;
}
.skeleton-line {
    height: 0.75rem;
    margin-bottom: 0.5rem;
}
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-100 { width: 100%; }
.skeleton-line.thick { height: 1rem; }
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@media (max-width: 575px) {
    .skeleton-avatar { width: 5rem; height: 5rem; }
    .skeleton-btn { width: 100%; }
}

/* ============================================
   Animations
   ============================================ */
/* Overlay: fade + blur in/out */
@keyframes overlayIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
        -webkit-backdrop-filter: blur(0);
        background: transparent;
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        background: var(--overlay);
    }
}
@keyframes overlayOut {
    from {
        opacity: 1;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    to {
        opacity: 0;
        backdrop-filter: blur(0);
        -webkit-backdrop-filter: blur(0);
    }
}

/* Dark overlay variant */
@keyframes overlayInDark {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
        -webkit-backdrop-filter: blur(0);
        background: transparent;
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        background: var(--overlay-dark);
    }
}

/* Content: scale + fade */
@keyframes contentIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes contentOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.95); }
}

/* ============================================
   Responsive
   ============================================ */
/* ============================================
   Sidebar Mobile Toggle
   ============================================ */
.sidebar-mobile-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
}
.sidebar-mobile-toggle:hover { background: var(--secondary); }
.sidebar-mobile-toggle .sidebar-toggle-icon {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s;
}
.sidebar-mobile-toggle[aria-expanded="true"] .sidebar-toggle-icon {
    transform: rotate(180deg);
}

@media (max-width: 991px) {
    .sidebar-inner { position: static; }

    /* Compact sidebar items on tablet/mobile */
    .sidebar-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    .sidebar-child {
        padding: 0.375rem 0.625rem;
        font-size: 0.6875rem;
    }
    .sidebar-header {
        padding: 0.5rem 0.75rem;
    }
    .sidebar-header h3 {
        font-size: 0.625rem;
    }

    /* Hide video promo on mobile to save space */
    .video-promo { display: none; }
}

@media (max-width: 575px) {
    .tutor-card-left { width: auto; }
    .tutor-photo { width: 5rem; height: 5rem; }
}

/* ============================================
   Calendly Availability Popup
   ============================================ */
.tm-calendly-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.tm-calendly-popup {
    background: #fff;
    border-radius: 16px;
    width: 94%;
    max-width: 460px;
    padding: 28px 28px 20px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: tmCalendlySlideIn 0.25s ease-out;
}

@keyframes tmCalendlySlideIn {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tm-calendly-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}
.tm-calendly-close:hover { color: var(--text); }

.tm-calendly-header {
    text-align: center;
    margin-bottom: 16px;
}

.tm-calendly-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 10px;
}

.tm-calendly-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.tm-calendly-nav button {
    background: var(--secondary);
    border: none;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    font-size: 1rem;
    transition: background 0.15s, color 0.15s;
}
.tm-calendly-nav button:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
}

.tm-calendly-nav button:disabled,
.tm-calendly-nav button.tm-calendly-nav-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.tm-calendly-month-label {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 160px;
    text-align: center;
}

/* Calendar table */
.tm-calendly-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
    table-layout: fixed;
}

.tm-calendly-table th {
    font-family: 'Poppins', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 4px 0 8px;
    text-align: center;
}

.tm-calendly-table td {
    text-align: center;
    vertical-align: middle;
    padding: 0;
}

.tm-cal-day {
    position: relative;
}

.tm-cal-day span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin: 0 auto;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    transition: transform 0.12s, box-shadow 0.12s;
}

/* Clickable days */
.tm-cal-available,
.tm-cal-busy {
    cursor: pointer;
}

/* Available (green) */
.tm-cal-available span {
    background: #dcfce7;
    color: #15803d;
    border: 2px solid #86efac;
}
.tm-cal-available:hover span {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(34,197,94,0.35);
}

/* Busy / fully booked (grey) */
.tm-cal-busy span {
    background: #f3f4f6;
    color: #9ca3af;
    border: 2px solid #d1d5db;
}
.tm-cal-busy:hover span {
    transform: scale(1.05);
}

/* Past dates */
.tm-cal-past span {
    color: #d1d5db;
    font-weight: 400;
}

/* No availability set */
.tm-cal-none span {
    color: #d1d5db;
    font-weight: 400;
}

/* Empty cells */
.tm-cal-empty {
    background: none;
}

/* Legend */
.tm-calendly-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.tm-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tm-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    display: inline-block;
}

.tm-legend-available {
    background: #dcfce7;
    border: 2px solid #86efac;
}

.tm-legend-busy {
    background: #f3f4f6;
    border: 2px solid #d1d5db;
}

/* Loading spinner */
.tm-calendly-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
}

.tm-calendly-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: tmCalSpin 0.7s linear infinite;
}

@keyframes tmCalSpin {
    to { transform: rotate(360deg); }
}

.tm-calendly-error {
    text-align: center;
    color: #dc2626;
    padding: 40px 16px;
    font-size: 0.9rem;
}

/* ============================================
   Slots Panel (date detail view)
   ============================================ */
.tm-calendly-slots-panel {
    padding: 0;
}

.tm-slots-back {
    background: none;
    border: none;
    color: var(--primary);
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    transition: color 0.15s;
}
.tm-slots-back:hover {
    color: var(--primary-dark, #1a4fd9);
    text-decoration: underline;
}

.tm-slots-date-label {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 14px;
}

.tm-tz-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    color: #6b7280;
}

.tm-tz-selector label {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-weight: 500;
    margin: 0;
}

.tm-tz-select {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    background: #fff;
    cursor: pointer;
    outline: none;
}

.tm-tz-select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.tm-slots-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.tm-slot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    transition: transform 0.12s, box-shadow 0.12s;
}

.tm-slot-available {
    background: #dcfce7;
    border: 1px solid #86efac;
    cursor: pointer;
}
.tm-slot-available:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}

.tm-slot-open {
    background: #dcfce7;
    border: 1px solid #86efac;
    cursor: default;
}

.tm-slot-booked {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    cursor: default;
}

.tm-slot-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: var(--text);
}

.tm-slot-booked .tm-slot-time {
    color: #9ca3af;
}

.tm-slot-status {
    font-size: 0.78rem;
    color: #9ca3af;
    font-weight: 500;
}

.tm-slot-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 480px) {
    .tm-calendly-popup {
        padding: 20px 16px 16px;
        border-radius: 12px;
    }
    .tm-cal-day span {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
        border-radius: 8px;
    }
    .tm-calendly-table {
        border-spacing: 2px;
    }
    .tm-slot-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 12px;
    }
}
