/**
 .raychat-ai-wrap * Raychat AI - Admin Styles
  */
 
 /* Main wrapper */
 .raychat-ai-wrap {
    max-width: 900px;
    margin-top: 20px;
}

.raychat-ai-wrap h1 {
    margin-bottom: 30px;
}

/* Section styling */
.raychat-ai-wrap .raychat-sync-section {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.raychat-ai-wrap .raychat-sync-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0073aa;
    font-size: 18px;
    color: #0073aa;
}

.raychat-ai-wrap .raychat-sync-section p {
    margin: 10px 0;
    color: #666;
    line-height: 1.6;
}

/* Form styling */
.raychat-ai-wrap .raychat-sync-form {
    margin: 20px 0;
}

.raychat-ai-wrap .form-group {
    margin-bottom: 20px;
}

.raychat-ai-wrap .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

/* API Key input group */
.raychat-ai-wrap .api-key-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.raychat-ai-wrap .raychat-api-key-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.raychat-ai-wrap .raychat-api-key-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.raychat-ai-wrap .raychat-api-key-input.valid {
    border-color: #28a745;
    background-color: #f0f8f5;
}

.raychat-ai-wrap .raychat-api-key-input.invalid {
    border-color: #dc3545;
    background-color: #fef5f7;
}

.raychat-ai-wrap .raychat-toggle-api-key-visibility {
    padding: 8px 12px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

.raychat-ai-wrap .raychat-toggle-api-key-visibility:hover {
    background: #e9e9e9;
    color: #333;
}

.raychat-ai-wrap .raychat-toggle-api-key-visibility.visible {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.raychat-ai-wrap .raychat-toggle-api-key-visibility .hide-text,
.raychat-ai-wrap .raychat-toggle-api-key-visibility.visible .show-text {
    display: none;
}

.raychat-ai-wrap .raychat-toggle-api-key-visibility.visible .hide-text {
    display: inline;
}

/* Form actions */
.raychat-ai-wrap .form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
}

.raychat-ai-wrap .form-actions .spinner {
    margin-left: 10px;
    float: none !important;
    display: none;
}

.raychat-ai-wrap .form-actions .spinner.is-active {
    display: inline-block;
}

/* Button styling */
.raychat-ai-wrap .button {
    transition: all 0.2s;
}

.raychat-ai-wrap .button-primary:hover {
    box-shadow: 0 2px 6px rgba(0, 115, 170, 0.3);
}

.raychat-ai-wrap .raychat-sync-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    padding: 12px 24px;
}

.raychat-ai-wrap .raychat-sync-button .button-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 1;
}

.raychat-ai-wrap .raychat-sync-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.raychat-ai-wrap .raychat-sync-button:disabled:hover {
    box-shadow: none;
}

/* Description text */
.raychat-ai-wrap .description {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Sync info */
.raychat-ai-wrap .sync-info {
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
    padding: 15px;
    margin: 15px 0;
    border-radius: 3px;
}

.raychat-ai-wrap .sync-info p {
    margin: 5px 0;
    font-size: 14px;
}

.raychat-ai-wrap .sync-info strong {
    color: #0073aa;
}

/* Sync description */
.raychat-ai-wrap .sync-description {
    background: #e8f4f8;
    border-left: 4px solid #0073aa;
    padding: 15px;
    margin: 15px 0;
    border-radius: 3px;
}

.raychat-ai-wrap .sync-description p {
    margin: 0;
    color: #333;
}

/* Sync status */
.raychat-ai-wrap .sync-status {
    display: inline-block;
    margin-left: 15px;
    font-weight: 600;
    font-size: 14px;
    min-height: 20px;
}

.raychat-ai-wrap .sync-status .syncing {
    color: #0073aa;
    animation: raychat-ai-pulse 1.5s infinite;
}

.raychat-ai-wrap .sync-status .success {
    color: #28a745;
    font-weight: bold;
}

.raychat-ai-wrap .sync-status .error {
    color: #dc3545;
    font-weight: bold;
}

@keyframes raychat-ai-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Notice container */
.raychat-ai-wrap .notice-container {
    margin: 15px 0;
}

.raychat-ai-wrap .notice-container .notice {
    margin: 0;
    padding: 12px 15px;
}

.raychat-ai-wrap .notice.notice-success {
    border-left-color: #28a745;
    background-color: #f0f8f5;
}

.raychat-ai-wrap .notice.notice-success p {
    color: #155724;
    margin: 0;
}

.raychat-ai-wrap .notice.notice-error {
    border-left-color: #dc3545;
    background-color: #fef5f7;
}

.raychat-ai-wrap .notice.notice-error p {
    color: #721c24;
    margin: 0;
}

.raychat-ai-wrap .notice.notice-warning {
    border-left-color: #ffc107;
    background-color: #fff8f0;
}

.raychat-ai-wrap .notice.notice-warning p {
    color: #856404;
    margin: 0;
}

.raychat-ai-wrap .notice.notice-info {
    border-left-color: #0073aa;
    background-color: #e8f4f8;
}

.raychat-ai-wrap .notice.notice-info p {
    color: #0073aa;
    margin: 0;
}

/* Spinner styling */
.raychat-ai-wrap .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIxMCIgY3k9IjEwIiByPSI4IiBzdHJva2U9IiMwMDczYWEiIHN0cm9rZS13aWR0aD0iMiIgZmlsbD0ibm9uZSIvPjxwYXRoIGQ9Ik0xOCAxMEMxOCA1LjU4IDEyLjQyIDIgMTAgMiIgc3Ryb2tlPSIjMDA3M2FhIiBzdHJva2Utd2lkdGg9IjIiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPjwvc3ZnPg==') no-repeat center center;
    background-size: contain;
    animation: raychat-ai-spin 1s linear infinite;
}

@keyframes raychat-ai-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 782px) {
    .raychat-ai-wrap {
        margin-left: -20px;
        margin-right: -20px;
    }
   .raychat-ai-wrap .raychat-sync-section {
        margin-left: 0;
        margin-right: 0;
        border-radius: 0;
    }
   .raychat-ai-wrap .api-key-input-group {
        flex-direction: column;
    }
   .raychat-ai-wrap .raychat-api-key-input,
   .raychat-ai-wrap .raychat-toggle-api-key-visibility {
        width: 100%;
    }
   .raychat-ai-wrap .form-actions {
        flex-direction: column;
    }
   .raychat-ai-wrap .raychat-sync-button {
        width: 100%;
    }
   .raychat-ai-wrap .sync-status {
        display: block;
        margin-left: 0;
        margin-top: 10px;
    }
}

/* Loading animation */
@keyframes raychat-ai-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.raychat-ai-wrap .notice {
    animation: raychat-ai-fadeIn 0.3s ease-in;
}

/* Print styles */
@media print {
    .raychat-ai-wrap .spinner,
    .raychat-ai-wrap .button {
        display: none;
    }
}
