/**
 * Front End Table CSS
 * 
 * @package TBC_Participant_Frontend
 * @since 3.0.0
 */

.tbc-pf-centered {
    text-align: center;
    width: 100%;
}

.tbc-pf-table-wrapper {
    width: 100%;
    overflow-x: auto;
    display: block;
    margin-bottom: 20px;
}

.tbc-pf-table {
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    background-color: var(--fcom-primary-bg, #fff);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-size: 14px;
}

.tbc-pf-centered h2 {
    margin-bottom: 20px;
    color: var(--fcom-primary-text, #333);
}

.tbc-pf-table th {
    background-color: var(--fcom-primary-button, #007bff);
    color: var(--fcom-primary-button-text, #ffffff);
    padding: 12px 10px;
    text-align: center;
    font-weight: bold;
    white-space: nowrap;
}

.tbc-pf-table td {
    padding: 12px 10px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid var(--fcom-primary-border, #ddd);
}

.tbc-pf-table tr:nth-child(even) {
    background-color: var(--fcom-secondary-bg, #f9f9f9);
}

.tbc-pf-table tr:hover {
    background-color: var(--fcom-active-bg, #f1f1f1);
}

.tbc-pf-order-section-header {
    background-color: var(--fcom-active-bg, #e9ecef) !important;
    font-weight: bold;
    text-align: center;
    color: var(--fcom-primary-text, #495057);
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.tbc-pf-waiver-yes,
.tbc-pf-medication-no {
    background-color: #d4edda;
    color: #155724;
    font-weight: bold;
}

.tbc-pf-waiver-no,
.tbc-pf-medication-yes {
    background-color: #f8d7da;
    color: #721c24;
    font-weight: bold;
}

.tbc-pf-gender-male {
    background-color: #cce5ff;
}

.tbc-pf-gender-female {
    background-color: #f8d7da;
}

.tbc-pf-gender-other {
    background-color: #d4edda;
}

.tbc-pf-button-badge-wrapper {
    display: inline-block;
    text-align: center;
}

.tbc-pf-chat-button,
.tbc-pf-view-notes,
.tbc-pf-view-consult,
.tbc-pf-view-info,
.tbc-pf-enroll-button,
.tbc-pf-add-consult,
.tbc-pf-edit-notes {
    display: block;
    width: 150px;
    margin: 0 auto;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: background-color 0.3s ease;
}

.tbc-pf-chat-button.tbc-pf-joined,
.tbc-pf-view-notes,
.tbc-pf-view-consult,
.tbc-pf-view-info {
    background-color: #28a745;
    color: white;
}

.tbc-pf-chat-button.tbc-pf-not-joined,
.tbc-pf-add-consult,
.tbc-pf-edit-notes,
.tbc-pf-enroll-button {
    background-color: #6c757d;
    color: white;
}

.tbc-pf-chat-button.tbc-pf-joined:hover,
.tbc-pf-view-notes:hover,
.tbc-pf-view-consult:hover,
.tbc-pf-view-info:hover {
    background-color: #218838;
}

.tbc-pf-chat-button.tbc-pf-not-joined:hover,
.tbc-pf-add-consult:hover,
.tbc-pf-edit-notes:hover,
.tbc-pf-enroll-button:hover {
    background-color: #5a6268;
}

.tbc-pf-action-required-badge {
    display: block;
    width: 150px;
    margin: 8px auto 0;
    padding: 4px 8px;
    background-color: #dc3545;
    color: white;
    font-size: 11px;
    font-weight: bold;
    border-radius: 3px;
    animation: tbc-pf-flash-badge 1.5s infinite;
    text-align: center;
}

@keyframes tbc-pf-flash-badge {
    0%, 50% {
        opacity: 1;
        background-color: #dc3545;
    }
    51%, 100% {
        opacity: 0.6;
        background-color: #ff4757;
    }
}

.tbc-pf-column-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.tbc-pf-column-checkboxes label {
    display: flex;
    align-items: center;
    padding: 5px;
    cursor: pointer;
    font-size: 14px;
}

.tbc-pf-column-checkboxes input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.tbc-pf-column-save-feedback {
    min-height: 20px;
    margin-top: 10px;
    text-align: center;
    font-weight: bold;
}

.tbc-pf-column-save-feedback .tbc-pf-save-feedback {
    display: block;
    width: 100%;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 13px;
    text-align: center;
    margin-top: 6px;
}

.tbc-pf-modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.tbc-pf-modal-content {
    position: relative;
    background-color: var(--fcom-primary-bg, #fefefe);
    margin: 10% auto;
    padding: 20px;
    border: 1px solid var(--fcom-primary-border, #ddd);
    width: 60%;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tbc-pf-modal-content h3 {
    margin-top: 0;
    color: var(--fcom-primary-text, #333);
    padding-right: 30px;
}

.tbc-pf-modal-content h4 {
    margin: 15px 0 10px 0;
    color: var(--fcom-primary-text, #333);
    font-size: 16px;
    border-bottom: 1px solid var(--fcom-primary-border, #ddd);
    padding-bottom: 5px;
}

.tbc-pf-modal-content textarea {
    width: 100%;
    height: 250px;
    border: 1px solid var(--fcom-primary-border, #ccc);
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 15px;
    font-family: inherit;
    font-size: 14px;
}

.tbc-pf-close-modal-top {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background-color: var(--fcom-primary-button, #007bff);
    color: var(--fcom-primary-button-text, #ffffff);
    font-size: 16px;
    cursor: pointer;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    text-align: center;
    line-height: 26px;
    padding: 0;
}

.tbc-pf-close-modal-top:hover {
    background-color: var(--fcom-text-link, #0069d9);
}

.tbc-pf-close-modal,
.tbc-pf-save-notes,
.tbc-pf-save-medical-consult {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-right: 10px;
}

.tbc-pf-save-notes,
.tbc-pf-save-medical-consult {
    background-color: #28a745;
    color: white;
}

.tbc-pf-close-modal {
    background-color: #6c757d;
    color: white;
}

.tbc-pf-save-notes:hover,
.tbc-pf-save-medical-consult:hover {
    background-color: #218838;
}

.tbc-pf-close-modal:hover {
    background-color: #5a6268;
}

.tbc-pf-followup-management {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--fcom-primary-border, #ddd);
}

.tbc-pf-followup-section-title {
    margin: 0 0 10px 0;
    padding: 0;
    font-size: 14px;
}

.tbc-pf-add-followup-section {
    background-color: var(--fcom-secondary-bg, #f8f9fa);
    border-radius: 4px;
    margin-bottom: 15px;
}

.tbc-pf-quick-followup-buttons {
    margin: 10px 0;
}

.tbc-pf-quick-followup-btn {
    background-color: #17a2b8;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    margin: 3px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.tbc-pf-quick-followup-btn:hover {
    background-color: #138496;
}

.tbc-pf-custom-followup {
    margin-top: 10px;
}

.tbc-pf-custom-followup label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
}

.tbc-pf-followup-date-picker {
    width: 150px;
    padding: 5px;
    border: 1px solid var(--fcom-primary-border, #ccc);
    border-radius: 4px;
    margin-right: 10px;
}

.tbc-pf-modal-content .tbc-pf-followup-note-input {
    width: 100%;
    height: 45px;
    padding: 5px;
    border: 1px solid var(--fcom-primary-border, #ccc);
    border-radius: 4px;
    margin: 8px 0;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
}

.tbc-pf-previous-participation-section ul {
    list-style: none;
    padding-left: 0;
}

.tbc-pf-previous-participation-section li {
    margin-bottom: 5px;
}

.tbc-pf-participant-groups-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 10px 0;
    justify-content: center;
}

.tbc-pf-group-item {
    text-align: center;
    max-width: 150px;
}

.tbc-pf-group-cover-thumb {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--fcom-primary-border, #ddd);
    display: block;
    margin-bottom: 5px;
}

.tbc-pf-group-cover-thumb:hover {
    opacity: 0.8;
    transition: opacity 0.2s;
}

.tbc-pf-group-name {
    font-size: 13px;
    line-height: 1.3;
    word-wrap: break-word;
}

.tbc-pf-group-name a {
    color: var(--fcom-text-link, #007bff);
    text-decoration: none;
}

.tbc-pf-group-name a:hover {
    text-decoration: underline;
}

.tbc-pf-add-followup-btn {
    background-color: var(--fcom-primary-button, #007bff);
    color: var(--fcom-primary-button-text, #ffffff);
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.tbc-pf-add-followup-btn:hover {
    background-color: var(--fcom-text-link, #0069d9);
}

.tbc-pf-followup-history {
    margin-top: 15px;
}

.tbc-pf-followup-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--fcom-primary-bg, #fff);
    border: 1px solid var(--fcom-primary-border, #ddd);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tbc-pf-followup-container.tbc-pf-followup-pending {
    border-left: 4px solid #ffc107;
    background-color: #fff8e1;
}

.tbc-pf-followup-container.tbc-pf-followup-completed {
    border-left: 4px solid #28a745;
    background-color: #d4edda;
}

.tbc-pf-followup-info {
    flex: 1;
    text-align: left;
    font-size: 13px;
    line-height: 1.4;
}

.tbc-pf-followup-info strong {
    color: var(--fcom-primary-text, #333);
    font-size: 14px;
}

.tbc-pf-followup-note {
    color: var(--fcom-secondary-text, #666);
    font-style: italic;
    font-size: 12px;
    display: block;
    margin-top: 2px;
}

.tbc-pf-followup-buttons {
    display: flex;
    gap: 5px;
}

.tbc-pf-complete-followup-btn,
.tbc-pf-remove-followup-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: background-color 0.3s;
    text-align: center;
    line-height: 24px;
    padding: 0;
}

.tbc-pf-complete-followup-btn {
    background-color: #28a745;
    color: white;
}

.tbc-pf-complete-followup-btn:hover {
    background-color: #218838;
}

.tbc-pf-remove-followup-btn {
    background-color: #dc3545;
    color: white;
}

.tbc-pf-remove-followup-btn:hover {
    background-color: #c82333;
}

#tbc-pf-participant-list-tabs {
    display: flex;
    justify-content: left;
    margin-bottom: 20px;
}

#tbc-pf-participant-list-tabs button.tbc-pf-tab-link {
    background-color: var(--fcom-secondary-bg, #f1f1f1);
    border: 1px solid var(--fcom-primary-border, #ccc);
    outline: none;
    cursor: pointer;
    padding: 10px 15px;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 600;
    color: var(--fcom-secondary-text, #555);
    border-radius: 5px 5px 0 0;
    margin-right: 2px;
}

#tbc-pf-participant-list-tabs button.tbc-pf-tab-link.active {
    background-color: var(--fcom-primary-button, #007bff);
    color: var(--fcom-primary-button-text, #ffffff);
    border-color: var(--fcom-primary-button, #007bff);
}

#tbc-pf-participant-list-tabs button.tbc-pf-tab-link:hover:not(.active) {
    background-color: var(--fcom-active-bg, #e0e0e0);
    color: var(--fcom-primary-text, #333);
    border-color: var(--fcom-secondary-border, #aaa);
}

.tbc-pf-back-button-container {
    margin: 20px 0;
}

.tbc-pf-back-button {
    display: inline-block;
    background-color: #6c757d;
    color: white;
    padding: 8px 16px;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.tbc-pf-back-button:hover {
    background-color: #5a6268;
    color: white;
    text-decoration: none;
}

.tbc-pf-previous-notes-section {
    background-color: var(--fcom-secondary-bg, #f8f9fa);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.tbc-pf-previous-notes-section h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--fcom-primary-text, #495057);
    font-size: 14px;
}

.tbc-pf-notes-history-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--fcom-primary-border, #dee2e6);
    border-radius: 4px;
    padding: 10px;
    background-color: var(--fcom-primary-bg, white);
}

.tbc-pf-history-entry {
    border-bottom: 1px solid var(--fcom-primary-border, #eee);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.tbc-pf-history-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.tbc-pf-history-entry strong {
    color: var(--fcom-primary-text, #495057);
    font-size: 13px;
    display: block;
    margin-bottom: 4px;
}

.tbc-pf-history-entry p {
    margin: 0;
    font-size: 12px;
    color: var(--fcom-secondary-text, #6c757d);
    line-height: 1.4;
}

.tbc-pf-gravity-form-entry {
    text-align: left;
}

.tbc-pf-order-status-dropdown {
    padding: 4px 8px;
    border: 1px solid var(--fcom-primary-border, #ccc);
    border-radius: 4px;
    font-size: 13px;
}

/* SMS Opt-Out Override */
.tbc-pf-sms-override-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
    padding: 8px 12px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    border-left: 4px solid #ffc107;
}

.tbc-pf-override-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #856404;
    cursor: pointer;
    white-space: nowrap;
}

.tbc-pf-override-warning {
    font-size: 12px;
    color: #856404;
    font-style: italic;
}

.tbc-pf-sms-opted-out {
    text-decoration: line-through;
    color: var(--fcom-text-off, #999);
}

.tbc-pf-sms-opted-out .tbc-pf-opted-out-checkbox {
    cursor: not-allowed;
}

.tbc-pf-sms-opted-out.tbc-pf-override-active {
    text-decoration: none;
    color: var(--fcom-primary-text, #333);
    background-color: #fff8e1;
    padding: 2px 4px;
    border-radius: 3px;
}

.tbc-pf-sms-opted-out.tbc-pf-override-active .tbc-pf-opted-out-checkbox {
    cursor: pointer;
}

@media screen and (max-width: 768px) {
    .tbc-pf-modal-content {
        width: 90%;
        margin: 15% auto;
    }

    .tbc-pf-table {
        font-size: 13px;
    }

    .tbc-pf-table th,
    .tbc-pf-table td {
        padding: 8px 6px;
    }

    .tbc-pf-followup-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .tbc-pf-followup-buttons {
        margin-top: 8px;
        align-self: flex-end;
    }

    .tbc-pf-quick-followup-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 3px;
    }

    .tbc-pf-quick-followup-btn {
        flex: 1 1 calc(50% - 1.5px);
        font-size: 11px;
        padding: 5px 8px;
    }

    .tbc-pf-custom-followup {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .tbc-pf-followup-date-picker {
        width: 100%;
        margin-right: 0;
    }

    .tbc-pf-add-followup-btn {
        width: 100%;
    }

    .tbc-pf-column-checkboxes {
        grid-template-columns: repeat(2, 1fr);
    }

    .tbc-pf-sms-override-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}