/**
 * MAI Smart Assistant - Training Modal Styles
 *
 * @package MAI_SMART_ASSISTANT
 * @since 1.0.0
 */

/* Modal Overlay */
#mai-smart-assistant-training-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 160000;
}

.mai-smart-assistant-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
}

/* Modal Container */
.mai-smart-assistant-modal-container {
    position: relative;
    max-width: 900px;
    max-height: 90vh;
    margin: 5vh auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 160001;
}

/* Modal Header */
.mai-smart-assistant-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.mai-smart-assistant-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.mai-smart-assistant-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.mai-smart-assistant-modal-close:hover {
    background: #f0f0f0;
    color: #000;
}

/* Modal Body */
.mai-smart-assistant-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 400px;
}

/* Search and Filter */
.mai-smart-assistant-modal-search {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.mai-smart-assistant-modal-search input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.mai-smart-assistant-modal-search select {
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.mai-smart-assistant-modal-search button {
    padding: 8px 16px;
}

/* Smart Suggestions */
#mai-smart-assistant-smart-suggestions {
    margin-bottom: 20px;
}

#mai-smart-assistant-smart-suggestions .notice {
    margin: 0;
}

#mai-smart-assistant-smart-suggestions button {
    margin-top: 8px;
}

/* Bulk Select */
.mai-smart-assistant-modal-bulk-select {
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.mai-smart-assistant-modal-bulk-select label {
    font-weight: 600;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Content List */
#mai-smart-assistant-modal-content-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mai-smart-assistant-content-item {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    transition: all 0.2s;
}

.mai-smart-assistant-content-item:hover {
    border-color: #0073aa;
    background: #f8f9fa;
}

.mai-smart-assistant-content-item.status-new {
    border-left: 4px solid #2271b1;
}

.mai-smart-assistant-content-item.status-warning {
    border-left: 4px solid #dba617;
}

.mai-smart-assistant-content-item.status-success {
    border-left: 4px solid #00a32a;
}

.mai-smart-assistant-content-item-label {
    display: flex;
    gap: 12px;
    cursor: pointer;
    margin: 0;
    align-items: flex-start;
}

.mai-smart-assistant-item-checkbox {
    margin-top: 4px;
    flex-shrink: 0;
}

.mai-smart-assistant-content-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mai-smart-assistant-content-item-title {
    font-weight: 600;
    font-size: 14px;
    color: #1d2327;
}

.mai-smart-assistant-content-item-meta {
    font-size: 13px;
    color: #646970;
}

.mai-smart-assistant-content-item-status {
    font-size: 12px;
    font-weight: 500;
}

.mai-smart-assistant-content-item-status.status-new {
    color: #2271b1;
}

.mai-smart-assistant-content-item-status.status-warning {
    color: #dba617;
}

.mai-smart-assistant-content-item-status.status-success {
    color: #00a32a;
}

/* Loading State */
#mai-smart-assistant-modal-loading {
    display: none;
    text-align: center;
    padding: 40px;
    color: #646970;
}

#mai-smart-assistant-modal-loading .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Empty State */
#mai-smart-assistant-modal-empty {
    display: none;
    text-align: center;
    padding: 60px 40px;
    color: #646970;
}

#mai-smart-assistant-modal-empty .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    opacity: 0.3;
    margin-bottom: 16px;
}

/* Progress */
#mai-smart-assistant-modal-progress {
    display: none;
    padding: 20px;
}

.mai-smart-assistant-progress-container {
    text-align: center;
}

.mai-smart-assistant-progress-bar {
    width: 100%;
    height: 24px;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.mai-smart-assistant-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2271b1 0%, #0073aa 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.mai-smart-assistant-progress-text {
    margin: 0;
    font-size: 14px;
    color: #646970;
}

/* Pagination */
.mai-smart-assistant-modal-pagination {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.mai-smart-assistant-modal-pagination .page-info {
    font-size: 13px;
    color: #646970;
    display: inline-block;
    margin-bottom: 12px;
}

.mai-smart-assistant-modal-pagination .pagination-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.mai-smart-assistant-modal-pagination button {
    min-width: 40px;
}

.mai-smart-assistant-modal-pagination .pagination-ellipsis {
    padding: 6px 8px;
    color: #646970;
}

/* Modal Footer */
.mai-smart-assistant-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

#mai-smart-assistant-modal-footer-summary p {
    margin: 0;
    font-size: 13px;
    color: #646970;
}

#mai-smart-assistant-modal-footer-summary strong {
    color: #1d2327;
}

.mai-smart-assistant-modal-footer-actions {
    display: flex;
    gap: 12px;
}

/* Error */
#mai-smart-assistant-modal-error {
    display: none;
    margin-bottom: 16px;
}

#mai-smart-assistant-modal-error .notice {
    margin: 0;
}

/* Spinning Animation */
.dashicons.spinning {
    animation: spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .mai-smart-assistant-modal-container {
        max-width: 95%;
        max-height: 95vh;
        margin: 2.5vh auto;
    }

    .mai-smart-assistant-modal-header,
    .mai-smart-assistant-modal-body,
    .mai-smart-assistant-modal-footer {
        padding: 16px;
    }

    .mai-smart-assistant-modal-search {
        flex-direction: column;
    }

    .mai-smart-assistant-modal-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .mai-smart-assistant-modal-footer-actions {
        width: 100%;
    }

    .mai-smart-assistant-modal-footer-actions button {
        flex: 1;
    }
}

/* Body class when modal is open */
body.mai-smart-assistant-modal-open {
    overflow: hidden;
}
