/**
 * PANA Calendar - Styles
 * Compiled from SASS
 */

.pec {
    position: relative;
    width: 100%;
}

.pec__calendar-wrapper {
    width: 100%;
    max-width: 100%;
    position: relative;
}

.pec__container {
    min-height: 400px;
    background: #fff;
    width: 100%;
    display: block;
}

.pec__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.pec__filters-label {
    font-weight: 600;
    margin-right: 10px;
    color: #1a1a1a;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pec__filter-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.pec__filter-btn:hover {
    background: #fbfafa;
    border-color: #e30613;
    color: #1a1a1a;
}

.pec__filter-btn--active {
    background: #e30613;
    color: #fff;
    border-color: #e30613;
}

.pec__filter-btn--active:hover {
    background: #d70612;
    border-color: #d70612;
}

.pec__filter-btn:active {
    transform: scale(0.98);
}

.pec__btn:active {
    transform: scale(0.98);
}

.pec__modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: pec-fadeIn 0.2s ease;
}

.pec__modal-content {
    background-color: #fff;
    margin: auto;
    padding: 0;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    flex-shrink: 0;
    animation: pec-slideUp 0.3s ease;
}

.pec__modal-content--small {
    max-width: 400px;
}

.pec__modal-close {
    color: #999;
    background: transparent;
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
    border-radius: 50%;
}

.pec__modal-close:hover {
    color: #e30613;
    background: #fbfafa;
}

.pec__modal-body {
    padding: 40px 30px 30px;
}

.pec__modal-title {
    margin: 0 0 25px 0;
    font-size: 24px;
    color: #1a1a1a;
    font-weight: 700;
}

.pec__form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}

.pec__form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e9ecef;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    transition: all 0.2s;
}

.pec__form-control:focus {
    outline: none;
    border-color: #e30613;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
}

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

.pec__form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.pec__form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    justify-content: flex-end;
}

.pec__btn {
    padding: 10px 20px;
    border: 1px solid #e9ecef;
    background: #fff;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.pec__btn:hover {
    background: #fbfafa;
}

.pec__btn--primary {
    background: #e30613;
    color: #fff;
    border-color: #e30613;
}

.pec__btn--primary:hover {
    background: #d70612;
    border-color: #d70612;
}

.pec__btn--secondary {
    background: #6c757d;
    color: #fff;
    border-color: #6c757d;
}

.pec__btn--secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
}

.pec__btn--danger {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.pec__btn--danger:hover {
    background: #c82333;
    border-color: #c82333;
}

.pec__btn--cancel:hover {
    border-color: #999;
}

.pec__form-required {
    color: #e30613;
}

.pec__form-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.pec__form-message {
    padding: 12px;
    margin-top: 15px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.pec__form-message--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.pec__form-message--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.pec__event-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pec__detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pec__detail-label {
    font-weight: 600;
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pec__detail-value {
    color: #1a1a1a;
    font-size: 15px;
}

.pec__detail-value a {
    color: #e30613;
}

.pec__detail-value a:hover {
    color: #b8050f;
}

.pec__category-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #e30613;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    align-self: flex-start;
}

.pec__confirm-message {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin: 20px 0;
}

.pec__toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10001;
    min-width: 300px;
    max-width: 500px;
    animation: pec-slideInRight 0.3s ease;
}

.pec__toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-left: 4px solid;
}

.pec__toast-icon {
    font-size: 20px;
    font-weight: 700;
}

.pec__toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.pec__toast.pec__toast--success .pec__toast-content {
    border-left-color: #28a745;
}

.pec__toast.pec__toast--success .pec__toast-icon {
    color: #28a745;
}

.pec__toast.pec__toast--error .pec__toast-content {
    border-left-color: #dc3545;
}

.pec__toast.pec__toast--error .pec__toast-icon {
    color: #dc3545;
}

/* FullCalendar Styles */
.pec .fc {
    font-family: inherit;
    width: 100%;
    display: block;
}

.pec .fc .fc-view-harness {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.pec .fc .fc-view {
    min-width: 450px;
}

.pec .fc {
    --fc-button-text-color: #1a1a1a;
    --fc-button-bg-color: #fff;
    --fc-button-border-color: #e9ecef;
    --fc-button-hover-bg-color: #fbfafa;
    --fc-button-hover-border-color: #e30613;
    --fc-button-active-bg-color: #e30613;
    --fc-button-active-border-color: #e30613;
    --fc-today-bg-color: rgba(227, 6, 19, 0.05);
    --fc-border-color: #e9ecef;
    --fc-page-bg-color: #fff;
}

.pec .fc .fc-toolbar.fc-header-toolbar {
    display: grid !important;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 8px 20px;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e30613;
}

/* Strzalki nawigacji - lewy gorny rog */
.pec .fc .fc-toolbar.fc-header-toolbar .fc-toolbar-chunk:first-child {
    grid-column: 1;
    grid-row: 1;
}

/* Tytul (miesiac/rok) - prawy rog, rozciagniety na 2 wiersze */
.pec .fc .fc-toolbar.fc-header-toolbar .fc-toolbar-chunk:nth-child(2) {
    grid-column: 2;
    grid-row: 1 / 3;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Przyciski widoku (miesiac/lista) - pod strzalkami */
.pec .fc .fc-toolbar.fc-header-toolbar .fc-toolbar-chunk:last-child {
    grid-column: 1;
    grid-row: 2;
}

.pec .fc .fc-toolbar-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
}

.pec .fc .fc-button-group {
    display: inline-flex;
    gap: 0;
    position: relative;
    z-index: 1;
}

.pec .fc .fc-button-group > .fc-button {
    margin: 0;
    position: relative;
}

.pec .fc .fc-button-group > .fc-button:focus {
    box-shadow: none;
    outline: none;
}

.pec .fc .fc-button {
    padding: 8px 16px;
    font-weight: 600;
    font-size: 14px;
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #e9ecef;
    box-shadow: none;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
    border-radius: 0;
}

.pec .fc .fc-button:hover:not(:disabled) {
    background: #fbfafa;
    border-color: #e30613;
}

.pec .fc .fc-button.fc-button-active {
    background: #e30613 !important;
    color: #fff !important;
    border-color: #e30613 !important;
}

.pec .fc .fc-button.fc-button-active:hover {
    background: #d70612 !important;
    border-color: #d70612 !important;
}

.pec .fc .fc-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pec .fc .fc-col-header-cell {
    padding: 12px 8px;
    background: #fbfafa;
    border: 1px solid #e9ecef;
}

.pec .fc .fc-col-header-cell-cushion {
    text-decoration: none;
    color: #1a1a1a;
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.pec .fc .fc-daygrid-day {
    border: 1px solid #e9ecef;
    position: relative;
    transition: background 0.2s;
}

.pec .fc .fc-daygrid-day.fc-day-today {
    background: rgba(227, 6, 19, 0.05);
    position: relative;
}

.pec .fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
    background: #e30613;
    color: #fff;
    padding: 4px 8px;
    font-weight: 700;
}

.pec .fc .fc-daygrid-day:hover {
    background: #fbfafa;
}

.pec .fc .fc-daygrid-day-number {
    padding: 8px;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 14px;
}

.pec .fc .fc-daygrid-event {
    margin: 2px 4px;
    padding: 4px 8px;
    border: none;
    border-left: 3px solid;
    background: #e30613;
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.pec .fc .fc-daygrid-event:hover {
    opacity: 0.85;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pec .fc .fc-event-title {
    font-weight: 600;
}

.pec .fc .fc-daygrid-event .fc-event-time {
    display: none;
}

.pec .fc .fc-timegrid-event {
    border: none;
    border-left: 3px solid;
    background: #e30613;
    color: #fff;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pec .fc .fc-timegrid-event .fc-event-time,
.pec .fc .fc-timegrid-event .fc-event-title {
    color: #fff;
    font-weight: 600;
}

.pec .fc .fc-timegrid-event:hover {
    opacity: 0.85;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pec .fc .fc-list-event {
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.pec .fc .fc-list-event:hover {
    background: rgba(227, 6, 19, 0.05) !important;
    border-left-color: #e30613;
}

.pec .fc .fc-list-event:hover td {
    background: rgba(227, 6, 19, 0.05) !important;
}

.pec .fc .fc-list {
    border: 1px solid #e9ecef;
}

.pec .fc .fc-list .fc-list-event-dot {
    width: 8px;
    height: 8px;
    border: 2px solid #e30613;
    border-radius: 50%;
    background: #e30613;
}

.pec .fc .fc-list .fc-list-event-title {
    font-weight: 600;
    font-size: 14px;
}

.pec .fc .fc-list .fc-list-event-time {
    font-weight: 600;
    color: #666;
}

.pec .fc .fc-list .fc-list-day-cushion {
    background: #fbfafa;
    font-weight: 700;
    color: #1a1a1a;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    padding: 12px 16px;
}

.pec .fc .fc-list .fc-list-day-text {
    font-weight: 700;
}

.pec .fc .fc-list .fc-list-day-side-text {
    color: #999;
    font-weight: 600;
}

/* Animations */
@keyframes pec-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pec-slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pec-slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pec-slideInRight {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .pec__calendar-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .pec__container {
        padding: 10px !important;
    }

    .pec .fc .fc-toolbar.fc-header-toolbar {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 10px;
        margin-bottom: 15px;
        padding-bottom: 15px;
    }

    /* Tytul na gorze */
    .pec .fc .fc-toolbar.fc-header-toolbar .fc-toolbar-chunk:nth-child(2) {
        grid-column: 1;
        grid-row: 1;
        text-align: center;
        justify-content: center;
    }

    /* Strzalki nawigacji */
    .pec .fc .fc-toolbar.fc-header-toolbar .fc-toolbar-chunk:first-child {
        grid-column: 1;
        grid-row: 2;
        display: flex;
        justify-content: center;
    }

    /* Przyciski widoku */
    .pec .fc .fc-toolbar.fc-header-toolbar .fc-toolbar-chunk:last-child {
        grid-column: 1;
        grid-row: 3;
        display: flex;
        justify-content: center;
    }

    .pec .fc .fc-toolbar.fc-header-toolbar .fc-toolbar-title {
        font-size: 20px;
    }

    .pec__form-row {
        grid-template-columns: 1fr;
    }

    .pec__modal-body {
        padding: 30px 15px 20px;
    }

    .pec__modal-content {
        max-width: calc(100vw - 20px);
        margin: 10px;
    }

    .pec__toast {
        right: 10px;
        left: 10px;
        bottom: 10px;
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .pec__calendar-wrapper {
        overflow-x: auto !important;
    }

    .pec .fc .fc-toolbar-title {
        font-size: 18px !important;
    }

    .pec .fc .fc-button {
        padding: 6px 10px;
        font-size: 12px;
    }

    .pec .fc .fc-col-header-cell-cushion {
        font-size: 11px;
    }

    .pec .fc .fc-daygrid-day-number {
        padding: 4px;
        font-size: 12px;
    }

    .pec__filters {
        gap: 8px;
    }

    .pec__filter-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Print */
@media print {
    .fc-toolbar,
    .pec__filters,
    .pec__modal {
        display: none !important;
    }

    .fc-daygrid-event {
        page-break-inside: avoid;
    }

    .fc {
        border: 1px solid #000;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .pec *,
    .pec *::before,
    .pec *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
