.pomocal-calendar-widget {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 1.5rem;
    background-color: #ffffff;
    position: relative;
    width: 100%;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .pomocal-calendar-widget {
        padding: 1rem;
    }
}

@media (min-width: 1024px) {
    .pomocal-calendar-widget {
        padding: 2rem;
    }
}

.pomocal-calendar-widget__message {
    min-height: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.pomocal-calendar-widget__message[data-type="error"] {
    color: #b91c1c;
}

.pomocal-calendar-widget__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pomocal-calendar-widget__button {
    background-color: #f1f5f9;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: #1f2937;
}

.pomocal-calendar-widget__button:hover:not(:disabled) {
    background-color: #e2e8f0;
}

.pomocal-calendar-widget__button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pomocal-calendar-widget__label {
    flex: 1;
    text-align: center;
    font-weight: 600;
    text-transform: capitalize;
    color: #111827;
}

.pomocal-calendar-widget__legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #4b5563;
}

.pomocal-calendar-widget__legend-item {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid transparent;
}

.pomocal-calendar-widget__legend-item--available {
    background-color: #16a34a;
}

.pomocal-calendar-widget__legend-item--seeking {
    background-color: #8b5cf6;
}

.pomocal-calendar-widget__legend-item--full {
    background-color: #dc2626;
}

.pomocal-calendar-widget__legend-item--empty {
    background-color: #111827;
}

.pomocal-calendar-widget__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.25rem;
}

.pomocal-calendar-widget__weekday {
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #6b7280;
    padding-bottom: 0.25rem;
}

.pomocal-calendar-widget__day {
    border-radius: 6px;
    min-height: 64px;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    border: 1px solid transparent;
    background-color: #f9fafb;
    color: #111827;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    appearance: none;
}

.pomocal-calendar-widget__day:disabled {
    cursor: default;
    opacity: 0.4;
    box-shadow: none;
}

.pomocal-calendar-widget__day-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #111827;
}

.pomocal-calendar-widget__day-status {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    word-break: break-word;
}

.pomocal-calendar-widget__day--available {
    background-color: #dcfce7;
    border-color: #16a34a;
    color: #065f46;
}

.pomocal-calendar-widget__day--available:hover {
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.pomocal-calendar-widget__day--seeking {
    background-color: #ede9fe;
    border-color: #8b5cf6;
    color: #4c1d95;
}

.pomocal-calendar-widget__day--seeking:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.pomocal-calendar-widget__day--full {
    background-color: #fee2e2;
    border-color: #dc2626;
    color: #991b1b;
}

.pomocal-calendar-widget__day--full:hover {
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.pomocal-calendar-widget__day--empty {
    background-color: #111827;
    color: #f9fafb;
}

.pomocal-calendar-widget__day--empty,
.pomocal-calendar-widget__day--disabled {
    cursor: default;
    box-shadow: none;
}

.pomocal-calendar-widget__day--disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
}

.pomocal-calendar-widget__day--disabled {
    opacity: 0.4;
}

.pomocal-calendar-widget__day--outside {
    background-color: #f9fafb;
    color: #9ca3af;
    border-color: #e5e7eb;
}

.pomocal-calendar-widget__day--outside .pomocal-calendar-widget__day-label,
.pomocal-calendar-widget__day--outside .pomocal-calendar-widget__day-status {
    color: #9ca3af;
}

.pomocal-calendar-widget__day--today {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.pomocal-calendar-widget__dialog[hidden] {
    display: none;
}

.pomocal-calendar-widget__dialog {
    position: fixed;
    inset: 0;
    background-color: rgba(17, 24, 39, 0.45);
    display: grid;
    align-items: center;
    justify-items: center;
    padding: clamp(1rem, 5vw, 2.5rem);
    box-sizing: border-box;
    min-height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.pomocal-calendar-widget__dialog-content {
    background-color: #ffffff;
    border-radius: 10px;
    max-width: 480px;
    width: min(100%, 480px);
    max-height: 90vh;
    overflow: auto;
    padding: 1.5rem;
    position: relative;
}

@media (max-height: 540px) {
    .pomocal-calendar-widget__dialog {
        align-items: start;
        justify-items: center;
    }

    .pomocal-calendar-widget__dialog-content {
        margin-top: 1.5rem;
    }
}

.pomocal-calendar-widget__dialog-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    color: #4b5563;
}

.pomocal-calendar-widget__dialog-title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.pomocal-calendar-widget__slot-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pomocal-calendar-widget__slot {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    background-color: #f9fafc;
}

.pomocal-calendar-widget__slot--full {
    border-color: #f87171;
    background-color: #fef2f2;
}

.pomocal-calendar-widget__slot--cancelled {
    border-color: #9ca3af;
    background-color: #f3f4f6;
    opacity: 0.85;
}

.pomocal-calendar-widget__slot--seeking {
    border-color: #8b5cf6;
    background-color: #f5f3ff;
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.15);
}

.pomocal-calendar-widget__slot-title {
    margin: 0 0 0.5rem;
    font-weight: 600;
}

.pomocal-calendar-widget__slot-meta {
    margin: 0 0 0.75rem;
    color: #4b5563;
}

.pomocal-calendar-widget__slot-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background-color: #ede9fe;
    color: #5b21b6;
    font-size: 0.85rem;
    font-weight: 600;
}

.pomocal-calendar-widget__slot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pomocal-calendar-widget__badge {
    display: inline-block;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background-color: #2563eb;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
}

.pomocal-calendar-widget__button-primary {
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 0;
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    cursor: pointer;
}

.pomocal-calendar-widget__login-button {
    width: auto;
    padding: 0 1rem;
    font-size: 0.95rem;
    text-decoration: none;
    line-height: 1;
}

.pomocal-calendar-widget__login-button:focus,
.pomocal-calendar-widget__login-button:hover {
    text-decoration: none;
}

.pomocal-calendar-widget__button-secondary {
    background-color: #f1f5f9;
    color: #1f2937;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0;
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    cursor: pointer;
}

.pomocal-calendar-widget__button-primary:disabled,
.pomocal-calendar-widget__button-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pomocal-button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border-radius: 50%;
    background-color: #2563eb;
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.pomocal-button-link:hover,
.pomocal-button-link:focus {
    background-color: #1d4ed8;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
    outline: none;
}

.pomocal-calendar-widget__action-link {
    align-self: center;
}

.pomocal-action-link__icon {
    font-size: 1.2rem;
    line-height: 1;
}

.pomocal-calendar-widget__participants {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.pomocal-calendar-widget__participants-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4b5563;
}

.pomocal-calendar-widget__participants-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.pomocal-calendar-widget__participant-avatar,
.pomocal-calendar-widget__participant-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid #d1d5db;
}

.pomocal-calendar-widget__participant-avatar {
    object-fit: cover;
    background-color: #ffffff;
}

.pomocal-calendar-widget__participant-placeholder {
    background-color: #e5e7eb;
    color: #1f2937;
}

@media (max-width: 640px) {
    .pomocal-calendar-widget {
        padding: 1rem;
    }

    .pomocal-calendar-widget__grid {
        gap: 0.15rem;
    }

    .pomocal-calendar-widget__day {
        min-height: 56px;
        padding: 0.4rem;
    }

    .pomocal-calendar-widget__day-label {
        font-size: 0.9rem;
    }

    .pomocal-calendar-widget__day-status {
        font-size: 0.7rem;
    }

    .pomocal-calendar-widget__legend {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        font-size: 0.8rem;
    }

    .pomocal-calendar-widget__nav {
        flex-wrap: wrap;
    }

    .pomocal-calendar-widget__button {
        flex: 0 0 auto;
    }
}

@media (max-width: 420px) {
    .pomocal-calendar-widget {
        padding: 0.85rem;
    }

    .pomocal-calendar-widget__nav {
        gap: 0.5rem;
    }

    .pomocal-calendar-widget__label {
        font-size: 1rem;
    }

    .pomocal-calendar-widget__legend {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
        gap: 0.4rem;
    }
}
