/* ============================================
   PQ Werkstatt Booking Calendar v1.0
   ============================================ */

.pq-wb-calendar {
    margin: 30px 0 40px;
}

.pq-wb-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px;
    color: #333;
}

/* --- Navigation --- */
.pq-wb-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.pq-wb-nav-left {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pq-wb-prev,
.pq-wb-next {
    background: #333;
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-family: inherit;
    line-height: 1;
}
.pq-wb-prev:hover,
.pq-wb-next:hover {
    background: #555;
}
.pq-wb-today {
    background: #fff;
    color: #333;
    border: 2px solid #333;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    font-family: inherit;
}
.pq-wb-today:hover {
    background: #333;
    color: #fff;
}
.pq-wb-week-label {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

/* --- Grid --- */
.pq-wb-grid-wrap {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.pq-wb-grid {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}
.pq-wb-grid th,
.pq-wb-grid td {
    border: 1px solid #e0e0e0;
    padding: 0;
    text-align: center;
    vertical-align: middle;
}
.pq-wb-grid thead th {
    background: #f8f8f8;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
}
.pq-wb-grid thead th:first-child {
    width: 65px;
    background: #fff;
    border-top-color: transparent;
    border-left-color: transparent;
}

/* Hour label cells */
.pq-wb-hour {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    padding: 8px 6px !important;
    text-align: right !important;
    white-space: nowrap;
    background: #fafafa;
    width: 65px;
}

/* Slot cells */
.pq-wb-slot {
    height: 42px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s;
    min-width: 80px;
}
.pq-wb-frei {
    background: #4CAF50;
    color: #fff;
    cursor: pointer;
}
.pq-wb-frei:hover {
    background: #388E3C;
}
.pq-wb-teilweise {
    background: #FFA726;
    color: #fff;
    cursor: pointer;
}
.pq-wb-teilweise:hover {
    background: #F57C00;
}
.pq-wb-belegt {
    background: #e8e8e8;
    color: #aaa;
    cursor: default;
}

/* Loading state */
.pq-wb-grid-wrap.pq-wb-loading {
    opacity: 0.5;
    pointer-events: none;
}
.pq-wb-loading-spinner {
    display: none;
}
.pq-wb-grid-wrap.pq-wb-loading .pq-wb-loading-spinner {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #333;
    border-radius: 50%;
    animation: pq-wb-spin 0.7s linear infinite;
    z-index: 2;
}
@keyframes pq-wb-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* --- Legend --- */
.pq-wb-legend {
    margin-top: 12px;
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #666;
}
.pq-wb-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pq-wb-legend-frei,
.pq-wb-legend-teilweise,
.pq-wb-legend-belegt {
    display: inline-block;
    width: 16px;
    height: 16px;
}
.pq-wb-legend-frei {
    background: #4CAF50;
}
.pq-wb-legend-teilweise {
    background: #FFA726;
}
.pq-wb-legend-belegt {
    background: #e8e8e8;
}

/* ============================================
   Booking Popup
   ============================================ */
.pq-wb-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.pq-wb-popup {
    background: #fff;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 36px 32px 30px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.pq-wb-popup-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}
.pq-wb-popup-close:hover {
    color: #333;
}
.pq-wb-popup-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #333;
}
.pq-wb-slot-info {
    font-size: 15px;
    color: #555;
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eee;
}

/* Form */
.pq-wb-form input,
.pq-wb-form textarea,
.pq-wb-form select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #ddd;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fafafa;
    box-sizing: border-box;
    transition: border-color 0.2s;
    border-radius: 0;
    -webkit-appearance: none;
}
.pq-wb-form input:focus,
.pq-wb-form textarea:focus,
.pq-wb-form select:focus {
    outline: none;
    border-color: #333;
    background: #fff;
}
.pq-wb-form-row {
    margin-bottom: 12px;
}
.pq-wb-form-row-half {
    display: flex;
    gap: 10px;
}
.pq-wb-form-row-half > * {
    flex: 1;
}
.pq-wb-form textarea {
    resize: vertical;
}
.pq-wb-submit {
    display: block;
    width: 100%;
    background: #4CAF50;
    color: #fff;
    border: none;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-family: inherit;
    margin-top: 4px;
}
.pq-wb-submit:hover:not(:disabled) {
    background: #388E3C;
}
.pq-wb-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.pq-wb-status {
    margin-top: 12px;
    padding: 12px 14px;
    font-size: 14px;
    text-align: center;
}
.pq-wb-success {
    background: #edf7ed;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}
.pq-wb-error {
    background: #fdecea;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Responsive */
@media (max-width: 600px) {
    .pq-wb-popup {
        padding: 28px 18px 22px;
    }
    .pq-wb-form-row-half {
        flex-direction: column;
        gap: 12px;
    }
    .pq-wb-week-label {
        font-size: 15px;
    }
}
