/* GF Booking Frontend - GitHub-inspired appointment picker */

.gf-appt-picker {
    --gf-gh-bg: #f6f8fa;
    --gf-gh-surface: #ffffff;
    --gf-gh-border: #d0d7de;
    --gf-gh-text: #1f2328;
    --gf-gh-text-muted: #656d76;
    --gf-gh-blue: #0969da;
    --gf-gh-blue-soft: #ddf4ff;
    --gf-gh-green: #1a7f37;
    --gf-gh-green-soft: #dafbe1;
    --gf-gh-disabled: #8c959f;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Tahoma, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    direction: rtl;
    max-width: 720px;
    margin: 14px 0;
    padding: 16px;
    border: 1px solid var(--gf-gh-border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: none;
}

.gf-appt-service-name {
    display: inline-flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 6px 10px;
    border: 1px solid var(--gf-gh-border);
    border-radius: 999px;
    background: var(--gf-gh-blue-soft);
    color: var(--gf-gh-blue);
    font-size: 12px;
    font-weight: 700;
}

.gf-day-carousel {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    padding: 2px 0 12px;
}

.gf-appt-picker button.gf-day-card,
.gform_wrapper .gf-appt-picker button.gf-day-card,
.gform_wrapper.gravity-theme .gf-appt-picker button.gf-day-card {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    min-width: 0;
    margin: 0;
    box-shadow: none;
    text-shadow: none;
    text-transform: none;
}

.gf-day-card {
    position: relative;
    width: 100%;
    padding: 10px 6px 11px;
    border: 1px solid var(--gf-gh-border);
    border-radius: 8px;
    background: var(--gf-gh-surface);
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    line-height: 1.15;
    color: var(--gf-gh-text);
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.gf-day-name {
    font-size: 11px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--gf-gh-text-muted);
}

.gf-day-card:hover {
    border-color: rgba(31, 35, 40, 0.18);
    background: #f6f8fa;
}

.gf-day-card.selected {
    border-color: #0969da;
    background: #0969da;
    color: #ffffff;
    box-shadow: none;
}

.gf-day-card.gf-day-today {
    border-color: rgba(26, 127, 55, 0.25);
    background: #ffffff;
}

.gf-day-card.gf-day-today::after {
    content: "";
    position: absolute;
    top: 8px;
    inset-inline-start: 8px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--gf-gh-green);
    box-shadow: 0 0 0 4px rgba(26, 127, 55, 0.14);
}

.gf-day-card.gf-day-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f6f8fa;
    box-shadow: none;
}

.gf-day-card.gf-day-disabled:hover {
    border-color: var(--gf-gh-border);
    background: #f6f8fa;
}

.gf-day-num {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    color: currentColor;
    letter-spacing: -0.02em;
}

.gf-day-month {
    font-size: 12px;
    line-height: 1.25;
    color: var(--gf-gh-text-muted);
}

.gf-day-card.selected .gf-day-month,
.gf-day-card.selected .gf-day-num,
.gf-day-card.selected .gf-day-name {
    color: #ffffff;
}

.gf-time-slots-wrap {
    margin-top: 16px;
    min-height: 72px;
    padding: 12px;
    border: 1px solid var(--gf-gh-border);
    border-radius: 10px;
    background: #f6f8fa;
}

.gf-time-slots {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    padding: 0;
}

.gf-appt-picker button.time-slot-btn,
.gform_wrapper .gf-appt-picker button.time-slot-btn,
.gform_wrapper.gravity-theme .gf-appt-picker button.time-slot-btn {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    min-width: 0;
    margin: 0;
    box-shadow: none;
    text-shadow: none;
    text-transform: none;
}

.time-slot-btn {
    width: 100%;
    min-height: 36px;
    padding: 8px 6px;
    border: 1px solid var(--gf-gh-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--gf-gh-text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    text-align: center;
    line-height: 1.3;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.time-slot-btn:hover {
    border-color: rgba(31, 35, 40, 0.18);
    background: #f6f8fa;
    color: var(--gf-gh-text);
}

.time-slot-btn.selected {
    border-color: #0969da;
    background: #0969da;
    color: #ffffff;
    box-shadow: none;
}

.time-slot-btn.time-slot-booked {
    background: #f6f8fa;
    color: var(--gf-gh-disabled);
    border-color: var(--gf-gh-border);
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: 0.9;
    box-shadow: none;
}

.time-slot-btn.time-slot-booked:hover {
    background: #f6f8fa;
    color: var(--gf-gh-disabled);
    border-color: var(--gf-gh-border);
}

.slots-placeholder,
.no-slots {
    margin: 0;
    padding: 10px 8px;
    color: var(--gf-gh-text-muted);
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.slots-empty-calendar {
    color: #d1242f;
    font-weight: 700;
}

.slots-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 8px;
    color: var(--gf-gh-blue);
    font-size: 13px;
    font-weight: 600;
}

.slot-spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(9, 105, 218, 0.18);
    border-top-color: var(--gf-gh-blue);
    border-radius: 50%;
    animation: gf-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes gf-spin {
    to {
        transform: rotate(360deg);
    }
}

.gf-appt-confirm {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(26, 127, 55, 0.2);
    border-radius: 8px;
    background: var(--gf-gh-green-soft);
    color: #0f5323;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
}

.confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(26, 127, 55, 0.12);
    color: var(--gf-gh-green);
    font-size: 14px;
    flex-shrink: 0;
}

@media (max-width: 760px) {
    .gf-appt-picker {
        padding: 14px;
        border-radius: 10px;
    }

    .gf-day-carousel,
    .gf-time-slots {
        grid-template-columns: repeat(4, 1fr);
    }

    .gf-day-num {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .gf-day-carousel,
    .gf-time-slots {
        grid-template-columns: repeat(3, 1fr);
    }

    .gf-time-slots-wrap {
        padding: 10px;
    }
}
