:root {
    --primary-color: #4a6bdf;
    --primary-light: #e8efff;
    --secondary-color: #3f4a5c;
    --success-color: #41cd7d;
    --warning-color: #ffb74d;
    --danger-color: #ef5350;
    --background-color: #f9fbff;
    --card-background: #ffffff;
    --border-color: #e0e7ee;
    --text-color: #333;
    --text-light: #6e7f9a;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.appointment-card {
    background-color: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 100%;
    overflow: hidden;
    transform: translateY(0);
    animation: card-entrance 0.5s ease-out;
}

@keyframes card-entrance {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    padding: 25px 30px 15px;
    color: var(--secondary-color);
    font-size: 22px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.progress-bar {
    padding: 25px 30px 30px;
    position: relative;
    display: flex;
    justify-content: center;
    background-color: var(--card-background);
}

.progress-line {
    position: absolute;
    top: 42px;
    left: 60px;
    right: 60px;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.step-wrapper {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 500px;
    position: relative;
    z-index: 2;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: var(--text-light);
    transition: var(--transition);
}

.step-text {
    font-size: 14px;
    color: var(--text-light);
    transition: var(--transition);
}

.progress-step.active .step-number {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.progress-step.active .step-text {
    color: var(--primary-color);
    font-weight: 600;
}

.progress-step.completed .step-number {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.progress-step.completed .step-text {
    color: var(--success-color);
}

.step-container {
    padding: 20px;
    opacity: 1;
    transform: translateX(0);
    transition: var(--transition);
}

.step-container.hidden {
    display: none;
    opacity: 0;
    transform: translateX(30px);
}

.step-container.slide-in {
    animation: slide-in 0.4s forwards;
}

.step-container.slide-out {
    animation: slide-out 0.4s forwards;
}

@keyframes slide-in {
    0% {
        opacity: 0;
        transform: translateX(50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-out {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50px);
    }
}

h2 {
    margin-bottom: 20px;
    color: var(--secondary-color);
    font-weight: 600;
}

h3 {
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 16px;
    margin: 0;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-light);
}

select, input {
    width: 100%;
    padding: 12px 15px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
    transition: var(--transition);
}
input#dateFrom,
input#dateTo {
    padding: 4px 15px !important;

}
select:focus, input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 107, 223, 0.2);
}

.date-range {
    display: flex;
    gap: 15px;
}

.date-range > div {
    flex: 1;
}

.button-container {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.btn {
    padding: 12px 24px !important;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-width: 120px;
    width: auto;
    display: block !important;
}

.btn:hover {
    /* background-color: #3a59c7;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); */
}

.btn.secondary {
    background-color: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
}

.btn.secondary:hover {
    background-color: var(--border-color);
    color: var(--secondary-color);
}

.btn.disabled {
    background-color: var(--border-color);
    color: var(--text-light);
    cursor: not-allowed;
    pointer-events: none;
}

/* Panel filtrów */
.filters-panel {
    background-color: #f5f7fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
    transition: var(--transition);
    overflow: hidden;
}

.filters-header {
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid transparent;
}

.filters-header h3 {
    font-size: 14px;
    font-weight: 500;
}

.toggle-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-light) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: var(--transition);
}

.toggle-btn:hover {
    color: var(--primary-color);
}

.toggle-btn svg {
    width: 14px;
    height: 14px;
    transition: var(--transition);
}

.toggle-btn.expanded svg {
    transform: rotate(180deg);
}

.filters-content {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.filters-content.expanded {
    max-height: 500px;
    padding: 0 15px 15px;
}

.filters-content .form-group {
    margin-bottom: 12px;
}

.filters-content label {
    font-size: 13px;
    margin-bottom: 4px;
}

.filters-content select,
.filters-content input {
    padding: 8px 12px;
    font-size: 14px;
}

.filter-buttons {
    justify-content: flex-end;
    margin-top: 12px;
}

.filter-buttons .btn {
    padding: 8px 16px;
    min-width: auto;
    font-size: 14px;
}

.filter-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.location-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.location-btn {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background-color: white;
    color: var(--text-light);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.location-btn:hover {
    background-color: var(--primary-light);
}

.location-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.calendar-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: var(--transition);
    white-space: normal;
}

.nav-btn:hover {
    color: #3556ce;
    background-color:initial;
    transform: none;

}

.nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: var(--text-light);
}

.nav-btn.disabled:hover {
    color: var(--text-light);
}

.arrow {
    width: 10px;
    height: 10px;
    border-top: 2px solid;
    border-right: 2px solid;
    display: inline-block;
}

.arrow.left {
    transform: rotate(-135deg);
    margin-right: 8px;
}

.arrow.right {
    transform: rotate(45deg);
    margin-left: 8px;
}

#appointmentResults {
    margin-top: 20px;
}

.doctor-calendar {
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.doctor-calendar:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.doctor-header {
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-color);
}

.doctor-info-header {
    padding: 10px;
    background-color: var(--primary-light);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: none;
    gap: 15px;
    position: relative;
}

.doctor-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

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

.doctor-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.doctor-name {
    font-weight: 600;
    font-size: 18px;
    color: var(--secondary-color);
}

.doctor-specialty {
    color: var(--text-light);
    font-size: 14px;
}

.service-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed rgba(0,0,0,0.1);
}

.service-info {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.price-info {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 30px;
}

.location-switch {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: #f5f7fa;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
}

.location-label {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
    white-space: nowrap;
}

.location-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.location-switch .location-btn {
    font-size: 13px;
    padding: 6px 12px;
}

.expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    transition: var(--transition);
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    z-index: 5;
}

.expand-btn::before {
    content: "";
    display: block;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--primary-color);
    border-right: 2px solid var(--primary-color);
    transform: rotate(135deg);
}

.expand-btn.expanded::before {
    transform: rotate(-45deg);
}
.expand-btn:hover {
    color: #3556ce;
        background-color: initial;
        transform: none;
}
/* Dodajemy style dla aktywnej lokalizacji w nagłówku kalendarza */
.doctor-header .current-location {
    display: inline-block;
    font-weight: 500;
    color: var(--primary-color);
    background-color: rgba(74, 107, 223, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 5px;
    font-size: 13px;
}

.location-switch .location-btn.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.week-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(100px, 1fr));
    border-top: 1px solid var(--border-color);
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 300px;
}

.day-column {
    border-right: 1px solid var(--border-color);
    min-width: 100px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.day-column:last-child {
    border-right: none;
}

.day-header {
    padding: 10px;
    text-align: center;
    background-color: #f5f7fa;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.day-name {
    font-weight: 500;
    font-size: 14px;
}

.day-date {
    font-size: 12px;
    color: var(--text-light);
}

.day-slots {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.1) transparent;
}

.time-slot {
    padding: 10px;
    border-radius: 6px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: block;
    margin: 5px 0;
}

.time-slot:hover {
    background-color: var(--primary-color) !important;
    color: white;
    transform: translateY(-2px);
}

.no-slot {
    color: var(--text-light);
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
    display: block;
}

/* Styl dla pionowego scrollbara */
.day-slots::-webkit-scrollbar {
    width: 5px;
}

.day-slots::-webkit-scrollbar-track {
    background: transparent;
}

.day-slots::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.1);
    border-radius: 10px;
}

.day-slots::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0,0,0,0.2);
}

/* Animacja wczytywania */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--primary-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsywność */
@media (max-width: 768px) {
    .step-container{
        padding: 10px;
    }
    .appointment-card {
        max-width: 100%;
    }
    
    .week-calendar {
        overflow-x: auto;
        grid-template-columns: repeat(7, minmax(100px, 1fr));
    }
    
    .date-range {
        flex-direction: column;
        gap: 10px;
    }
    
    .button-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
    }
    
    .step-wrapper {
        max-width: 100%;
    }
    
    .progress-line {
        left: 30px;
        right: 30px;
    }
    
    /* .doctor-info {
        flex-wrap: wrap;
        padding: 10px;
        gap: 10px;
        padding-bottom: 25px;
    } */
    
    .doctor-details {
        width: calc(100% - 120px);
    }
    
    .service-details {
        margin-top: 3px;
        padding-top: 3px;
    }
    
    .location-switch {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 10px;
    }
    
    .expand-btn {
        width: 24px;
        height: 24px;
        padding: 0;
        margin: 0;
        right: 10px;
        bottom: 5px;
    }
    
    .location-buttons {
        width: 100%;
    }
    
    .doctor-name {
        font-size: 16px;
    }
    
    .doctor-specialty {
        font-size: 13px;
    }
    
    .service-info, .price-info {
        font-size: 13px;
    }
    
    .day-header {
        padding: 8px 5px;
    }
    
    .day-name {
        font-size: 13px;
    }
    
    .day-date {
        font-size: 13px;
    }
    
    .time-slot {
        padding: 6px 5px;
        margin: 3px;
        font-size: 13px;
        min-width: auto;
    }
    
    .no-slot {
        font-size: 12px;
        padding: 5px;
    }
    
    .week-calendar {
        grid-template-columns: repeat(7, 1fr);
        gap: 3px;
    }
    
    .calendar-navigation {
        padding: 8px 10px;
    }
    
    .nav-btn {
        font-size: 12px;
        padding: 5px 8px;
    }
    
    .current-date-range {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .doctor-avatar {
        width: 65px;
        height: 65px;
    }
    
    .doctor-details {
        width: calc(100% - 80px);
        gap: 2px;
    }
    
    .service-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        margin-top: 3px;
        padding-top: 3px;
    }
    
    .doctor-name {
        font-size: 15px;
    }
    
    .doctor-specialty {
        font-size: 12px;
    }
    
    .service-info, .price-info {
        font-size: 12px;
    }
    
    .doctor-calendar .calendar-navigation {
        padding: 6px 10px;
    }
    
    /* .doctor-info {
        padding-bottom: 22px;
    } */
    
    .expand-btn {
        width: 20px;
        height: 20px;
        bottom: 3px;
    }
}

.horizontal-form {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.horizontal-form .form-group {
    flex: 1;
}

@media (max-width: 768px) {
    .horizontal-form {
        flex-direction: column;
        gap: 15px;
    }
}

.doctor-calendar .calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0px;
    background-color: #f9fafc;
    white-space: nowrap;
    gap: 2px;
}

.doctor-calendar .current-date-range {
    font-weight: 500;
    color: var(--secondary-color);
}

.doctor-calendar .nav-btn {
    padding: 5px 10px;
    font-size: 13px;
}
.calprev{
        justify-content: flex-start;
}
.calnext{
        justify-content: flex-end;
}
/* Bardzo małe ekrany (telefony) */
@media (max-width: 576px) {
    /* Struktura pozycjonowania elementów przewijania */
    .doctor-calendar {
        position: relative;
    }
    
    .week-calendar {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 10px;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
        position: relative;
        scroll-behavior: smooth;
        scrollbar-width: none;
        -ms-overflow-style: none;
        min-height: 250px;
    }
    
    /* Ukrywamy scrollbar dla Chrome/Safari */
    .week-calendar::-webkit-scrollbar {
        display: none;
    }
    
    .day-column {
        scroll-snap-align: start;
        min-width: 100px;
        flex: 0 0 auto;
        width: 33.33%;
        max-width: 120px;
        border-right: 1px solid var(--border-color);
    }
    
    /* Przyciski przewijania kalendarza */
    .week-calendar .calendar-scroll-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 24px;
        height: 24px;
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid var(--border-color);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 6;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        opacity: 0.9;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        margin: 0;
    }
    
    .week-calendar .calendar-scroll-btn:hover, 
    .week-calendar .calendar-scroll-btn:active {
        transform: translateY(-50%) scale(1.05);
        box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    }
    
    .week-calendar .calendar-scroll-btn.left {
        left: 3px;
    }
    
    .week-calendar .calendar-scroll-btn.right {
        right: 3px;
    }
    
    .week-calendar .calendar-scroll-btn::before {
        content: "";
        display: block;
        width: 8px;
        height: 8px;
        border-top: 1.5px solid var(--primary-color);
        border-right: 1.5px solid var(--primary-color);
    }
    
    .week-calendar .calendar-scroll-btn.left::before {
        transform: rotate(-135deg);
        margin-left: 2px;
    }
    
    .week-calendar .calendar-scroll-btn.right::before {
        transform: rotate(45deg);
        margin-right: 2px;
    }
    
    /* Animacje przycisków */
    @keyframes pulse-left {
        0% { transform: translateX(0) rotate(-135deg); opacity: 0.3; }
        50% { transform: translateX(-3px) rotate(-135deg); opacity: 0.8; }
        100% { transform: translateX(0) rotate(-135deg); opacity: 0.3; }
    }
    
    @keyframes pulse-right {
        0% { transform: translateX(0) rotate(45deg); opacity: 0.3; }
        50% { transform: translateX(3px) rotate(45deg); opacity: 0.8; }
        100% { transform: translateX(0) rotate(45deg); opacity: 0.3; }
    }
    
    /* Instrukcja swipe - pokazuje się przy pierwszym ładowaniu */
    .week-calendar .swipe-instruction {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 100%;
        background: rgba(255, 255, 255, 0.8);
        z-index: 10;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        pointer-events: none;
        opacity: 0;
        animation: fadeInOut 3s ease-in-out forwards;
    }
    
    .swipe-instruction-icon {
        width: 40px;
        height: 40px;
        position: relative;
        margin-bottom: 10px;
    }
    
    .swipe-instruction-icon::before {
        content: "";
        position: absolute;
        width: 25px;
        height: 25px;
        border-radius: 50%;
        background: rgba(74, 107, 223, 0.2);
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .swipe-instruction-icon::after {
        content: "";
        position: absolute;
        width: 35px;
        height: 12px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24' stroke='%234a6bdf' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6'%3E%3C/path%3E%3Cpath d='M10 4H4v6'%3E%3C/path%3E%3Cpath d='M20 4L10 14'%3E%3C/path%3E%3Cpath d='M4 4l10 10'%3E%3C/path%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        animation: swipeHint 1.5s ease-in-out infinite;
    }
    
    .swipe-instruction-text {
        font-size: 14px;
        color: var(--secondary-color);
        font-weight: 500;
        background: white;
        padding: 5px 10px;
        border-radius: 20px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    @keyframes fadeInOut {
        0% { opacity: 0; }
        20% { opacity: 1; }
        80% { opacity: 1; }
        100% { opacity: 0; }
    }
    
    @keyframes swipeHint {
        0% { transform: translate(-55%, -50%); }
        50% { transform: translate(-45%, -50%); }
        100% { transform: translate(-55%, -50%); }
    }
    
    .day-header {
        padding: 8px 5px;
    }
    
    .day-name {
        font-size: 12px;
    }
    
    .day-date {
        font-size: 12px;
    }
    
    .day-slots {
        min-height: 150px;
        max-height: 250px;
        padding: 5px;
        gap: 5px;
    }
    
    .time-slot {
        padding: 8px 5px;
        margin: 2px 0;
        font-size: 12px;
        display: block;
        width: auto;
    }
    
    .no-slot {
        font-size: 12px;
        padding: 10px 0;
    }
    
    /* Zmniejszamy czcionki w nawigacji */
    .nav-btn {
        font-size: 11px;
        padding: 4px 6px;
    }
    
    .current-date-range {
        font-size: 12px;
    }
} 