/**
 * DRTPC Experts Directory — Dashboard Styles
 * Expert Dashboard overview and edit form
 * Uses design tokens from directory.css
 *
 * @package DRTPC_Experts_Directory
 */

/* ===== Dashboard Wrapper ===== */
.drtpc-dashboard-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 20px;
    font-family: var(--drtpc-font-family);
    color: var(--drtpc-text-dark);
    -webkit-font-smoothing: antialiased;
}

/* ===== Dashboard Header ===== */
.drtpc-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--drtpc-primary-light);
}

.drtpc-dashboard-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--drtpc-text-dark);
    margin: 0;
}

/* ===== Status Badge ===== */
.drtpc-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--drtpc-badge-radius);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.drtpc-status-published {
    background: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.drtpc-status-pending {
    background: #FFF3CD;
    color: #856404;
    border: 1px solid #FFEEBA;
}

.drtpc-status-draft {
    background: var(--drtpc-bg-subtle);
    color: var(--drtpc-text-light);
    border: 1px solid var(--drtpc-border);
}

.drtpc-status-rejected {
    background: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

/* ===== Notices ===== */
.drtpc-notice {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    animation: drtpc-fadeInUp 0.3s ease-out;
}

.drtpc-notice p {
    margin: 0;
}

.drtpc-notice-info {
    background: var(--drtpc-primary-light);
    color: var(--drtpc-primary);
    border: 1px solid rgba(var(--drtpc-primary-rgb), 0.2);
}

.drtpc-notice-warning {
    background: #FFF3CD;
    color: #856404;
    border: 1px solid #FFEEBA;
}

.drtpc-notice-success {
    background: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.drtpc-notice-error {
    background: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

/* ===== Dashboard Content ===== */
.drtpc-dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ===== Dashboard Cards ===== */
.drtpc-dashboard-card {
    background: var(--drtpc-card-bg);
    border: 1px solid var(--drtpc-border);
    border-radius: var(--drtpc-card-radius);
    overflow: hidden;
    box-shadow: var(--drtpc-shadow-sm);
    transition: box-shadow var(--drtpc-transition);
}

.drtpc-dashboard-card:hover {
    box-shadow: var(--drtpc-shadow-md);
}

.drtpc-card-header {
    padding: 18px 24px;
    background: var(--drtpc-bg-light);
    border-bottom: 1px solid var(--drtpc-border-light);
}

.drtpc-card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--drtpc-text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.drtpc-card-body {
    padding: 24px;
}

/* ===== Profile Preview ===== */
.drtpc-profile-summary {
    display: flex;
    align-items: center;
    gap: 24px;
}

.drtpc-profile-photo img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--drtpc-primary-light);
    box-shadow: var(--drtpc-shadow-sm);
}

.drtpc-profile-info {
    flex: 1;
}

.drtpc-profile-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--drtpc-text-dark);
    margin: 0 0 4px;
}

.drtpc-profile-title {
    font-size: 14px;
    color: var(--drtpc-text-medium);
    margin: 0 0 4px;
}

.drtpc-profile-years {
    font-size: 13px;
    color: var(--drtpc-text-light);
    margin: 0 0 12px;
}

.drtpc-profile-info .drtpc-department-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ===== Action Buttons ===== */
.drtpc-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.drtpc-action-buttons .drtpc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--drtpc-btn-radius);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--drtpc-font-family);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--drtpc-transition);
    text-decoration: none;
}

.drtpc-action-buttons .drtpc-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.drtpc-action-buttons .drtpc-btn-primary {
    background: var(--drtpc-primary);
    color: var(--drtpc-text-on-primary);
    border-color: var(--drtpc-primary);
}

.drtpc-action-buttons .drtpc-btn-primary:hover {
    background: var(--drtpc-primary-hover);
    border-color: var(--drtpc-primary-hover);
    box-shadow: var(--drtpc-shadow-md);
    transform: translateY(-1px);
}

.drtpc-action-buttons .drtpc-btn-secondary {
    background: transparent;
    color: var(--drtpc-primary);
    border-color: var(--drtpc-primary);
}

.drtpc-action-buttons .drtpc-btn-secondary:hover {
    background: var(--drtpc-primary);
    color: var(--drtpc-text-on-primary);
}

.drtpc-action-buttons .drtpc-btn-logout {
    background: transparent;
    color: var(--drtpc-text-light);
    border-color: var(--drtpc-border);
}

.drtpc-action-buttons .drtpc-btn-logout:hover {
    color: #DC3545;
    border-color: #DC3545;
}

.drtpc-action-buttons .drtpc-btn-disabled {
    background: var(--drtpc-bg-subtle);
    color: var(--drtpc-text-light);
    border-color: var(--drtpc-border);
    cursor: not-allowed;
    opacity: 0.7;
}

/* ===== Edit Form within Dashboard ===== */
.drtpc-dashboard-wrapper .drtpc-form-wizard {
    margin-top: 8px;
}

.drtpc-dashboard-wrapper .drtpc-form-group {
    margin-bottom: 22px;
}

.drtpc-dashboard-wrapper .drtpc-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--drtpc-text-dark);
    margin-bottom: 8px;
}

.drtpc-dashboard-wrapper .drtpc-required {
    color: #DC3545;
    font-weight: 400;
}

.drtpc-dashboard-wrapper .drtpc-input,
.drtpc-dashboard-wrapper .drtpc-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--drtpc-border);
    border-radius: 10px;
    font-size: 15px;
    font-family: var(--drtpc-font-family);
    color: var(--drtpc-text-dark);
    background: var(--drtpc-bg-white);
    transition: all var(--drtpc-transition);
    box-sizing: border-box;
}

.drtpc-dashboard-wrapper .drtpc-input:focus,
.drtpc-dashboard-wrapper .drtpc-textarea:focus {
    border-color: var(--drtpc-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(var(--drtpc-primary-rgb), 0.08);
}

/* Edit form actions */
.drtpc-dashboard-wrapper .drtpc-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--drtpc-border-light);
    gap: 16px;
}

.drtpc-dashboard-wrapper .drtpc-form-actions .drtpc-btn-primary {
    background: var(--drtpc-primary);
    color: var(--drtpc-text-on-primary);
    border-color: var(--drtpc-primary);
    padding: 12px 28px;
}

.drtpc-dashboard-wrapper .drtpc-form-actions .drtpc-btn-primary:hover {
    background: var(--drtpc-primary-hover);
    box-shadow: var(--drtpc-shadow-md);
}

.drtpc-dashboard-wrapper .drtpc-form-actions .drtpc-btn-secondary {
    background: transparent;
    color: var(--drtpc-text-medium);
    border-color: var(--drtpc-border);
    padding: 12px 28px;
}

.drtpc-dashboard-wrapper .drtpc-form-actions .drtpc-btn-secondary:hover {
    border-color: var(--drtpc-primary);
    color: var(--drtpc-primary);
}

/* Form message in dashboard */
.drtpc-dashboard-wrapper .drtpc-form-message {
    padding: 16px 20px;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 500;
    animation: drtpc-fadeInUp 0.3s ease-out;
}

/* ===== Shared Form Elements in Dashboard ===== */
.drtpc-dashboard-wrapper .drtpc-file-upload {
    position: relative;
    cursor: pointer;
}

.drtpc-dashboard-wrapper .drtpc-file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    top: 0;
    left: 0;
}

.drtpc-dashboard-wrapper .drtpc-file-preview {
    padding: 24px 20px;
    border: 2px dashed var(--drtpc-border);
    border-radius: 12px;
    text-align: center;
    background: var(--drtpc-bg-light);
    transition: all var(--drtpc-transition);
}

.drtpc-dashboard-wrapper .drtpc-file-upload:hover .drtpc-file-preview {
    border-color: var(--drtpc-primary);
    background: var(--drtpc-primary-light);
}

.drtpc-dashboard-wrapper .drtpc-file-preview img {
    border-radius: 50%;
    border: 3px solid var(--drtpc-primary-light);
    max-width: 80px;
}

.drtpc-dashboard-wrapper .drtpc-file-preview .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: var(--drtpc-primary);
    opacity: 0.5;
    display: block;
    margin: 0 auto 8px;
}

.drtpc-dashboard-wrapper .drtpc-file-preview p {
    font-size: 13px;
    color: var(--drtpc-text-light);
    margin: 0;
}

/* Experience entries */
.drtpc-dashboard-wrapper .drtpc-experience-entry {
    background: var(--drtpc-bg-light);
    border: 1px solid var(--drtpc-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
}

.drtpc-dashboard-wrapper .drtpc-exp-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.drtpc-dashboard-wrapper .drtpc-btn-add-exp {
    background: transparent;
    color: var(--drtpc-primary);
    border: 2px dashed var(--drtpc-primary);
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    width: 100%;
    margin-top: 8px;
    cursor: pointer;
    font-family: var(--drtpc-font-family);
    transition: all var(--drtpc-transition);
}

.drtpc-dashboard-wrapper .drtpc-btn-add-exp:hover {
    background: var(--drtpc-primary-light);
}

.drtpc-dashboard-wrapper .drtpc-btn-remove-exp {
    background: transparent;
    color: #DC3545;
    border: 1px solid #DC3545;
    border-radius: 6px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    cursor: pointer;
    font-family: var(--drtpc-font-family);
    transition: all var(--drtpc-transition);
}

.drtpc-dashboard-wrapper .drtpc-btn-remove-exp:hover {
    background: #DC3545;
    color: #fff;
}

/* Department checkboxes */
.drtpc-dashboard-wrapper .drtpc-department-checkboxes {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid var(--drtpc-border);
    border-radius: 12px;
    padding: 16px;
    background: var(--drtpc-bg-white);
}

.drtpc-dashboard-wrapper .drtpc-dept-group {
    margin-bottom: 16px;
}

.drtpc-dashboard-wrapper .drtpc-dept-group-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--drtpc-primary);
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--drtpc-border-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.drtpc-dashboard-wrapper .drtpc-dept-group-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 4px;
}

.drtpc-dashboard-wrapper .drtpc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--drtpc-transition);
    font-size: 13px;
    color: var(--drtpc-text-medium);
}

.drtpc-dashboard-wrapper .drtpc-checkbox-label:hover {
    background: var(--drtpc-primary-light);
}

.drtpc-dashboard-wrapper .drtpc-checkbox-label input[type="checkbox"] {
    accent-color: var(--drtpc-primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ===== Animation ===== */
@keyframes drtpc-fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.drtpc-dashboard-card {
    animation: drtpc-fadeInUp 0.4s ease-out both;
}

.drtpc-dashboard-card:nth-child(2) {
    animation-delay: 0.1s;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .drtpc-dashboard-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .drtpc-profile-summary {
        flex-direction: column;
        text-align: center;
    }

    .drtpc-profile-info .drtpc-department-badges {
        justify-content: center;
    }

    .drtpc-action-buttons {
        flex-direction: column;
    }

    .drtpc-action-buttons .drtpc-btn {
        width: 100%;
        justify-content: center;
    }

    .drtpc-dashboard-wrapper .drtpc-form-actions {
        flex-direction: column;
    }

    .drtpc-dashboard-wrapper .drtpc-form-actions .drtpc-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .drtpc-dashboard-wrapper .drtpc-exp-row {
        grid-template-columns: 1fr;
    }
}

/* ===== RTL ===== */
[dir="rtl"] .drtpc-dashboard-wrapper {
    font-family: 'Cairo', 'Euclid Circular B', -apple-system, BlinkMacSystemFont, sans-serif;
}

[dir="rtl"] .drtpc-dashboard-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .drtpc-action-buttons {
    flex-direction: row-reverse;
}