/**
 * AICP WordPress Plugin - Admin Styles
 * Supports the 6-step wizard and settings pages
 */

/* General */
.aicp-wrap {
    max-width: 1200px;
}

.aicp-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 20px;
}

/* Wizard Container */
.aicp-wizard-step {
    max-width: 680px;
    margin: 40px auto;
    padding: 0 20px;
}

.aicp-wizard-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.aicp-wizard-icon {
    text-align: center;
    margin-bottom: 20px;
    color: #2271b1;
}

.aicp-wizard-step h2 {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 12px;
    color: #1d2327;
}

.aicp-wizard-description {
    text-align: center;
    color: #646970;
    font-size: 15px;
    margin: 0 0 32px;
    line-height: 1.6;
}

/* Progress Bar */
.aicp-wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.aicp-progress-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #646970;
    transition: all 0.3s ease;
}

.aicp-progress-step.active {
    background: #2271b1;
    color: #fff;
}

.aicp-progress-step.completed {
    background: #00a32a;
    color: #fff;
}

.aicp-progress-connector {
    width: 40px;
    height: 2px;
    background: #e0e0e0;
}

.aicp-progress-connector.completed {
    background: #00a32a;
}

/* Features List (Step 0) */
.aicp-features-list {
    margin: 24px 0 32px;
    padding: 0;
}

.aicp-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    color: #1d2327;
}

.aicp-feature-icon {
    color: #00a32a;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

/* Credentials Section */
.aicp-credentials-section {
    background: #f6f7f7;
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
}

.aicp-credentials-section h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.aicp-credential-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.aicp-credential-row label {
    font-weight: 600;
    font-size: 13px;
    min-width: 120px;
}

.aicp-credential-row code {
    background: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 13px;
    word-break: break-all;
}

.aicp-credentials-note {
    color: #646970;
    font-size: 13px;
    margin: 8px 0 0;
}

/* Instructions (Step 1) */
.aicp-instructions {
    background: #f0f6fc;
    border: 1px solid #c5d9ed;
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
}

.aicp-instructions h3 {
    margin: 0 0 12px;
    font-size: 15px;
    color: #1d2327;
}

.aicp-instructions ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.aicp-instructions li {
    margin-bottom: 8px;
    font-size: 14px;
    color: #1d2327;
}

.aicp-external-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2271b1;
    font-weight: 500;
    text-decoration: none;
    font-size: 14px;
}

.aicp-external-link:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Linking Form */
.aicp-linking-form {
    margin: 24px 0;
}

.aicp-linking-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.aicp-input-large {
    width: 100%;
    padding: 12px 16px;
    font-size: 18px;
    font-family: monospace;
    letter-spacing: 2px;
    text-align: center;
    border: 2px solid #c3c4c7;
    border-radius: 8px;
    text-transform: uppercase;
}

.aicp-input-large:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
    outline: none;
}

.aicp-field-hint {
    color: #646970;
    font-size: 12px;
    margin: 6px 0 0;
}

/* Form Elements */
.aicp-form {
    margin: 24px 0;
    text-align: left;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.aicp-form-group {
    margin-bottom: 20px;
}

.aicp-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: #1d2327;
}

.aicp-form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.aicp-form-section:last-child {
    border-bottom: none;
}

.aicp-form-section h3 {
    margin: 0 0 12px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aicp-sub-section {
    margin-left: 28px;
    margin-top: 12px;
}

.aicp-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.aicp-select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

/* Checkbox Cards (Step 2) */
.aicp-capability-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0;
}

.aicp-capability-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aicp-capability-card:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.aicp-capability-card.selected {
    border-color: #2271b1;
    background: #f0f6fc;
    box-shadow: 0 0 0 1px #2271b1;
}

.aicp-capability-card input[type="checkbox"] {
    display: none;
}

.aicp-capability-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aicp-capability-icon {
    margin-bottom: 8px;
    color: #2271b1;
}

.aicp-capability-text h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.aicp-capability-text p {
    margin: 0;
    color: #646970;
    font-size: 13px;
}

.aicp-checkbox-indicator {
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid #c3c4c7;
    border-radius: 3px;
    margin-top: 8px;
    transition: all 0.2s;
}

.aicp-capability-card.selected .aicp-checkbox-indicator {
    background: #2271b1;
    border-color: #2271b1;
}

/* Checkbox Label */
.aicp-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal !important;
}

.aicp-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 4px;
    margin-top: 8px;
}

.aicp-checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 13px;
    cursor: pointer;
}

/* Badges */
.aicp-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    background: #e0e0e0;
    color: #646970;
}

.aicp-badge-green {
    background: #edfaef;
    color: #00a32a;
}

/* Buttons */
.aicp-wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    gap: 12px;
}

.aicp-wizard-actions-center {
    justify-content: center;
}

.aicp-button-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.aicp-button-primary:hover {
    background: #135e96;
    color: #fff;
}

.aicp-button-primary:disabled {
    background: #c3c4c7;
    cursor: not-allowed;
}

.aicp-button-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #f6f7f7;
    color: #2271b1;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.aicp-button-secondary:hover {
    background: #f0f0f1;
    color: #135e96;
}

.aicp-button-link {
    background: none;
    border: none;
    color: #2271b1;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 0;
    text-decoration: underline;
}

.aicp-button-link:hover {
    color: #135e96;
}

.aicp-arrow {
    font-size: 16px;
}

/* Messages */
.aicp-error-message {
    background: #fcf0f1;
    border: 1px solid #d63638;
    color: #d63638;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin: 16px 0;
}

.aicp-success-message {
    background: #edfaef;
    border: 1px solid #00a32a;
    color: #00a32a;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin: 16px 0;
}

.aicp-success-box {
    background: #edfaef;
    border: 1px solid #00a32a;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    margin: 24px 0;
}

.aicp-success-icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #00a32a;
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}

/* Notices */
.aicp-notice {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.aicp-notice-warning {
    background: #fcf9e8;
    border: 1px solid #dba617;
}

.aicp-section-disabled {
    opacity: 0.6;
}

.aicp-hint {
    color: #646970;
    font-size: 13px;
}

/* Spinner */
.aicp-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: aicp-spin 0.6s linear infinite;
}

@keyframes aicp-spin {
    to { transform: rotate(360deg); }
}

/* Refresh spin animation */
.dashicons.spin {
    animation: aicp-spin 1s linear infinite;
}

/* Success Animation (Wizard Step 5) */
.aicp-success-animation {
    margin-bottom: 24px;
}

.aicp-checkmark {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    animation: aicp-pulse 2s ease-in-out infinite;
}

.aicp-checkmark svg {
    stroke: white;
}

@keyframes aicp-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.aicp-success-card {
    text-align: center;
}

/* Success Page (Step 5) */
.aicp-setup-summary {
    background: #f6f7f7;
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
    text-align: left;
}

.aicp-setup-summary h3 {
    margin: 0 0 12px;
    font-size: 15px;
}

.aicp-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aicp-summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
}

.aicp-summary-icon {
    color: #00a32a;
    font-weight: bold;
}

/* Next Steps Grid */
.aicp-next-steps {
    margin: 24px 0;
    text-align: left;
}

.aicp-next-steps h3 {
    margin: 0 0 16px;
    font-size: 15px;
    text-align: center;
}

.aicp-next-steps-grid {
    display: grid;
    gap: 12px;
}

.aicp-next-step-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #1d2327;
    transition: all 0.2s;
}

.aicp-next-step-card:hover {
    border-color: #2271b1;
    background: #f0f6fc;
    color: #1d2327;
}

.aicp-next-step-icon {
    flex-shrink: 0;
    color: #2271b1;
}

.aicp-next-step-text {
    flex: 1;
}

.aicp-next-step-text strong {
    display: block;
    font-size: 14px;
}

.aicp-next-step-text span {
    font-size: 13px;
    color: #646970;
}

.aicp-external-icon {
    color: #646970;
    font-size: 16px;
}

/* Test Connection */
.aicp-test-connection {
    margin-top: 24px;
    text-align: center;
}

.aicp-test-result {
    display: inline-block;
    margin-left: 8px;
    font-size: 13px;
}

.aicp-test-result.success {
    color: #00a32a;
}

.aicp-test-result.error {
    color: #d63638;
}

/* Content sharing (Step 4) */
.aicp-sharing-options {
    margin: 24px 0;
}

.aicp-sharing-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

/* Migration Notice */
.aicp-migration-notice h3 {
    color: #1d2327;
}

/* Settings Page - matches wizard layout */
.aicp-settings-page {
    max-width: 680px;
    margin: 40px auto;
    padding: 0 20px;
}

.aicp-settings-page h2 {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 12px;
    color: #1d2327;
}

.aicp-settings-page .aicp-wizard-card {
    margin-bottom: 20px;
}

.aicp-settings-header {
    text-align: center;
    margin-bottom: 8px;
}

.aicp-settings-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 8px;
}

.aicp-settings-header p {
    color: #646970;
    font-size: 15px;
    margin: 0;
}

/* Settings Tabs */
.aicp-settings-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 24px;
}

.aicp-settings-tab {
    flex: 1;
    padding: 14px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 600;
    color: #646970;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.aicp-settings-tab:hover {
    color: #2271b1;
    background: #f6f7f7;
}

.aicp-settings-tab.active {
    color: #2271b1;
    border-bottom-color: #2271b1;
}

/* Connection Details */
.aicp-connection-details {
    background: #f6f7f7;
    border-radius: 8px;
    padding: 20px 24px;
    margin: 20px 0;
    text-align: left;
}

.aicp-detail-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 14px;
}

.aicp-detail-row strong {
    min-width: 120px;
    color: #1d2327;
}

.aicp-detail-row code {
    background: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 12px;
}

/* Capability Toggle List */
.aicp-capability-toggle-list {
    margin: 20px 0;
}

.aicp-capability-toggle-item {
    background: #f6f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.aicp-capability-toggle-item:hover {
    border-color: #2271b1;
}

.aicp-capability-toggle-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
}

.aicp-capability-toggle-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.aicp-capability-toggle-text {
    flex: 1;
}

.aicp-capability-toggle-text strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
    color: #1d2327;
}

.aicp-capability-toggle-text small {
    color: #646970;
    font-size: 13px;
}

/* Settings Messages */
.aicp-settings-message {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin: 16px 0;
    text-align: center;
}

.aicp-settings-message.aicp-message-success {
    background: #edfaef;
    border: 1px solid #00a32a;
    color: #00a32a;
}

.aicp-settings-message.aicp-message-error {
    background: #fcf0f1;
    border: 1px solid #d63638;
    color: #d63638;
}

.aicp-settings-message.aicp-message-warning {
    background: #fcf9e8;
    border: 1px solid #dba617;
    color: #996800;
}

/* Dashboard */
.aicp-dashboard-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.aicp-dashboard-heading svg {
    flex-shrink: 0;
}

.aicp-dashboard-heading span {
    flex: 1;
}

.aicp-dashboard-hint {
    color: #646970;
    font-size: 14px;
    margin: 0 0 20px;
}

.aicp-refresh-btn {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    padding: 6px 8px;
    color: #646970;
    transition: all 0.2s;
}

.aicp-refresh-btn:hover {
    background: #f6f7f7;
    color: #2271b1;
    border-color: #2271b1;
}

.aicp-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.aicp-stat-card {
    text-align: center;
    padding: 24px 16px;
    background: #f6f7f7;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.aicp-stat-value {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: #2271b1;
    margin-bottom: 8px;
}

.aicp-stat-label {
    display: block;
    font-size: 14px;
    color: #646970;
    font-weight: 500;
}

.aicp-chart-container {
    margin-top: 24px;
    height: 300px;
}

.aicp-quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 600px) {
    .aicp-wizard-card {
        padding: 24px 20px;
    }

    .aicp-capability-cards {
        grid-template-columns: 1fr;
    }

    .aicp-wizard-actions {
        flex-direction: column;
    }

    .aicp-credential-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .aicp-checkbox-grid {
        grid-template-columns: 1fr;
    }
}
