/**
 * Admin styles for Botailor ModelContext Integrator for AI
 *
 * @package MCIA_API
 */

.mcp-admin-header {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.mcp-admin-header p {
    margin: 0 0 10px 0;
}

.mcp-admin-header p:last-child {
    margin-bottom: 0;
}

.mcp-admin-header code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: Consolas, Monaco, monospace;
}

.mcp-content-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mcp-section {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.mcp-section h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.mcp-content-list {
    margin: 20px 0;
}

.mcp-bulk-actions {
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.mcp-bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mcp-bulk-actions label {
    font-weight: 600;
    margin: 0;
}

.mcp-bulk-actions select {
    min-width: 150px;
}

.mcp-bulk-actions .button {
    margin: 0;
}


.mcp-warning-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.mcp-warning-notice p {
    margin: 0;
    color: #856404;
}

/* Authentication settings */
.mcp-auth-settings {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.mcp-auth-settings h2 {
    margin-top: 0;
    color: #23282d;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.mcp-auth-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    margin-top: 20px;
}

.mcp-auth-info h3 {
    margin-top: 0;
    color: #495057;
}

.mcp-auth-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

.mcp-auth-info li {
    margin: 5px 0;
}

.mcp-auth-info code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.mcp-auth-info pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
}

.mcp-auth-info pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Permissions multiselect */
.mcp-permissions-select {
    width: 120px;
    min-height: 80px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.mcp-permissions-select option {
    padding: 4px 8px;
    font-size: 12px;
}

.mcp-permissions-select option:checked {
    background: #0073aa;
    color: #fff;
}

.column-permissions {
    width: 140px;
    text-align: center;
}

/* Search and Pagination Controls */
.mcp-controls {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.mcp-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mcp-search-input {
    width: 250px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.mcp-search-btn, .mcp-clear-search {
    padding: 6px 12px;
    font-size: 13px;
}

.mcp-pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mcp-per-page-select {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.mcp-pagination-info {
    font-size: 13px;
    color: #666;
}

.mcp-pagination-nav {
    display: flex;
    gap: 8px;
}

.mcp-prev-page, .mcp-next-page {
    padding: 4px 8px;
    font-size: 12px;
    min-width: 80px;
}

.mcp-prev-page:disabled, .mcp-next-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.no-results {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Responsive design */
@media (max-width: 768px) {
    .mcp-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mcp-search-box {
        justify-content: center;
    }
    
    .mcp-search-input {
        width: 100%;
        max-width: 300px;
    }
    
    .mcp-pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* JSON Modal Styles */
.mcp-json-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mcp-json-modal-content {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90%;
    width: 800px;
    display: flex;
    flex-direction: column;
}

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

.mcp-json-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.mcp-close-modal {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    font-size: 18px;
    cursor: pointer;
    color: #6c757d;
    padding: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: bold;
    min-width: 100px;
}

.mcp-close-modal:hover {
    color: #dc3545;
    background: #f8d7da;
    border-color: #f5c6cb;
}

.mcp-json-modal-body {
    padding: 20px;
    overflow: auto;
    flex: 1;
}

.mcp-json-modal-body pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    margin: 0;
    overflow: auto;
    max-height: 400px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
    line-height: 1.4;
}

.mcp-json-modal-body code {
    color: #333;
}

.mcp-json-modal-footer {
    padding: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.mcp-content-list .wp-list-table {
    margin-top: 0;
}

.mcp-content-list .wp-list-table th,
.mcp-content-list .wp-list-table td {
    padding: 12px 8px;
    vertical-align: middle;
}

.mcp-content-list .wp-list-table .column-title {
    width: 20%;
}

.mcp-content-list .wp-list-table .column-slug {
    width: 12%;
}

.mcp-content-list .wp-list-table .column-expose {
    width: 12%;
}

.mcp-content-list .wp-list-table .column-description {
    width: 25%;
}

.mcp-content-list .wp-list-table .column-preview {
    width: 12%;
}

.mcp-content-list .wp-list-table .column-cb {
    width: 5%;
}

.mcp-content-list .wp-list-table .column-id {
    width: 8%;
    text-align: center;
    font-weight: 600;
    color: #0073aa;
}

.mcp-content-list .wp-list-table .column-slug code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
}

.mcp-content-list .wp-list-table .column-title strong {
    font-weight: 600;
}

/* Toggle Switch Styles */
.mcp-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mcp-toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin: 0;
}

.mcp-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mcp-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.mcp-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.mcp-toggle-switch input:checked + .mcp-toggle-slider {
    background-color: #0073aa;
}

.mcp-toggle-switch input:checked + .mcp-toggle-slider:before {
    transform: translateX(26px);
}

.mcp-toggle-label {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.mcp-toggle-switch input:checked ~ .mcp-toggle-label {
    color: #0073aa;
}

.mcp-toggle-label.mcp-enabled {
    color: #0073aa;
    font-weight: 600;
}

.mcp-toggle-label.mcp-disabled {
    color: #999;
    font-weight: 500;
}

.mcp-content-list .wp-list-table .column-description textarea {
    width: 100%;
    min-height: 40px;
    resize: vertical;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
}

.mcp-content-list .wp-list-table .column-preview .button {
    font-size: 11px;
    padding: 4px 8px;
    height: auto;
    line-height: 1.4;
}

.mcp-content-list .wp-list-table .column-preview .mcp-disabled {
    color: #999;
    font-style: italic;
    font-size: 12px;
}

/* Checkbox styling */
.mcp-content-list input[type="checkbox"] {
    margin: 0;
}

.mcp-content-list .check-column {
    text-align: center;
}

/* Bulk actions styling */
.mcp-bulk-actions .button {
    background: #f7f7f7;
    border: 1px solid #ccd0d4;
    color: #555;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mcp-bulk-actions .button:hover {
    background: #f1f1f1;
    border-color: #999;
    color: #23282d;
}

.mcp-bulk-actions .button:active {
    background: #e6e6e6;
    border-color: #999;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Loading states */
.mcp-loading {
    opacity: 0.6;
    pointer-events: none;
}

.mcp-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 #0073aa;
    border-radius: 50%;
    animation: mcp-spin 1s linear infinite;
}

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

/* Success/Error messages */
.mcp-notice {
    padding: 12px;
    margin: 15px 0;
    border-left: 4px solid;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.mcp-notice-success {
    border-left-color: #46b450;
    background: #f7fff7;
}

.mcp-notice-error {
    border-left-color: #dc3232;
    background: #fff5f5;
}

.mcp-notice p {
    margin: 0;
    font-weight: 600;
}

/* Responsive design */
@media screen and (max-width: 1200px) {
    .mcp-content-sections {
        flex-direction: column;
    }
    
    .mcp-content-list .wp-list-table {
        font-size: 13px;
    }
    
    .mcp-content-list .wp-list-table th,
    .mcp-content-list .wp-list-table td {
        padding: 8px 4px;
    }
    
    .mcp-content-list .wp-list-table .column-description textarea {
        min-height: 35px;
        font-size: 12px;
    }
}

@media screen and (max-width: 782px) {
    .mcp-content-list .wp-list-table {
        font-size: 12px;
    }
    
    .mcp-content-list .wp-list-table th,
    .mcp-content-list .wp-list-table td {
        padding: 6px 2px;
    }
    
    .mcp-bulk-actions {
        text-align: center;
    }
    
    .mcp-bulk-actions .button {
        display: block;
        margin: 5px auto;
        width: auto;
    }
    
    .mcp-content-list .wp-list-table .column-description textarea {
        min-height: 30px;
        font-size: 11px;
    }
    
    .mcp-content-list .wp-list-table .column-preview .button {
        font-size: 10px;
        padding: 2px 4px;
    }
}

/* Form enhancements */
.mcp-content-list .wp-list-table .column-expose input[type="checkbox"]:checked + span {
    color: #0073aa;
    font-weight: 600;
}

.mcp-content-list .wp-list-table .column-description textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

/* Status indicators */
.mcp-status-enabled {
    color: #0073aa;
    font-weight: 600;
}

.mcp-status-disabled {
    color: #999;
}

/* Hover effects */
.mcp-content-list .wp-list-table tbody tr:hover {
    background-color: #f9f9f9;
}

.mcp-content-list .wp-list-table tbody tr:hover .column-preview .button {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}