/**
 * Workshop Attendance Tracker - Frontend Styles
 * Two-column layout: Course List (60%) + Detail Panel (40%)
 */

/* Workshop History Title */
.wat-workshop-history-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 20px 0;
    padding: 0;
    margin-bottom: -10px !important;
    margin: 0 auto 20px auto;
    padding: 0 20px 10px 20px;
}

/* Main Container */
.wat-workshop-history-container {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Left Column - Course List */
.wat-course-list {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.wat-course-list-header {
    background: transparent;
    padding: 16px 0;
    border-bottom: none;
    font-weight: 600;
    color: #495057;
    margin-bottom: 16px;
}

.wat-course-list-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 8px; /* space for scrollbar */
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
}

/* Ensure left column allows inner scroll areas to shrink properly */
.wat-course-list {
    min-height: 0;
}

/* Stable width for each card to prevent layout shifts when many cards */
.wat-course-card {
    width: 100%;
    box-sizing: border-box;
}

/* Optional: nicer scrollbar for long lists */
.wat-course-list-content::-webkit-scrollbar {
    width: 10px;
}
.wat-course-list-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}
.wat-course-list-content::-webkit-scrollbar-thumb {
    background: #c5ccd3;
    border-radius: 8px;
}
.wat-course-list-content::-webkit-scrollbar-thumb:hover {
    background: #b2b9c1;
}

/* Course Card - Left Column Cards */
.wat-course-card {
    display: grid;
    grid-template-columns: 1fr 120px;
    align-items: center;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid #D9D9D9;
    border-radius: 12px;
    background: #DDF2FF;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 200px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    gap: 20px;
    overflow: hidden;
}

.wat-course-card:hover {
    background: #D0E8FF;
    border-color: #B8D4F0;
}

.wat-course-card.selected {
    background: #C5E3FF;
    border-color: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.wat-course-card.completed {
    background: #DDF2FF; /* Light blue for completed */
}

.wat-course-card.pending {
    background: #DDF2FF; /* Same light blue for pending */
}

/* Course Left Column */
.wat-course-left {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
    grid-column: 1;
}

/* Course Icon */
.wat-course-icon {
    background:none !important; /* Light blue for completed */
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wat-course-icon .dashicons {
    color: white;
    font-size: 20px;
}

.wat-course-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.wat-icon-link {
    display: block;
    text-decoration: none;
    transition: transform 0.2s ease;
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.wat-icon-link:hover {
    transform: scale(1.1);
}

.wat-icon-link img {
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.wat-icon-link:hover img {
    opacity: 0.8;
}

/* Course Content */
.wat-course-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    flex: 1;
    padding-right: 10px;
}

.wat-course-top {
    margin-bottom: -12px;
}

.wat-course-title {
    font-size: 20px;
    color: #212529;
    margin: 0;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    hyphens: auto;
    font-weight: 400 !important;
}


.wat-course-bottom {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wat-course-detail-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.wat-detail-label {
    color: #495057;
    font-weight: 500;
    font-size: 14px;
}

.wat-detail-value {
    color: #6c757d;
    font-size: 14px !important;
}

.wat-course-detail-item .dashicons {
    font-size: 14px;
    color: #6c757d;
}

/* Status Badge */
.wat-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wat-status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.wat-status-badge.partial {
    background: #fff3cd;
    color: #856404;
}

.wat-status-badge.not_completed {
    background: #f8d7da;
    color: #721c24;
}

.wat-status-badge.confirm {
    background: #ffeaa7;
    color: #d63031;
}

/* Course Actions */
.wat-course-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    margin-left: 16px;
    position: absolute;
    top: 20px;
    right: 20px;
}

.wat-completion-badge {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.wat-countdown {
    color: #dc3545;
    font-size: 12px;
    font-weight: 500;
}

.wat-rating {
    display: flex;
    gap: 2px;
}

.wat-rating .dashicons {
    color: #ffc107;
    font-size: 14px;
}



.wat-detail-panel-header {
    padding: 20px;
    border-bottom: 1px solid #D9D9D9;
    background: #DDF2FF;
    border-radius: 12px 12px 0 0;
}

.wat-detail-panel-content {
    padding: 20px;
    border: 1px solid #D9D9D9;
    border-radius: 12px;
    background: #DDF2FF;
    transition: all 0.2s ease;

}

/* New detail panel styles matching the photo */
.wat-detail-participant {
    margin-bottom: 20px;
}

.wat-detail-name {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
}

.wat-detail-info {
    margin-bottom: 24px;
}

.wat-detail-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.wat-detail-info-item .wat-detail-label {
    color: #495057;
    font-weight: 500;
    min-width: 100px;
}

.wat-detail-info-item .wat-detail-value {
    color: #6c757d;
    margin-left: 4px;
}

.wat-workshop-course {
    margin-bottom: 24px;
}

.wat-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #212529;
    margin: 0 0 12px 0;
}

.wat-course-title-text {
    font-size: 14px;
    color: #495057;
    line-height: 1.5;
    margin: 0;
}

.wat-description {
    margin-bottom: 0;
}

.wat-description-text {
    font-size: 14px;
    color: #000000;
    line-height: 1.6;
    margin: 0;
}

.wat-read-more {
    color: #2196f3;
    text-decoration: none;
    font-weight: 500;
}

.wat-read-more:hover {
    text-decoration: underline;
}

.wat-detail-title {
    font-size: 20px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wat-detail-edit-icon {
    color: #6c757d;
    cursor: pointer;
    font-size: 16px;
}

.wat-detail-info {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.wat-detail-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.wat-detail-info-label {
    font-weight: 500;
    color: #495057;
}

.wat-detail-info-value {
    color: #6c757d;
}

/* Certificate Preview */
.wat-certificate-preview {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.wat-certificate-image {
    max-width: 200px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wat-certificate-download {
    margin-top: 12px;
}

/* Course Description */
.wat-course-description {
    margin-top: 20px;
}

.wat-course-description h4 {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 12px 0;
}

.wat-course-title-bold {
    font-size: 18px;
    font-weight: 700;
    color: #212529;
    margin: 0 0 16px 0;
}

/* Detail Dates */
.wat-detail-dates {
    margin: 16px 0;
    padding: 12px 0;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.wat-course-description p {
    color: #6c757d;
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.wat-read-more {
    color: #2196f3;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.wat-read-more:hover {
    text-decoration: underline;
}

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

.wat-empty-state .dashicons {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wat-workshop-history-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }
    
    .wat-detail-panel {
        position: static;
        max-height: none;
    }
    
    .wat-course-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .wat-course-actions {
        align-self: flex-end;
        margin-left: 0;
    }
}

/* Loading States */
.wat-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wat-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2196f3;
    border-radius: 50%;
    animation: wat-spin 1s linear infinite;
}

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

/* Button Styles */
.wat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wat-btn-primary {
    background: #e76e3c !important;
    color: white;
}

.wat-btn-primary:hover {
    background: #2A3242 !important;
    color: white;
}

.wat-btn-secondary {
    background: #e8e8e8 !important ;
    color: white;
}

.wat-btn-secondary:hover {
    background: #2A3242 !important;
    color: white;
}

.wat-btn-outline {
    background: transparent;
    color: #2196f3;
    border: 1px solid #2196f3;
}

.wat-btn-outline:hover {
    background: #2196f3;
    color: white;
}

/* Course Action Buttons */
.wat-course-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    align-items: center;
    justify-content: center;
    grid-column: 2;
    height: 100%;
}

.wat-course-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.wat-btn-complete {
    background: #4ABC96;
    color: white;
    border: 1px solid #D9D9D9;
    padding: 8px 16px;
    border-radius: 3px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dynamic status styling for Complete button */
.wat-btn-complete[data-current-status="completed"] {
    background: #28a745;
    border-color: #28a745;
}

.wat-btn-complete[data-current-status="partial"] {
    background: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

.wat-btn-complete[data-current-status="not_completed"] {
    background: #6c757d;
    border-color: #6c757d;
}

.wat-btn-complete:hover {
    background: #3aa882;
    color: white;
}

/* Status label styling - simple text without button styling */
.wat-status-label {
    font-weight: 500;
    font-size: 14px !important;
    padding: 8px 10px !important;
    min-width: 80px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #069644;
    background-color: var(--wat-status-bg-color, transparent);
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

/* Dynamic status styling for status label */
.wat-status-label[data-current-status="completed"] {
    color: white !important;
    background-color: var(--wat-completed-bg-color, rgba(40, 167, 69, 0.15));
    border-color: var(--wat-completed-border-color, rgba(40, 167, 69, 0.3));
}

.wat-status-label[data-current-status="partial"] {
    color: white !important;
    background-color: var(--wat-partial-bg-color, rgba(255, 193, 7, 0.15));
    border-color: var(--wat-partial-border-color, rgba(255, 193, 7, 0.3));
}

.wat-status-label[data-current-status="not_completed"] {
    color: white !important;
    background-color: var(--wat-not-completed-bg-color, rgba(108, 117, 125, 0.15));
    border-color: var(--wat-not-completed-border-color, rgba(108, 117, 125, 0.3));
}

.wat-status-label[data-current-status="not_marked"] {
    color: white !important;
    background-color: var(--wat-not-marked-bg-color, rgba(220, 53, 69, 0.15));
    border-color: var(--wat-not-marked-border-color, rgba(220, 53, 69, 0.3));
}

.wat-btn-verify {
    min-height: 45px;
    background: #E76E3C;
    color: white;
    border: 1px solid #D9D9D9;
    padding: 8px 16px;
    border-radius: 3px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wat-btn-verify:hover {
    background: #d55a2b;
    color: white;
}

/* Featured Image Section */
.wat-featured-image-section {
    margin-bottom: 20px;
    text-align: center;
}

.wat-featured-image {
    border-radius: 12px !important;
    width: 100%;
    max-width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Compact Info Section */
.wat-detail-info-compact {
    margin-bottom: 20px;
}

.wat-detail-row {
    display: flex;
    align-items: center;
    text-align: left;
}

.wat-detail-label {
    font-weight: 600;
    color: #495057;
    margin-right: 10px;
}

.wat-detail-value {
    color: #212529;
    flex: 1;
}

.wat-edit-icon {
    margin-left: 8px;
    color: #6c757d;
    font-size: 14px;
    cursor: pointer;
}

/* Verify Popup Styles */
.wat-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wat-popup-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.wat-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid #E5E5E5;
    margin-bottom: 20px;
}

.wat-popup-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.wat-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.wat-popup-close:hover {
    background: #F5F5F5;
    color: #666;
}

.wat-popup-body {
    padding: 0 20px 20px 20px;
}

.wat-popup-body p {
    margin: 0 0 15px 0;
    color: #555;
    line-height: 1.5;
}

.wat-popup-note {
    font-size: 14px;
    color: #777;
    font-style: italic;
    margin: 10px 0 !important;
}

.wat-popup-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.wat-popup-buttons .wat-btn {
    min-width: 120px;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

/* Loading spinner next to popup buttons */
.wat-popup-buttons .wat-loading {
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2196f3;
    border-radius: 50%;
    display: inline-block;
    animation: wat-spin 1s linear infinite;
}

.wat-btn-primary {
    background: #0073aa;
    color: white;
}

.wat-btn-primary:hover {
    background: #005a87;
}

.wat-btn-secondary {
    background: #f1f1f1;
    color: #333;
    border: 1px solid #ddd;
}

.wat-btn-secondary:hover {
    background: #e8e8e8;
}

.wat-btn-verify.verified {
    background: #28a745;
    color: white;
    cursor: not-allowed;
}

.wat-btn-verify.verified:hover {
    background: #28a745;
}

#wat-inquiry-text {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
    margin: 10px 0;
}

#wat-inquiry-text:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.wat-edit-icon:hover {
    color: #007cba;
}