/**
 * Onboarding styles for WP-AutoInsight
 * Clean version matching WordPress admin aesthetic
 *
 * @package WP-AutoInsight
 */

/* ============================================================================
   CONTAINER & LAYOUT
   ============================================================================ */

.abcc-onboarding-wrap {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0 -20px -20px;
    padding: 30px 20px;
    position: relative;
    overflow-x: hidden;
}

.abcc-onboarding-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="30" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
}

.abcc-onboarding-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* ============================================================================
   HEADER & PROGRESS
   ============================================================================ */

.abcc-onboarding-header {
    text-align: center;
    padding: 40px 40px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
}

.abcc-onboarding-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.abcc-onboarding-header h1 {
    margin: 0 0 10px;
    color: white;
    font-size: 2.5em;
    font-weight: 300;
    letter-spacing: -0.5px;
}

.abcc-onboarding-header p {
    margin: 0 0 30px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2em;
    line-height: 1.6;
    opacity: 0.9;
}

.abcc-progress-bar {
    width: 100%;
    max-width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto 25px;
}

.abcc-progress-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 33.33%;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

.abcc-step-indicators {
    display: flex;
    justify-content: center;
    gap: 25px;
}

.abcc-step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.abcc-step.active {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.abcc-step.completed {
    background: rgba(255, 255, 255, 0.9);
    color: #46b450;
    border-color: rgba(255, 255, 255, 0.4);
}

.abcc-step.completed::after {
    content: '✓';
    position: absolute;
    font-size: 14px;
    font-weight: bold;
}

/* ============================================================================
   STEP CONTENT
   ============================================================================ */

.abcc-onboarding-step {
    display: none;
    padding: 30px 40px 40px;
}

.abcc-onboarding-step.active {
    display: block;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.abcc-step-content h2 {
    margin: 0 0 10px;
    color: #2c3e50;
    font-size: 1.8em;
    font-weight: 600;
    text-align: center;
}

.abcc-step-content > p {
    margin: 0 0 30px;
    color: #6c757d;
    font-size: 1em;
    text-align: center;
    line-height: 1.6;
}

/* ============================================================================
   GOAL SELECTION (STEP 1)
   ============================================================================ */

.abcc-goal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.abcc-goal-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.abcc-goal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 8px 8px 0 0;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.abcc-goal-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.abcc-goal-card:hover::before {
    transform: scaleX(1);
}

.abcc-goal-card.selected {
    border-color: #2271b1;
    background: linear-gradient(135deg, #f0f6ff 0%, #e6f2ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 113, 177, 0.15);
}

.abcc-goal-card.selected::before {
    transform: scaleX(1);
    background: #2271b1;
}

.abcc-goal-card.selected::after {
    content: '✓';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    background: #2271b1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.abcc-goal-card.goal-saved {
    animation: goalSaved 1s ease;
}

@keyframes goalSaved {
    0%, 100% { transform: translateY(-2px); }
    50% { transform: translateY(-4px) scale(1.02); }
}

.abcc-goal-icon {
    margin-bottom: 15px;
}

.abcc-goal-icon .dashicons {
    font-size: 2em;
    color: #667eea;
    width: 2em;
    height: 2em;
}

.abcc-goal-card h3 {
    margin: 0 0 10px;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

.abcc-goal-card p {
    margin: 0 0 15px;
    color: #6c757d;
    font-size: 0.9em;
    line-height: 1.4;
}

.abcc-goal-features {
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    display: none;
}

.abcc-goal-features small {
    color: #495057;
    font-size: 0.8em;
}

/* ============================================================================
   API PROVIDERS (STEP 2)
   ============================================================================ */

.abcc-api-providers {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.abcc-api-provider {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.abcc-api-provider:hover {
    border-color: #c0c0c0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.abcc-api-provider.selected {
    border-color: #2271b1;
    box-shadow: 0 6px 20px rgba(34, 113, 177, 0.15);
    transform: translateY(-2px);
}

.abcc-api-provider.connected {
    border-color: #46b450;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.abcc-provider-header {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #f6f7f7;
    border-bottom: 1px solid #e9ecef;
}

.abcc-provider-logo {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.abcc-provider-logo svg {
    width: 24px;
    height: 24px;
    color: #667eea;
}

.abcc-provider-info {
    flex: 1;
}

.abcc-provider-info h3 {
    margin: 0 0 5px;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

.abcc-provider-info p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9em;
}

.abcc-provider-status {
    min-width: 120px;
    text-align: right;
    font-size: 0.9em;
}

.abcc-provider-status.success {
    color: #46b450;
}

.abcc-provider-status.error {
    color: #dc3232;
}

.abcc-provider-content {
    padding: 20px;
}

.abcc-api-input {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.abcc-api-input input[type="password"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Monaco', 'Consolas', monospace;
    transition: border-color 0.2s ease;
}

.abcc-api-input input[type="password"]:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.abcc-api-input input.long-key {
    font-size: 12px;
}

.abcc-api-input .button {
    min-width: 80px;
    height: auto;
}

.abcc-api-help a {
    color: #2271b1;
    text-decoration: none;
    font-size: 0.9em;
}

.abcc-api-help a:hover {
    color: #135e96;
    text-decoration: underline;
}

.abcc-wp-config-notice {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 15px;
    color: #155724;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.abcc-wp-config-notice .dashicons {
    color: #46b450;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.abcc-copy-key {
    min-width: 40px !important;
    padding: 0 !important;
    margin-left: 5px;
}

/* ============================================================================
   FIRST POST (STEP 3)
   ============================================================================ */

.abcc-first-post-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.abcc-post-preview-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.abcc-post-icon {
    margin-bottom: 20px;
}

.abcc-post-icon .dashicons {
    font-size: 3em;
    color: #667eea;
    width: 3em;
    height: 3em;
}

.abcc-post-preview-card h3 {
    margin: 0 0 15px;
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 600;
}

.abcc-post-preview-card p {
    margin: 0 0 20px;
    color: #6c757d;
    line-height: 1.5;
}

.abcc-post-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.abcc-feature {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #46b450;
    font-size: 0.9em;
}

.abcc-feature .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
    margin-right: 8px;
}

.abcc-generation-status {
    text-align: center;
    padding: 25px;
    background: #f6f7f7;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.abcc-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.abcc-generation-status p {
    margin: 0;
    color: #6c757d;
    font-size: 1em;
}

/* ============================================================================
   SUCCESS STEP
   ============================================================================ */

.abcc-success-content {
    text-align: center;
    padding: 20px 0;
}

.abcc-success-content.celebrate {
    animation: celebrate 0.6s ease-out;
}

@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.abcc-success-icon {
    margin-bottom: 25px;
}

.abcc-success-icon .dashicons {
    font-size: 4em;
    color: #46b450;
    width: 4em;
    height: 4em;
    background: #ecfdf5;
    border-radius: 50%;
    padding: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

.abcc-success-content h2 {
    color: #2c3e50;
    font-size: 2em;
    margin-bottom: 15px;
    font-weight: 300;
}

.abcc-success-content > p {
    font-size: 1.1em;
    margin-bottom: 30px;
    color: #6c757d;
}

.abcc-success-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.abcc-success-actions .button-hero {
    padding: 12px 24px;
    font-size: 1em;
    height: auto;
    border-radius: 4px;
}

.abcc-next-steps {
    background: #f6f7f7;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.abcc-next-steps h3 {
    margin: 0 0 15px;
    color: #2c3e50;
    text-align: center;
    font-weight: 600;
}

.abcc-next-steps ul {
    margin: 0;
    padding-left: 20px;
    color: #6c757d;
    line-height: 1.6;
}

.abcc-next-steps li {
    margin-bottom: 8px;
}

/* ============================================================================
   STEP ACTIONS
   ============================================================================ */

.abcc-step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
    margin-top: 25px;
}

.abcc-step-actions .button {
    padding: 8px 16px;
    height: auto;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.abcc-step-actions .button-primary {
    background: #2271b1;
    border-color: #2271b1;
}

.abcc-step-actions .button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.abcc-step-actions .button-primary:disabled {
    background: #c3c4c7;
    border-color: #c3c4c7;
    color: #a7aaad;
    cursor: not-allowed;
}

.abcc-step-actions .button-secondary {
    background: #f6f7f7;
    border-color: #c3c4c7;
    color: #50575e;
}

.abcc-step-actions .button-secondary:hover {
    background: #f0f0f1;
    border-color: #8c8f94;
    color: #2c3338;
}

.abcc-step-actions .button-link {
    color: #646970;
    text-decoration: none;
    font-size: 13px;
}

.abcc-step-actions .button-link:hover {
    color: #2c3338;
}

#abcc-generate-first-post {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
}

#abcc-generate-first-post .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ============================================================================
   SPINNER & LOADING STATES
   ============================================================================ */

.abcc-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media screen and (max-width: 768px) {
    .abcc-onboarding-wrap {
        padding: 20px 10px;
    }
    
    .abcc-onboarding-container {
        margin: 0;
    }
    
    .abcc-onboarding-header {
        padding: 30px 20px 25px;
    }
    
    .abcc-onboarding-header h1 {
        font-size: 2em;
    }
    
    .abcc-onboarding-step {
        padding: 25px 20px 30px;
    }
    
    .abcc-goal-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .abcc-api-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .abcc-api-input .button {
        width: 100%;
        margin-top: 10px;
    }
    
    .abcc-step-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .abcc-step-actions .button {
        width: 100%;
        order: 2;
    }
    
    .abcc-step-actions .button-link {
        order: 1;
    }
    
    .abcc-success-actions {
        flex-direction: column;
    }
    
    .abcc-success-actions .button {
        width: 100%;
    }
    
    .abcc-step-indicators {
        gap: 15px;
    }
    
    .abcc-step {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    .abcc-onboarding-header h1 {
        font-size: 1.8em;
    }
    
    .abcc-onboarding-header p {
        font-size: 1em;
    }
    
    .abcc-step-content h2 {
        font-size: 1.5em;
    }
    
    .abcc-goal-card {
        padding: 16px;
    }
    
    .abcc-provider-header {
        padding: 15px;
    }
    
    .abcc-provider-content {
        padding: 15px;
    }
}

/* ============================================================================
   ACCESSIBILITY & FOCUS STATES
   ============================================================================ */

.abcc-goal-card:focus,
.abcc-api-provider:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.abcc-step:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* Help toggle button */
.abcc-help-toggle {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 8px 12px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    color: #2c3338;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.abcc-help-toggle:hover {
    background: #f0f0f1;
    border-color: #8c8f94;
}

.abcc-help-toggle.active {
    background: #e6f2ff;
    border-color: #2271b1;
    color: #2271b1;
}

.abcc-help-toggle .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.abcc-help-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s ease;
}

/* Help content */
.abcc-help-content {
    background: #f9f9f9;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 4px 4px;
    padding: 15px;
    margin-top: -1px;
}

.abcc-help-content ol {
    margin: 0 0 15px;
    padding-left: 20px;
    color: #50575e;
    line-height: 1.5;
}

.abcc-help-content li {
    margin-bottom: 8px;
}

.abcc-help-content a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

.abcc-help-content a:hover {
    text-decoration: underline;
}

/* Help notes */
.abcc-help-note {
    background: #fff2cd;
    border: 1px solid #f0d000;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 13px;
    color: #8a6d00;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.abcc-help-note.success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.abcc-help-note .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    flex-shrink: 0;
}

.abcc-help-note strong {
    font-weight: 600;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    .abcc-onboarding-wrap {
        background: white;
        color: black;
    }
    
    .abcc-onboarding-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .abcc-onboarding-step:not(.active) {
        display: none;
    }
}