* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


.medfile-widget {
    max-width: 1200px;
    width: 100%;
    margin: 20px auto;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    color: #212529;
    line-height: 1.5;
}

/* Doctor Profile Section */
.medfile-widget .doctor-profile {
    display: none;
    gap: 24px;
    padding: 32px;
    border-bottom: none;
    background: transparent;
}

.medfile-widget .doctor-profile.show {
    display: flex;
}

.medfile-widget .doctor-avatar {
    width: 180px;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #e9ecef;
}

.medfile-widget .doctor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.medfile-widget .doctor-info {
    flex: 1;
}

.medfile-widget .doctor-name {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
}

.medfile-widget .doctor-locations {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.medfile-widget .location-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 15px;
}

.medfile-widget .location-icon {
    color: #6c757d;
    font-size: 16px;
}

.medfile-widget .price-range {
    font-size: 16px;
    color: #2c3e50;
    margin: 12px 0;
}

.medfile-widget .specialization {
    font-size: 15px;
    color: #6c757d;
    margin: 8px 0;
}

.medfile-widget .doctor-description {
    margin-top: 16px;
    color: #495057;
    font-size: 15px;
    line-height: 1.7;
}

/* Booking Section */
.medfile-widget .booking-section {
    padding: 24px;
    background: transparent;
    box-shadow: none;
}

.medfile-widget .booking-step {
    margin-bottom: 28px;
}

.medfile-widget .step-label {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 12px;
}

/* Visit Type Selector */
.medfile-widget .visit-type-select,
.medfile-widget .service-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 15px;
    background: white;
    color: #212529;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    transition: border-color 0.15s ease-in-out;
}

.medfile-widget .visit-type-select:hover,
.medfile-widget .service-select:hover,
.medfile-widget .visit-type-select:focus,
.medfile-widget .service-select:focus {
    border-color: #adb5bd;
    outline: none;
}

.medfile-widget .error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 8px;
}

/* Calendar Section */
.medfile-widget .calendar-section {
    margin-top: 32px;
    display: flex;
    align-items: stretch;
    gap: 12px;
    position: relative;
}

.medfile-widget .calendar-grid-wrapper {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.medfile-widget .calendar-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 90px;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}

.medfile-widget .calendar-grid::-webkit-scrollbar {
    display: none;
}

.medfile-widget .day-column {
    scroll-snap-align: start;
}

.medfile-widget .calendar-nav-btn {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #FF933D;
    background: transparent;
    color: #FF933D;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    box-shadow: none;
}

.medfile-widget .calendar-nav-btn:hover {
    background: #FF933D;
    color: #ffffff;
    transform: scale(1.05);
    box-shadow: none;
}

.medfile-widget .calendar-nav-prev {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.medfile-widget .calendar-nav-prev.visible {
    opacity: 1;
    pointer-events: auto;
}

.medfile-widget .calendar-nav-btn:active {
    transform: scale(0.98);
}

.medfile-widget .day-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.medfile-widget .day-header {
    text-align: center;
    padding: 6px 4px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-weight: 400;
    color: #495057;
}

.medfile-widget .day-name {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    text-transform: capitalize;
}

.medfile-widget .day-date {
    font-size: 16px;
    color: #212529;
    font-weight: 600;
    display: block;
    margin-top: 2px;
}

.medfile-widget .time-slot {
    padding: 10px 6px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    color: #212529;
    transition: all 0.15s ease-in-out;
    font-weight: 500;
}

.medfile-widget .time-slot:hover {
    background: #ffffff;
    border-color: #00b67a;
    color: #00b67a;
    box-shadow: 0 0 0 1px #00b67a;
}

.medfile-widget .time-slot.selected {
    background: #00b67a;
    border-color: #00b67a;
    color: #ffffff;
    box-shadow: 0 0 0 1px #00b67a;
    font-weight: 500;
}

.medfile-widget .time-slot.selected:hover {
    background: #009c69;
    border-color: #009c69;
    color: #ffffff;
}

.medfile-widget .time-slot.unavailable {
    background: #f8f9fa;
    color: #adb5bd;
    text-decoration: line-through;
    cursor: not-allowed;
    border-color: #e9ecef;
}

.medfile-widget .time-slot.unavailable:hover {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #adb5bd;
    box-shadow: none;
}

.medfile-widget .time-slot.hidden-slot {
    display: none;
}

.medfile-widget .no-slots-day {
    padding: 16px 12px;
    text-align: center;
    color: #adb5bd;
    font-size: 13px;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px dashed #dee2e6;
}

.medfile-widget .calendar-wrapper {
    position: relative;
}

.medfile-widget .calendar-toggle-buttons {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.medfile-widget .show-all-slots-global,
.medfile-widget .hide-slots-global {
    padding: 12px 32px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    color: #FF933D;
    transition: all 0.15s ease-in-out;
    font-weight: 500;
}

.medfile-widget .show-all-slots-global:hover,
.medfile-widget .hide-slots-global:hover {
    background: #f8f9fa;
    border-color: #FF933D;
    color: #E67D2A;
}

.medfile-widget .no-slots {
    text-align: center;
    padding: 32px;
    color: #6c757d;
    font-size: 15px;
}

/* No slots available info box */
.medfile-widget .no-slots-available-info {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    margin: 20px 0;
}

.medfile-widget .no-slots-message {
    font-size: 16px;
    color: #212529;
    line-height: 1.8;
    margin: 0;
}

.medfile-widget .action-link {
    display: inline;
    color: #212529;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.medfile-widget .action-link:hover {
    color: #ff8c00;
}

.medfile-widget .highlight-orange {
    color: #ff8c00;
    font-weight: 700;
}

/* Loading */
.medfile-widget .loading {
    text-align: center !important;
    padding: 60px 40px;
    color: #666;
    margin: 0 auto !important;
    max-width: 100%;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.medfile-widget .spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 24px;
}

.medfile-widget .spinner::before,
.medfile-widget .spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    top: 0;
    left: 0;
}

.medfile-widget .spinner::before {
    width: 60px;
    height: 60px;
    border: 3px solid #f0f0f0;
}

.medfile-widget .spinner::after {
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    border-top-color: #F57C00;
    border-right-color: #F57C00;
    animation: medfile-spin 0.8s linear infinite;
}

.medfile-widget .spinner-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    background: #F57C00;
    border-radius: 50%;
    animation: medfile-pulse 1.2s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(245, 124, 0, 0.4);
}

@keyframes medfile-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes medfile-pulse {
    0%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

.medfile-widget .loading p {
    font-size: 15px;
    font-weight: 500;
    color: #212529;
    margin: 0 auto 8px auto !important;
    text-align: center !important;
    width: 100% !important;
}

.medfile-widget .loading-subtext {
    font-size: 13px;
    color: #6c757d;
    margin: 0 auto !important;
    text-align: center !important;
    width: 100% !important;
}

/* Error */
.medfile-widget .error {
    text-align: center;
    padding: 32px;
    color: #dc3545;
    font-size: 15px;
}

/* No slots notice with jump button */
.medfile-widget .no-slots-notice {
    text-align: center;
    padding: 24px;
    margin-top: 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
}

.medfile-widget .no-slots-notice p {
    margin: 0 0 12px 0;
    color: #856404;
    font-size: 15px;
    font-weight: 500;
}

.medfile-widget .jump-to-available-btn {
    padding: 12px 24px;
    background: #00b67a;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.medfile-widget .jump-to-available-btn:hover {
    background: #009c69;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 182, 122, 0.3);
}

.medfile-widget .jump-to-available-btn:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .medfile-widget {
        margin: 0 12px;
        border-radius: 0;
        width: calc(100% - 24px);
    }

    .medfile-widget .doctor-profile {
        flex-direction: column;
        padding: 16px;
    }

    .medfile-widget .doctor-avatar {
        width: 100px;
        height: 100px;
    }

    .medfile-widget .booking-section {
        padding: 12px;
    }

    .medfile-widget .booking-step {
        margin-bottom: 20px;
    }

    .medfile-widget .step-label {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .medfile-widget .visit-type-select,
    .medfile-widget .service-select {
        padding: 10px 12px;
        font-size: 14px;
    }

    .medfile-widget .calendar-section {
        gap: 6px;
        margin-top: 20px;
        width: 100%;
        box-sizing: border-box;
    }

    .medfile-widget .calendar-nav-btn {
        width: 40px;
        height: 60px;
        font-size: 20px;
        flex-shrink: 0;
        border-radius: 8px;
    }

    .medfile-widget .calendar-nav-prev {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .medfile-widget .calendar-nav-prev.visible {
        opacity: 1;
        pointer-events: auto;
    }

    .medfile-widget .calendar-grid-wrapper {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .medfile-widget .calendar-grid {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        scroll-behavior: smooth;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .medfile-widget .calendar-grid::-webkit-scrollbar {
        display: none;
    }

    .medfile-widget .day-column {
        flex: 0 0 auto;
        width: calc((100vw - 40px - 40px - 32px - 24px) / 3);
        min-width: 85px;
        max-width: 95px;
    }

    .medfile-widget .day-header {
        padding: 6px 4px;
        background: transparent;
        border: none;
    }

    .medfile-widget .day-name {
        font-size: 14px;
        color: #6c757d;
        font-weight: 500;
    }

    .medfile-widget .day-date {
        font-size: 18px;
        margin-top: 2px;
        color: #212529;
        font-weight: 600;
    }

    .medfile-widget .time-slot {
        padding: 12px 8px;
        font-size: 16px;
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        color: #FF933D;
        font-weight: 600;
    }

    .medfile-widget .time-slot:hover {
        background: #FFF4EB;
        border-color: #FF933D;
    }

    .medfile-widget .no-slots-day {
        padding: 10px 4px;
        font-size: 11px;
        color: #adb5bd;
        background: transparent;
        border: 1px dashed #dee2e6;
    }

    .medfile-widget .calendar-toggle-buttons {
        margin-top: 16px;
        padding-top: 12px;
    }

    .medfile-widget .show-all-slots-global,
    .medfile-widget .hide-slots-global {
        padding: 10px 20px;
        font-size: 13px;
    }

    .medfile-widget .no-slots-available-info {
        padding: 20px 12px;
    }

    .medfile-widget .no-slots-message {
        font-size: 13px;
    }

    .medfile-widget .jump-to-available-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    /* Wymuszenie poprawnego zachowania na mobile */
    .medfile-widget {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        box-sizing: border-box !important;
    }

    .medfile-widget .booking-section {
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }

    .medfile-widget .calendar-section {
        max-width: 100% !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        box-sizing: border-box !important;
    }

    .medfile-widget .calendar-grid-wrapper {
        max-width: 100% !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        box-sizing: border-box !important;
    }
}

/* Dodatkowa optymalizacja dla bardzo małych ekranów */
@media (max-width: 400px) {
    .medfile-widget .booking-section {
        padding: 8px;
    }

    .medfile-widget .calendar-section {
        gap: 3px;
        width: 100%;
    }

    .medfile-widget .calendar-nav-btn {
        width: 20px;
        font-size: 14px;
    }

    .medfile-widget .calendar-grid-wrapper {
        overflow: hidden;
    }

    .medfile-widget .calendar-grid {
        grid-auto-columns: 52px;
        gap: 3px;
        width: 100%;
    }

    .medfile-widget .day-header {
        padding: 3px 1px;
    }

    .medfile-widget .day-name {
        font-size: 12px;
    }

    .medfile-widget .day-date {
        font-size: 16px;
    }

    .medfile-widget .time-slot {
        padding: 8px 2px;
        font-size: 14px;
        font-weight: 600;
    }

    .medfile-widget .no-slots-day {
        padding: 8px 2px;
        font-size: 12px;
    }
}
