/* ProfessionalDevelopment Styles */

.pd-container {
    padding: 1.5rem;
    color: #372562;
    position: relative;
}

/* Loading */
.pd-loading {
    text-align: center;
    padding: 3rem 1rem;
}

.pd-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ec5f59;
    border-radius: 50%;
    animation: pd-spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.pd-loading p {
    color: #372562;
    font-size: 0.95rem;
}

/* Error */
.pd-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pd-retry-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
}

.pd-retry-btn:hover {
    background: #b91c1c;
}

/* Toolbar */
.pd-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pd-section-title {
    color: #372562;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.pd-guide-btn {
    background: #F0F7F5;
    color: #372562;
    border: 1px solid #97c1bc;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pd-guide-btn:hover {
    background: #97c1bc;
    color: white;
}

.pd-guide-btn.active {
    background: #7c3aed;
    color: white;
    border-color: #7c3aed;
}

/* Sub-Tab Navigation */
.pd-subtabs {
    display: flex;
    gap: 4px;
    margin-bottom: 1.25rem;
    background: #F0F7F5;
    border-radius: 8px;
    padding: 4px;
}

.pd-subtab {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #372562;
    background: transparent;
    border-radius: 6px;
    transition: all 0.2s;
    text-align: center;
}

.pd-subtab:hover {
    background: #C8DDD8;
}

.pd-subtab.active {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    font-weight: 600;
}

/* Section Container */
.pd-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

/* Sub-Toolbar (filters + add button) */
.pd-sub-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pd-filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pd-filter-row label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #372562;
}

.pd-date-input {
    max-width: 160px;
}

.pd-add-btn {
    background: linear-gradient(135deg, #ec5f59 0%, #D4605A 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.pd-add-btn:hover {
    opacity: 0.9;
}

/* Input & Textarea */
.pd-input {
    padding: 0.5rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #372562;
    background: white;
    transition: border-color 0.2s;
    font-family: inherit;
}

.pd-input:focus {
    outline: none;
    border-color: #97c1bc;
}

.pd-input:disabled {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

.pd-textarea {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #372562;
    background: white;
    resize: none;
    overflow: hidden;
    min-height: 2.5em;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.pd-textarea:focus {
    outline: none;
    border-color: #97c1bc;
}

.pd-textarea:disabled {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

/* Empty State */
.pd-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #666;
}

/* ---- CPD Hours Summary ---- */
.pd-cpd-summary {
    margin-bottom: 1.25rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}

.pd-cpd-hours-bar {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.pd-cpd-hours-fill {
    height: 100%;
    background: linear-gradient(135deg, #97c1bc 0%, #6fa89a 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.pd-cpd-hours-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pd-cpd-hours-value {
    font-size: 1rem;
    font-weight: 700;
    color: #372562;
}

.pd-cpd-hours-info {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

/* ---- Table Styles ---- */
.pd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.pd-table thead th {
    background: #F0F7F5;
    color: #372562;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 2px solid #97c1bc;
}

.pd-table tbody td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    color: #372562;
    vertical-align: middle;
}

.pd-table tbody tr:hover {
    background: #f9fafb;
}

.pd-cell-truncate {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pd-actions-cell {
    white-space: nowrap;
}

.pd-edit-btn {
    background: #F0F7F5;
    color: #372562;
    border: 1px solid #97c1bc;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-right: 0.3rem;
}

.pd-edit-btn:hover {
    background: #97c1bc;
    color: white;
}

.pd-delete-btn {
    background: white;
    color: #dc2626;
    border: 1px solid #dc2626;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pd-delete-btn:hover {
    background: #fee2e2;
}

/* ---- NQT Competencies (simplified — single confirmation) ---- */
.pd-nqt-info-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    align-items: flex-start;
}

.pd-nqt-info-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.pd-nqt-info-content {
    flex: 1;
}

.pd-nqt-confirmed-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.pd-nqt-confirmed-icon {
    font-size: 1.5rem;
}

.pd-nqt-pending-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fffbeb;
    border: 1px solid #fdc758;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.pd-nqt-pending-icon {
    font-size: 1.5rem;
}

.pd-nqt-signoff-section {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.pd-nqt-signoff-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.pd-nqt-signoff-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #22c55e;
    cursor: pointer;
}

/* ---- Form Card ---- */
.pd-form-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.pd-form-header {
    background: linear-gradient(135deg, #ec5f59 0%, #D4605A 100%);
    color: white;
    padding: 0.85rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pd-form-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.pd-form-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pd-form-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.pd-form-body {
    padding: 1.25rem;
}

.pd-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pd-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
}

.pd-form-field label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #372562;
}

.pd-form-subheading {
    color: #372562;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 1.25rem 0 0.75rem 0;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid #97c1bc;
}

.pd-form-hint {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    margin: 0 0 1rem 0;
}

.pd-form-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    background: #fafafa;
}

/* ---- PDR Objective Cards ---- */
.pd-objective-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #fafafa;
}

.pd-objective-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.pd-objective-num {
    font-weight: 700;
    font-size: 0.9rem;
    color: #7c3aed;
}

.pd-remove-obj-btn {
    background: transparent;
    color: #dc2626;
    border: 1px solid #dc2626;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.pd-remove-obj-btn:hover {
    background: #fee2e2;
}

.pd-add-obj-btn {
    background: #F0F7F5;
    color: #372562;
    border: 1px solid #97c1bc;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

.pd-add-obj-btn:hover {
    background: #97c1bc;
    color: white;
}

/* ---- Buttons ---- */
.pd-btn-save {
    background: linear-gradient(135deg, #ec5f59 0%, #D4605A 100%);
    color: white;
    border: none;
    padding: 0.55rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.pd-btn-save:hover:not(:disabled) {
    opacity: 0.9;
}

.pd-btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pd-btn-cancel {
    background: white;
    color: #372562;
    border: 1px solid #ccc;
    padding: 0.55rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.pd-btn-cancel:hover {
    background: #f5f5f5;
}

.pd-btn-delete {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.55rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.pd-btn-delete:hover:not(:disabled) {
    opacity: 0.9;
}

.pd-btn-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Save Messages */
.pd-save-success {
    background: #dcfce7;
    color: #16a34a;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.pd-save-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* ---- Delete Modal ---- */
.pd-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.pd-modal {
    background: white;
    border-radius: 12px;
    width: 420px;
    max-width: 95vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.pd-modal-header {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.pd-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.pd-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pd-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.pd-modal-body {
    padding: 1.25rem;
    color: #372562;
    font-size: 0.95rem;
}

.pd-modal-body p {
    margin: 0 0 0.5rem 0;
}

.pd-modal-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
}

/* ---- Reflection Guide Panel ---- */
.pd-guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10001;
    display: flex;
    justify-content: flex-end;
}

.pd-guide-panel {
    width: 420px;
    max-width: 90vw;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: pd-slide-in 0.25s ease-out;
}

@keyframes pd-slide-in {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.pd-guide-header {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.pd-guide-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.pd-guide-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pd-guide-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.pd-guide-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

.pd-guide-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.pd-guide-section {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.pd-guide-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-weight: 700;
}

.pd-guide-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    font-size: 1rem;
    font-weight: 800;
    flex-shrink: 0;
}

.pd-guide-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
}

/* STAR section colours */
.pd-guide-situation {
    background: linear-gradient(135deg, #ec5f59 0%, #D4605A 100%);
}

.pd-guide-situation .pd-guide-letter {
    color: #ec5f59;
}

.pd-guide-task {
    background: linear-gradient(135deg, #fdc758 0%, #d4a43a 100%);
}

.pd-guide-task .pd-guide-letter {
    color: #fdc758;
}

.pd-guide-action {
    background: linear-gradient(135deg, #97c1bc 0%, #6fa89a 100%);
}

.pd-guide-action .pd-guide-letter {
    color: #97c1bc;
}

.pd-guide-reflect {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.pd-guide-reflect .pd-guide-letter {
    color: #7c3aed;
}

.pd-guide-prompt {
    padding: 0.75rem 1rem 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #372562;
    font-style: italic;
}

.pd-guide-questions {
    padding: 0.25rem 1rem 0.75rem 2rem;
    margin: 0;
    list-style: disc;
}

.pd-guide-questions li {
    font-size: 0.85rem;
    color: #372562;
    margin-bottom: 0.35rem;
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 768px) {
    .pd-container {
        padding: 1rem;
    }

    .pd-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .pd-subtabs {
        flex-direction: column;
        gap: 2px;
    }

    .pd-sub-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .pd-filter-row {
        width: 100%;
    }

    .pd-form-grid {
        grid-template-columns: 1fr;
    }

    .pd-table {
        font-size: 0.8rem;
    }

    .pd-table thead th,
    .pd-table tbody td {
        padding: 0.5rem 0.5rem;
    }

    .pd-guide-panel {
        width: 100%;
        max-width: 100vw;
    }
}
