/* ====================================
   APPOINTMENTS CALENDAR
   ==================================== */

.pn-appointments-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-family: "Poppins", sans-serif;
}

/* -------- SELECTOR DE VISTA -------- */
.pn-view-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
}

.pn-view-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    font-family: "Poppins", sans-serif;
}

.pn-view-btn svg {
    fill: currentColor;
}

.pn-view-btn:hover {
    background: #fff;
    color: #000;
}

.pn-view-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* -------- VISTAS -------- */
.pn-view {
    display: none;
}

.pn-view.active {
    display: block;
}

/* -------- LEYENDA DE STATUS -------- */
.pn-status-legend {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.pn-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pn-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.pn-legend-dot.pn-legend-completed {
    background: #28a745;
}

.pn-legend-dot.pn-legend-pending {
    background: #ffc107;
}

.pn-legend-dot.pn-legend-cancelled {
    background: #dc3545;
}

.pn-legend-text {
    font-size: 14px;
    font-weight: 600;
}

.pn-text-completed {
    color: #28a745;
}

.pn-text-pending {
    color: #ffc107;
}

.pn-text-cancelled {
    color: #dc3545;
}

/* -------- VISTA CALENDARIO -------- */
.pn-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

.pn-current-month {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.pn-month-nav {
    background: #000;
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pn-month-nav:hover {
    background: #333;
}

.pn-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #ddd;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.pn-calendar-day-header {
    background: #f0f0f0;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.pn-calendar-day {
    background: #fff;
    min-height: 100px;
    padding: 8px;
    position: relative;
}

.pn-calendar-day.other-month {
    background: #fafafa;
    opacity: 0.5;
}

.pn-calendar-day.today {
    background: #fffbf0;
    border: 2px solid #000;
}

.pn-day-number {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.pn-day-appointments {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pn-calendar-appointment {
    background: #e8f4f8;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.2s;
    border-left: 3px solid #0073aa;
}

.pn-calendar-appointment.status-completed {
    border-left-color: #28a745;
}

.pn-calendar-appointment.status-cancelled {
    border-left-color: #dc3545;
}

.pn-calendar-appointment.status-pending {
    border-left-color: #ffc107;
}

.pn-calendar-appointment:hover {
    background: #d3e9f1;
}

.pn-apt-time-cal {
    font-weight: 600;
    color: #0073aa;
    display: block;
}

.pn-apt-client-cal {
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -------- VISTA LISTA -------- */
.pn-list-filter {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 25px;
}

.pn-filter-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pn-filter-field label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.pn-filter-date {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: "Poppins", sans-serif;
    min-width: 150px;
}

.pn-apply-filter {
    padding: 8px 20px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: "Poppins", sans-serif;
    transition: background 0.3s;
}

.pn-apply-filter:hover {
    background: #333;
}

.pn-appointments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pn-no-appointments {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
}

.pn-appointment-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pn-appointment-item.status-completed {
    border-left-color: #28a745;
}

.pn-appointment-item.status-cancelled {
    border-left-color: #dc3545;
}

.pn-appointment-item.status-pending {
    border-left-color: #ffc107;
}

.pn-appointment-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pn-apt-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    min-width: 60px;
}

.pn-apt-day {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.pn-apt-month {
    font-size: 12px;
    text-transform: uppercase;
    margin-top: 2px;
}

.pn-apt-details {
    flex: 1;
}

.pn-apt-time {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.pn-apt-client {
    font-size: 14px;
    color: #666;
}

.pn-apt-status {
    display: flex;
    align-items: center;
}

.pn-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.pn-status-completed {
    background: #d4edda;
    color: #155724;
}

.pn-status-pending {
    background: #fff3cd;
    color: #856404;
}

.pn-status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* -------- PAGINACIÓN -------- */
.pn-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 25px;
    padding: 20px 0;
}

.pn-page-btn {
    padding: 8px 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
    font-family: "Poppins", sans-serif;
}

.pn-page-btn:hover {
    background: #f5f5f5;
    border-color: #000;
}

.pn-page-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* -------- MODAL -------- */
.pn-appointment-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.pn-appointment-modal.active {
    display: block;
}

.pn-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
}

.pn-modal-content {
    position: relative;
    background: #fff;
    max-width: 500px;
    margin: 50px auto;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 10000;
    font-family: "Poppins", sans-serif;
}

.pn-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.pn-modal-close:hover {
    color: #333;
}

.pn-modal-content h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #333;
}

.pn-modal-body {
    margin-bottom: 25px;
}

.pn-modal-field {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.pn-modal-field:last-child {
    border-bottom: none;
}

.pn-modal-field label {
    font-weight: 600;
    color: #666;
    min-width: 120px;
}

.pn-modal-field span {
    color: #333;
}

.pn-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.pn-cancel-appointment-btn {
    background: #dc3545;
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
    display: inline-block;
}

.pn-cancel-appointment-btn:hover {
    background: #c82333;
    color: #fff;
}

/* -------- RESPONSIVE -------- */
@media screen and (max-width: 768px) {
    .pn-appointments-wrapper {
        padding: 15px;
    }

    .pn-view-btn span {
        display: none;
    }

    .pn-calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 2px;
    }

    .pn-calendar-day {
        min-height: 80px;
        padding: 4px;
    }

    .pn-day-number {
        font-size: 12px;
    }

    .pn-calendar-appointment {
        font-size: 9px;
        padding: 2px 4px;
    }

    .pn-status-legend {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px;
    }

    .pn-legend-item {
        gap: 6px;
    }

    .pn-legend-text {
        font-size: 12px;
    }

    .pn-pagination {
        flex-wrap: wrap;
        gap: 5px;
    }

    .pn-page-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .pn-list-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .pn-filter-field {
        width: 100%;
    }

    .pn-filter-date {
        width: 100%;
    }

    .pn-apply-filter {
        width: 100%;
        padding: 12px;
    }

    .pn-appointment-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .pn-apt-date-badge {
        min-width: 50px;
        padding: 8px;
    }

    .pn-modal-content {
        margin: 20px;
        padding: 20px;
    }

    .pn-modal-field {
        flex-direction: column;
        gap: 5px;
    }

    .pn-modal-field label {
        min-width: auto;
    }
}
