/**
 * NCT Group Training Manager - Dashboard Styles
 *
 * Styles for the Group Leader dashboard in WooCommerce My Account.
 *
 * @package NCT_Group_Training_Manager
 */

/* Dashboard Container */
.nct-dashboard {
    max-width: 100%;
}

/* Admin Mode Bar */
.nct-admin-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.nct-admin-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.nct-admin-notice .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.nct-admin-org-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nct-admin-org-selector label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    white-space: nowrap;
}

.nct-admin-org-selector select {
    padding: 8px 35px 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    min-width: 200px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.nct-admin-org-selector select:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background-color: #fff;
}

.nct-admin-org-selector select:focus {
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Leader Organisation Switcher (shown when a leader runs more than one org) */
.nct-leader-org-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.nct-leader-org-switcher label {
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
    white-space: nowrap;
}

.nct-leader-org-switcher select {
    flex: 1;
    max-width: 360px;
    padding: 8px 35px 8px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #1d2327;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.nct-leader-org-switcher select:hover {
    border-color: #8c8f94;
}

.nct-leader-org-switcher select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.25);
}

/* Admin Selector Page (when no org is selected) */
.nct-admin-selector-page {
    padding: 0;
}

.nct-admin-selector-header {
    text-align: center;
    padding: 40px 20px 30px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 12px;
    margin-bottom: 30px;
}

.nct-admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}

.nct-admin-badge .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.nct-admin-selector-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px 0;
}

.nct-admin-subtitle {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Bar */
.nct-org-search-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.nct-search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.nct-search-input-wrapper .dashicons {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.nct-search-input-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s;
    background: #fff;
}

.nct-search-input-wrapper input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.nct-search-input-wrapper input::placeholder {
    color: #9ca3af;
}

.nct-org-count {
    color: #6c757d;
    font-size: 14px;
    white-space: nowrap;
}

.nct-org-count span {
    font-weight: 700;
    color: #667eea;
}

/* Organisation Cards Grid */
.nct-org-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    text-align: left;
}

.nct-org-card {
    display: block;
    background: #fff;
    border: none;
    border-radius: 16px;
    padding: 0;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.nct-org-card:hover {
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.2), 0 8px 16px rgba(102, 126, 234, 0.1);
    transform: translateY(-6px);
    text-decoration: none;
}

.nct-org-card:active {
    transform: translateY(-2px);
}

.nct-org-card-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
    background: #fff;
    position: relative;
}

/* Subtle gradient overlay on card header */
.nct-org-card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nct-org-card:hover .nct-org-card-header::before {
    opacity: 1;
}

.nct-org-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.nct-org-card:hover .nct-org-icon {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.45);
}

.nct-org-icon .dashicons {
    color: #fff;
    font-size: 26px;
    width: 26px;
    height: 26px;
}

.nct-org-initials {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.nct-org-card-title {
    flex: 1;
    min-width: 0;
}

.nct-org-card-title h3 {
    font-size: 19px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px 0;
    line-height: 1.3;
    transition: color 0.2s ease;
}

.nct-org-card:hover .nct-org-card-title h3 {
    color: #667eea;
}

.nct-org-leader {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #6c757d;
}

.nct-org-leader .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    color: #9ca3af;
}

.nct-org-arrow {
    color: #cbd5e1;
    font-size: 22px;
    width: 22px;
    height: 22px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.nct-org-card:hover .nct-org-arrow {
    color: #667eea;
    transform: translateX(5px);
}

.nct-org-card-stats {
    display: flex;
    background: linear-gradient(180deg, #f8f9fc 0%, #f1f3f9 100%);
    border-top: 1px solid #eef0f5;
    padding: 0;
}

.nct-org-stat {
    flex: 1;
    text-align: center;
    padding: 18px 14px;
    border-right: 1px solid #eef0f5;
    transition: background-color 0.2s ease;
}

.nct-org-stat:last-child {
    border-right: none;
}

.nct-org-card:hover .nct-org-stat {
    background: rgba(102, 126, 234, 0.04);
}

.nct-org-stat-value {
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.1;
}

.nct-org-stat-value.has-seats {
    color: #10b981;
}

.nct-org-stat-label {
    display: block;
    font-size: 11px;
    color: #8b95a5;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 6px;
    font-weight: 600;
}

/* Empty State */
.nct-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #e5e7eb;
}

.nct-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #cbd5e1;
    margin-bottom: 15px;
}

.nct-empty-state h3 {
    font-size: 20px;
    color: #1a1a2e;
    margin: 0 0 10px 0;
}

.nct-empty-state p {
    color: #6c757d;
    margin: 0;
}

/* No Results */
.nct-no-results {
    text-align: center;
    padding: 50px 20px;
}

.nct-no-results .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: #cbd5e1;
    margin-bottom: 10px;
}

.nct-no-results p {
    color: #6c757d;
    margin: 0;
}

/* Responsive adjustments for admin bar and selector */
@media (max-width: 768px) {
    .nct-admin-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .nct-admin-org-selector {
        width: 100%;
    }

    .nct-admin-org-selector select {
        width: 100%;
        min-width: 0;
    }

    .nct-org-selector-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .nct-admin-selector-header h1 {
        font-size: 26px;
    }

    .nct-org-search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .nct-search-input-wrapper {
        max-width: 100%;
    }

    .nct-org-count {
        text-align: center;
    }

    .nct-org-card {
        border-radius: 12px;
    }

    .nct-org-card-header {
        padding: 18px 16px;
    }

    .nct-org-card-header::before {
        height: 3px;
    }

    .nct-org-icon {
        width: 52px;
        height: 52px;
        border-radius: 12px;
    }

    .nct-org-initials {
        font-size: 18px;
    }

    .nct-org-card-title h3 {
        font-size: 17px;
        margin-bottom: 6px;
    }

    .nct-org-leader {
        font-size: 13px;
    }

    .nct-org-stat {
        padding: 14px 10px;
    }

    .nct-org-stat-value {
        font-size: 22px;
    }

    .nct-org-stat-label {
        font-size: 10px;
        letter-spacing: 0.5px;
    }
}

/* Dashboard Header */
.nct-dashboard-header {
    margin-bottom: 30px;
}

.nct-org-name-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nct-org-name {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.nct-edit-org-name {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.nct-edit-org-name:hover {
    opacity: 1;
}

.nct-org-name-edit {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.nct-org-name-edit input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    min-width: 300px;
}

/* Stats Row */
.nct-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.nct-stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.nct-stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.nct-stat-label {
    display: block;
    font-size: 14px;
    color: #6c757d;
    margin-top: 5px;
}

/* Sections */
.nct-section {
    margin-bottom: 30px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
}

.nct-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #333;
}

.nct-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.nct-section-header h3 {
    margin: 0;
    flex-shrink: 0;
}

/* Ensure button in section header is always clickable */
.nct-section-header .nct-button {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

/* Tables */
.nct-table-wrapper {
    overflow-x: auto;
}

.nct-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.nct-table th,
.nct-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.nct-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.nct-table tbody tr:hover {
    background: #f8f9fa;
}

.nct-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.nct-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.nct-badge-success {
    background: #d4edda;
    color: #155724;
}

.nct-badge-warning {
    background: #fff3cd;
    color: #856404;
}

.nct-badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.nct-na {
    color: #999;
    font-style: italic;
}

/* Buttons */
.nct-button {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    background: #f8f9fa;
    color: #333;
    pointer-events: auto;
    position: relative;
    z-index: 10;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    box-sizing: border-box;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
}

.nct-button:hover {
    background: #e9ecef;
    cursor: pointer;
}

.nct-button:active {
    transform: translateY(1px);
}

.nct-button-primary {
    background: #3498db;
    color: #fff;
}

.nct-button-primary:hover {
    background: #2980b9;
    color: #fff;
    cursor: pointer;
}

.nct-button-primary:focus {
    outline: 2px solid #2980b9;
    outline-offset: 2px;
}

.nct-button-small {
    padding: 6px 12px;
    font-size: 12px;
}

.nct-link-button {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-size: inherit;
}

.nct-link-button:hover {
    color: #2980b9;
}

/* Empty State */
.nct-empty-message {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

/* Modal */
.nct-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: 9999;
    padding: 20px;
}

.nct-modal {
    background: #fff;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.nct-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.nct-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.nct-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
}

.nct-modal-close:hover {
    color: #333;
}

.nct-modal-body {
    padding: 20px;
}

.nct-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

/* Form Elements */
.nct-form-group {
    margin-bottom: 20px;
}

.nct-form-group:last-child {
    margin-bottom: 0;
}

.nct-form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.nct-form-group label .required {
    color: #dc3545;
}

.nct-form-group input[type="text"],
.nct-form-group input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.nct-form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

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

/* Course Checkboxes */
.nct-course-checkboxes {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 10px;
}

.nct-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.nct-checkbox-label:hover {
    background: #f8f9fa;
}

.nct-checkbox-label.nct-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nct-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.nct-seats-available {
    font-size: 12px;
    color: #28a745;
    margin-left: auto;
}

.nct-no-seats {
    font-size: 12px;
    color: #dc3545;
    margin-left: auto;
}

/* Form Notice */
.nct-form-notice {
    padding: 12px 15px;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 14px;
}

.nct-form-notice.nct-notice-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.nct-form-notice.nct-notice-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Progress Display */
.nct-progress-course {
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 15px;
}

.nct-progress-course.completed {
    border-color: #28a745;
    background: #f8fff8;
}

.nct-progress-course:last-child {
    margin-bottom: 0;
}

.nct-progress-course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.nct-progress-course-name {
    font-weight: 600;
    flex: 1;
}

.nct-progress-bar-container {
    background: #e9ecef;
    border-radius: 10px;
    height: 10px;
    margin-bottom: 10px;
}

.nct-progress-bar-fill {
    background: #3498db;
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.nct-progress-bar-fill.completed {
    background: #28a745;
}

.nct-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.nct-progress-status {
    color: #6c757d;
}

.nct-progress-status.completed {
    color: #28a745;
    font-weight: 500;
}

.nct-certificate-link {
    color: #3498db;
    text-decoration: none;
}

.nct-certificate-link:hover {
    text-decoration: underline;
}

/* Certificate Download Button */
.nct-certificate-btn {
    background: #28a745 !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    white-space: nowrap;
}

.nct-certificate-btn:hover {
    background: #218838 !important;
    color: #fff !important;
    text-decoration: none;
}

.nct-certificate-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
}

/* Loading */
.nct-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* No Access */
.nct-no-access {
    text-align: center;
    padding: 60px 20px;
}

.nct-no-access-content .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    color: #6c757d;
    margin-bottom: 20px;
}

.nct-no-access h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

.nct-no-access p {
    color: #6c757d;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .nct-stats-row {
        grid-template-columns: 1fr 1fr;
    }

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

    .nct-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .nct-modal {
        max-width: 100%;
        margin: 10px;
    }

    .nct-table th,
    .nct-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .nct-stats-row {
        grid-template-columns: 1fr;
    }

    .nct-org-name-edit {
        flex-direction: column;
        align-items: stretch;
    }

    .nct-org-name-edit input {
        min-width: 100%;
    }
}

/* Fix for button click issues - ensure no overlapping elements */
.nct-dashboard {
    position: relative;
    z-index: 1;
}

.nct-dashboard .nct-section {
    overflow: visible;
    position: relative;
}

.nct-dashboard .nct-section::before,
.nct-dashboard .nct-section::after {
    pointer-events: none;
}

/* Ensure ALL buttons in the dashboard are clickable */
#nct-add-learner-btn,
#nct-add-first-learner,
.nct-view-progress,
.nct-dashboard .nct-button {
    position: relative;
    z-index: 9999 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    isolation: isolate;
}

/* Remove any potential WooCommerce/theme interference */
.woocommerce-MyAccount-content .nct-button,
.woocommerce-account .nct-button,
.woocommerce-MyAccount-content .nct-dashboard .nct-button {
    position: relative;
    z-index: 9999 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Ensure the table cells with buttons don't have overflow issues */
.nct-table td {
    position: relative;
    overflow: visible;
}

/* Ensure section header doesn't have any interfering pseudo-elements */
.nct-section-header::before,
.nct-section-header::after {
    content: none !important;
    display: none !important;
}

/* Fix for any sticky headers or banners that might overlay content */
.nct-dashboard .nct-section-header,
.nct-dashboard .nct-table-wrapper {
    position: relative;
    z-index: 10;
}

/* Ensure table rows and cells don't block clicks */
.nct-dashboard .nct-table tbody tr {
    position: relative;
}

.nct-dashboard .nct-table tbody td:last-child {
    position: relative;
    z-index: 100;
    overflow: visible;
}

/* Aggressive fix for theme overlays and sticky elements */
.woocommerce-MyAccount-content {
    position: relative;
}

/* Ensure no invisible overlays are blocking clicks */
.woocommerce-MyAccount-content > *:not(.nct-dashboard),
.woocommerce-MyAccount-content::before,
.woocommerce-MyAccount-content::after {
    pointer-events: none;
}

.woocommerce-MyAccount-content .nct-dashboard,
.woocommerce-MyAccount-content .nct-dashboard * {
    pointer-events: auto;
}

/* Fix for any fixed/sticky promotional banners that might overlay */
body.woocommerce-account .nct-dashboard {
    position: relative;
    z-index: 100;
}

/* Ensure buttons always receive pointer events */
.nct-dashboard button,
.nct-dashboard .nct-button,
.nct-dashboard a.nct-button {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative;
    z-index: 9999 !important;
}

/* Target the specific action cells in tables */
.nct-dashboard .nct-table td:last-child,
.nct-dashboard .nct-learners-table td:last-child {
    position: relative;
    z-index: 1000;
}

/* Section header with button needs high z-index */
.nct-section-header {
    position: relative;
    z-index: 1000 !important;
}

/* Ensure the button container in section header is clickable */
.nct-section-header > .nct-button {
    z-index: 10000 !important;
}

/* =====================================================
   COMPLETION REPORT SECTION
   ===================================================== */

.nct-report-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.nct-report-section .nct-section-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

/* Report Summary Container */
.nct-report-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 12px;
    margin-bottom: 30px;
}

/* Overall Completion Circle */
.nct-report-overall {
    text-align: center;
    flex-shrink: 0;
}

.nct-report-circle-container {
    width: 140px;
    height: 140px;
    margin: 0 auto 12px;
    position: relative;
}

.nct-circular-chart {
    width: 100%;
    height: 100%;
    display: block;
}

.nct-circle-bg {
    fill: none;
    stroke: #e6e9f5;
    stroke-width: 3.5;
}

.nct-circle-progress {
    fill: none;
    stroke: #667eea;
    stroke-width: 3.5;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dasharray 0.6s ease;
}

.nct-circle-percentage {
    fill: #1a1a2e;
    font-size: 9px;
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: central;
}

/* Alternative: Simple percentage display without SVG issues */
.nct-report-percentage-ring {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(
        #667eea var(--percentage, 0%),
        #e6e9f5 var(--percentage, 0%)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    position: relative;
}

.nct-report-percentage-ring::before {
    content: '';
    position: absolute;
    width: 110px;
    height: 110px;
    background: #fff;
    border-radius: 50%;
}

.nct-report-percentage-value {
    position: relative;
    z-index: 1;
    font-size: 32px;
    font-weight: 800;
    color: #1a1a2e;
}

.nct-report-overall-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

/* Summary Stats */
.nct-report-summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.nct-report-stat-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    padding: 18px 24px;
    border-radius: 12px;
    flex: 1;
    min-width: 160px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nct-report-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nct-report-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nct-report-stat-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #fff;
}

.nct-report-completed .nct-report-stat-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.nct-report-in-progress .nct-report-stat-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.nct-report-not-started .nct-report-stat-icon {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.nct-report-stat-info {
    display: flex;
    flex-direction: column;
}

.nct-report-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.1;
}

.nct-report-stat-label {
    font-size: 13px;
    color: #6c757d;
    margin-top: 4px;
}

/* Course Progress Section */
.nct-report-courses h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 20px 0;
}

.nct-report-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.nct-report-course-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.nct-report-course-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.nct-report-course-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.nct-report-course-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.4;
    flex: 1;
}

.nct-report-course-rate {
    font-size: 18px;
    font-weight: 800;
    color: #6c757d;
    white-space: nowrap;
}

.nct-report-course-rate.good {
    color: #f59e0b;
}

.nct-report-course-rate.complete {
    color: #10b981;
}

/* Progress Bar */
.nct-report-progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 14px;
    overflow: hidden;
}

.nct-report-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* Course Stats Row */
.nct-report-course-stats {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.nct-report-course-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #6c757d;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 6px;
}

.nct-report-course-stat .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.nct-report-course-stat.completed {
    color: #10b981;
    background: #ecfdf5;
}

.nct-report-course-stat.completed .dashicons {
    color: #10b981;
}

.nct-report-course-stat.in-progress {
    color: #f59e0b;
    background: #fffbeb;
}

.nct-report-course-stat.in-progress .dashicons {
    color: #f59e0b;
}

.nct-report-course-stat.not-started {
    color: #64748b;
    background: #f1f5f9;
}

.nct-report-course-stat.not-started .dashicons {
    color: #64748b;
}

.nct-report-course-stat.total {
    color: #667eea;
    background: #eef2ff;
}

.nct-report-course-stat.total .dashicons {
    color: #667eea;
}

/* Responsive Adjustments for Report Section */
@media (max-width: 900px) {
    .nct-report-summary {
        flex-direction: column;
        text-align: center;
    }

    .nct-report-summary-stats {
        justify-content: center;
        width: 100%;
    }

    .nct-report-stat-item {
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    .nct-report-section {
        padding: 16px;
    }

    .nct-report-summary {
        padding: 18px;
        gap: 20px;
    }

    .nct-report-percentage-ring {
        width: 120px;
        height: 120px;
    }

    .nct-report-percentage-ring::before {
        width: 90px;
        height: 90px;
    }

    .nct-report-percentage-value {
        font-size: 26px;
    }

    .nct-report-stat-item {
        padding: 14px 18px;
    }

    .nct-report-stat-icon {
        width: 42px;
        height: 42px;
    }

    .nct-report-stat-icon .dashicons {
        font-size: 20px;
        width: 20px;
        height: 20px;
    }

    .nct-report-stat-value {
        font-size: 24px;
    }

    .nct-report-course-grid {
        grid-template-columns: 1fr;
    }

    .nct-report-course-card {
        padding: 16px;
    }

    .nct-report-course-stats {
        gap: 6px;
    }

    .nct-report-course-stat {
        font-size: 12px;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .nct-report-summary-stats {
        flex-direction: column;
    }

    .nct-report-stat-item {
        width: 100%;
    }

    .nct-report-course-header {
        flex-direction: column;
        gap: 8px;
    }

    .nct-report-course-rate {
        align-self: flex-start;
    }
}

/* =====================================================
   COURSE PROGRESS MODAL
   ===================================================== */

.nct-modal-large {
    max-width: 800px;
}

/* Course Progress Summary */
.nct-course-progress-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.nct-cp-stat {
    flex: 1;
    min-width: 120px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px 20px;
    text-align: center;
    border-left: 4px solid #e9ecef;
}

.nct-cp-stat.nct-cp-completed {
    border-left-color: #10b981;
    background: #ecfdf5;
}

.nct-cp-stat.nct-cp-in-progress {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.nct-cp-stat.nct-cp-not-started {
    border-left-color: #94a3b8;
    background: #f1f5f9;
}

.nct-cp-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.2;
}

.nct-cp-stat-label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Course Progress Table */
.nct-course-progress-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.nct-course-progress-table th {
    background: #f8f9fa;
    font-weight: 600;
    text-align: left;
    padding: 12px 10px;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
}

.nct-course-progress-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.nct-course-progress-table tbody tr:hover {
    background: #f8f9fa;
}

.nct-cp-name {
    font-weight: 500;
    color: #1a1a2e;
}

.nct-cp-email {
    color: #6c757d;
    font-size: 13px;
}

/* Progress Bar in Table */
.nct-cp-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
}

.nct-cp-progress-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.nct-cp-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.nct-cp-progress-fill.completed {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.nct-cp-progress-fill.in-progress {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.nct-cp-progress-fill.not-started {
    background: #94a3b8;
}

.nct-cp-progress-text {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    min-width: 35px;
}

/* Status Badges */
.nct-badge-completed {
    background: #ecfdf5;
    color: #059669;
}

.nct-badge-in-progress {
    background: #fffbeb;
    color: #d97706;
}

.nct-badge-not-started {
    background: #f1f5f9;
    color: #64748b;
}

/* Certificate Column */
.nct-cp-certificate {
    white-space: nowrap;
}

.nct-cp-certificate .nct-certificate-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 5px 10px;
}

.nct-cp-certificate .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Actions Cell in Course Seats Table */
.nct-actions-cell {
    white-space: nowrap;
}

.nct-actions-cell .nct-button {
    margin-right: 6px;
}

.nct-actions-cell .nct-button:last-child {
    margin-right: 0;
}

/* Responsive for Course Progress Modal */
@media (max-width: 768px) {
    .nct-modal-large {
        max-width: 100%;
        margin: 10px;
    }

    .nct-course-progress-summary {
        flex-direction: column;
    }

    .nct-cp-stat {
        min-width: 100%;
    }

    .nct-course-progress-table {
        font-size: 12px;
    }

    .nct-course-progress-table th,
    .nct-course-progress-table td {
        padding: 8px 6px;
    }

    .nct-cp-email {
        display: none;
    }

    .nct-cp-progress {
        min-width: 100px;
    }

    .nct-actions-cell {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .nct-actions-cell .nct-button {
        margin-right: 0;
    }
}
