/**
 * Activation Wizard Styles.
 *
 * @package PrimeLink
 */

/* Blur background when wizard is active, but keep admin menu visible */
body.mt-primelink-wizard-active #wpcontent,
body.mt-primelink-wizard-active #wpfooter {
    filter: blur(5px);
    -webkit-filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

/* Keep admin menu visible and not blurred */
body.mt-primelink-wizard-active #adminmenuback,
body.mt-primelink-wizard-active #adminmenuwrap,
body.mt-primelink-wizard-active #adminmenumain,
body.mt-primelink-wizard-active #adminmenu {
    filter: none !important;
    -webkit-filter: none !important;
    pointer-events: auto !important;
    z-index: 1000000 !important;
}

body.mt-primelink-wizard-active {
    overflow: hidden;
}

/* Wizard overlay - centered modal with blur background */
.mt-primelink-wizard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    animation: wizardFadeIn 0.3s ease-out;
}

/* Ensure overlay doesn't cover admin menu - adjust left position */
body:not(.folded) .mt-primelink-wizard-overlay {
    left: 160px; /* After admin menu */
}

body.folded .mt-primelink-wizard-overlay {
    left: 36px; /* After folded admin menu */
}

/* Adjust for mobile/tablet/small screens - Full screen mode */
@media screen and (max-width: 1024px) {
    /* On mobile/tablet, overlay should cover full screen */
    body.mt-primelink-wizard-active .mt-primelink-wizard-overlay {
        left: 0 !important;
        right: 0 !important;
        padding: 0;
        top: 0 !important;
        bottom: 0 !important;
    }
    
    .mt-primelink-wizard-overlay {
        padding: 0;
        align-items: flex-start;
        justify-content: flex-start;
        background: rgba(0, 0, 0, 0.7);
    }
    
    .mt-primelink-wizard-container {
        max-width: 100%;
        width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        box-shadow: none;
    }
    
    /* Ensure close button is always visible and accessible on mobile/tablet */
    .mt-primelink-wizard-close {
        position: fixed;
        top: 12px;
        right: 12px;
        z-index: 1000001;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .mt-primelink-wizard-close .dashicons {
        font-size: 24px;
        width: 24px;
        height: 24px;
    }
    
    .mt-primelink-wizard-close:hover,
    .mt-primelink-wizard-close:focus {
        background: #fff;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
        transform: scale(1.05);
    }
    
    .mt-primelink-wizard-close:active {
        transform: scale(0.95);
    }
}

/* Wizard container - centered modal */
.mt-primelink-wizard-container {
    background: #fff;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: wizardSlideIn 0.3s ease-out;
    position: relative;
    margin: auto;
}

/* Close button */
.mt-primelink-wizard-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #666;
    cursor: pointer;
    z-index: 1000001;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.mt-primelink-wizard-close:hover {
    background: #fff;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mt-primelink-wizard-close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

@keyframes wizardSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes wizardFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.mt-primelink-wizard-header {
    padding: 30px 60px 25px;
    border-bottom: 1px solid #e5e5e5;
    background: linear-gradient(135deg, #3b28c0 0%, #180b77 100%);
    color: #fff;
    flex-shrink: 0;
}

.mt-primelink-wizard-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 40px;
}

.mt-primelink-wizard-header-text {
    flex: 1;
    text-align: left;
}

.mt-primelink-wizard-header h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 600;
    color: #fff;
    text-align: left;
}

.mt-primelink-wizard-subtitle {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    color: #fff;
    text-align: left;
}

.mt-primelink-wizard-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mt-primelink-wizard-logo img {
    max-width: 200px;
    height: auto;
}

/* Progress bar */
.mt-primelink-wizard-progress {
    padding: 25px 60px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.mt-primelink-wizard-progress-bar {
    height: 4px;
    background: #e5e5e5;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.mt-primelink-wizard-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.mt-primelink-wizard-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.mt-primelink-wizard-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e5e5e5;
    z-index: 0;
}

.mt-primelink-wizard-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.mt-primelink-wizard-step .step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e5e5e5;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.mt-primelink-wizard-step.active .step-number {
    background: linear-gradient(135deg, #3b28c0 0%, #180b77 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.mt-primelink-wizard-step.completed .step-number {
    background: #28a745;
    color: #fff;
}

.mt-primelink-wizard-step.completed .step-number::before {
    content: '✓';
    font-size: 20px;
}

.mt-primelink-wizard-step .step-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.mt-primelink-wizard-step.active .step-label {
    color: #667eea;
}

/* Content */
.mt-primelink-wizard-content {
    flex: 1;
    padding: 40px 60px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 0;
    max-height: calc(100vh - 400px);
}

.mt-primelink-wizard-step-inner {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
    padding: 20px 0;
}

.mt-primelink-wizard-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b28c0 0%, #180b77 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 36px;
}

.mt-primelink-wizard-icon.success {
    background: #28a745;
}

.mt-primelink-wizard-step-inner h2 {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.mt-primelink-wizard-description {
    margin: 0 0 30px;
    font-size: 15px;
    color: #666;
    line-height: 1.6;
}

/* Form */
.mt-primelink-wizard-form {
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.mt-primelink-wizard-form-group {
    margin-bottom: 20px;
}

.mt-primelink-wizard-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.mt-primelink-wizard-form-group .required {
    color: #dc3545;
    margin-left: 3px;
}

.mt-primelink-wizard-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.mt-primelink-wizard-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.mt-primelink-wizard-help {
    margin: 8px 0 0;
    font-size: 13px;
    color: #999;
    line-height: 1.5;
}

.mt-primelink-wizard-help a {
    color: #667eea;
    text-decoration: none;
}

.mt-primelink-wizard-help a:hover {
    text-decoration: underline;
}

.mt-primelink-wizard-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.mt-primelink-wizard-checkbox {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* License status */
.mt-primelink-wizard-license-status {
    margin-top: 20px;
}

.mt-primelink-wizard-alert {
    padding: 12px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.mt-primelink-wizard-alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mt-primelink-wizard-alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.mt-primelink-wizard-alert .dashicons {
    margin-right: 8px;
}

/* Info box */
.mt-primelink-wizard-info-box {
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 18px;
    margin-top: 25px;
    text-align: left;
}

.mt-primelink-wizard-info-box h4 {
    margin: 0 0 12px;
    font-size: 15px;
    color: #333;
}

.mt-primelink-wizard-info-box ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.mt-primelink-wizard-info-box ul li {
    margin-bottom: 6px;
    color: #666;
    position: relative;
    padding-left: 20px;
    font-size: 14px;
}

.mt-primelink-wizard-info-box ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

/* Test results */
.mt-primelink-wizard-test-results {
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}

.mt-primelink-wizard-test-results::-webkit-scrollbar {
    width: 6px;
}

.mt-primelink-wizard-test-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.mt-primelink-wizard-test-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.mt-primelink-wizard-test-results::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.mt-primelink-wizard-test-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    min-height: 70px;
}

.mt-primelink-wizard-test-item.success {
    background: #d4edda;
    border-color: #c3e6cb;
}

.mt-primelink-wizard-test-item.warning {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.mt-primelink-wizard-test-item.error {
    background: #f8d7da;
    border-color: #f5c6cb;
}

.mt-primelink-wizard-test-icon {
    margin-right: 10px;
    font-size: 18px;
    color: #999;
    flex-shrink: 0;
    margin-top: 2px;
}

.mt-primelink-wizard-test-item.success .mt-primelink-wizard-test-icon {
    color: #28a745;
}

.mt-primelink-wizard-test-item.warning .mt-primelink-wizard-test-icon {
    color: #ffc107;
}

.mt-primelink-wizard-test-item.error .mt-primelink-wizard-test-icon {
    color: #dc3545;
}

.mt-primelink-wizard-test-content {
    flex: 1;
    min-width: 0;
}

.mt-primelink-wizard-test-content h4 {
    margin: 0 0 3px;
    font-size: 14px;
    color: #333;
    font-weight: 600;
    line-height: 1.3;
}

.mt-primelink-wizard-test-content p {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.spin {
    animation: spin 1s linear infinite;
}

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

/* Complete step */
.mt-primelink-wizard-complete-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.mt-primelink-wizard-help-links {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e5e5e5;
}

.mt-primelink-wizard-help-links h4 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #333;
}

.mt-primelink-wizard-help-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.mt-primelink-wizard-help-links ul li {
    margin: 0;
}

.mt-primelink-wizard-help-links ul li a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.mt-primelink-wizard-help-links ul li a:hover {
    text-decoration: underline;
}

/* Footer */
.mt-primelink-wizard-footer {
    padding: 20px 60px;
    border-top: 1px solid #e5e5e5;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    gap: 12px;
}

.mt-primelink-wizard-footer-left {
    display: flex;
    gap: 12px;
}

.mt-primelink-wizard-footer-right {
    display: flex;
    gap: 12px;
}

/* Buttons */
.mt-primelink-wizard-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.mt-primelink-wizard-btn-primary {
    background: linear-gradient(135deg, #3b28c0 0%, #180b77 100%);
    color: #fff;
}

.mt-primelink-wizard-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.mt-primelink-wizard-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.mt-primelink-wizard-btn-secondary {
    background: #fff;
    color: #667eea;
    border: 2px solid #667eea;
}

.mt-primelink-wizard-btn-secondary:hover {
    background: #667eea;
    color: #fff;
}

.mt-primelink-wizard-btn-skip {
    background: transparent;
    color: #666;
    border: none;
    text-decoration: underline;
    padding: 12px 16px;
    display: inline-block; /* Ensure it's always visible */
    visibility: visible !important;
    opacity: 1 !important;
}

.mt-primelink-wizard-btn-skip:hover {
    color: #333;
    background: transparent;
    transform: none;
    box-shadow: none;
}

/* Responsive - Mobile specific adjustments */
@media (max-width: 782px) {
    /* Header adjustments */
    .mt-primelink-wizard-header {
        padding: 20px 16px 16px;
    }

    .mt-primelink-wizard-header-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .mt-primelink-wizard-header-text {
        text-align: center;
        width: 100%;
    }

    .mt-primelink-wizard-header h1 {
        font-size: 22px;
        margin: 0 0 6px;
        text-align: center;
        line-height: 1.3;
    }

    .mt-primelink-wizard-subtitle {
        text-align: center;
        font-size: 13px;
    }

    .mt-primelink-wizard-logo {
        width: 100%;
        justify-content: center;
    }

    .mt-primelink-wizard-logo img {
        max-width: 120px;
        height: auto;
    }

    /* Close button - larger on mobile */
    .mt-primelink-wizard-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }

    .mt-primelink-wizard-close .dashicons {
        font-size: 24px;
        width: 24px;
        height: 24px;
    }

    /* Progress section */
    .mt-primelink-wizard-progress {
        padding: 16px 16px 20px;
    }

    .mt-primelink-wizard-steps {
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .mt-primelink-wizard-steps::-webkit-scrollbar {
        height: 2px;
    }

    .mt-primelink-wizard-step {
        flex: 0 0 auto;
        min-width: 60px;
    }

    .mt-primelink-wizard-step .step-number {
        width: 32px;
        height: 32px;
        font-size: 13px;
        margin-bottom: 6px;
    }

    .mt-primelink-wizard-step .step-label {
        font-size: 10px;
        white-space: nowrap;
    }

    /* Content section */
    .mt-primelink-wizard-content {
        padding: 24px 16px;
        max-height: calc(100vh - 320px);
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mt-primelink-wizard-step-inner {
        padding: 12px 0;
    }

    .mt-primelink-wizard-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
        margin-bottom: 16px;
    }

    .mt-primelink-wizard-step-inner h2 {
        font-size: 20px;
        margin: 0 0 10px;
    }

    .mt-primelink-wizard-description {
        font-size: 14px;
        margin: 0 0 24px;
        line-height: 1.5;
    }

    /* Form adjustments */
    .mt-primelink-wizard-form {
        max-width: 100%;
    }

    .mt-primelink-wizard-form-group {
        margin-bottom: 18px;
    }

    .mt-primelink-wizard-input {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Test results */
    .mt-primelink-wizard-test-results {
        grid-template-columns: 1fr;
        max-height: 300px;
        gap: 10px;
    }

    .mt-primelink-wizard-test-item {
        padding: 12px;
        min-height: auto;
    }

    .mt-primelink-wizard-test-content h4 {
        font-size: 13px;
    }

    .mt-primelink-wizard-test-content p {
        font-size: 12px;
    }

    /* Footer - Full width with Skip always visible */
    .mt-primelink-wizard-footer {
        padding: 16px;
        flex-direction: column;
        gap: 12px;
        border-top: 1px solid #e5e5e5;
        background: #fff;
        position: relative;
        z-index: 10;
    }

    .mt-primelink-wizard-footer-left,
    .mt-primelink-wizard-footer-right {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mt-primelink-wizard-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px; /* Larger for easier tapping */
        min-height: 48px; /* Minimum touch target size */
    }

    /* Skip button - always visible and prominent on mobile/tablet */
    .mt-primelink-wizard-btn-skip {
        order: -1; /* Skip button first on mobile */
        padding: 14px 20px;
        font-size: 15px;
        font-weight: 500;
        min-height: 48px;
        background: #fff;
        color: #666;
        border: 2px solid #ddd;
        border-radius: 6px;
        text-decoration: none;
        display: block !important; /* Always visible */
        visibility: visible !important;
        opacity: 1 !important;
    }

    .mt-primelink-wizard-btn-skip:hover,
    .mt-primelink-wizard-btn-skip:focus {
        background: #f8f9fa;
        color: #333;
        border-color: #999;
        text-decoration: none;
    }

    .mt-primelink-wizard-btn-skip:active {
        background: #e9ecef;
        transform: scale(0.98);
    }

    /* Info box */
    .mt-primelink-wizard-info-box {
        padding: 16px;
        margin-top: 20px;
    }

    .mt-primelink-wizard-info-box h4 {
        font-size: 14px;
        margin: 0 0 10px;
    }

    .mt-primelink-wizard-info-box ul li {
        font-size: 13px;
        margin-bottom: 8px;
        padding-left: 24px;
    }

    /* Complete step actions */
    .mt-primelink-wizard-complete-actions {
        flex-direction: column;
        gap: 12px;
        margin-top: 24px;
    }

    .mt-primelink-wizard-help-links {
        margin-top: 24px;
        padding-top: 20px;
    }

    .mt-primelink-wizard-help-links ul {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .mt-primelink-wizard-help-links ul li a {
        font-size: 14px;
        padding: 8px 0;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .mt-primelink-wizard-header h1 {
        font-size: 20px;
    }

    .mt-primelink-wizard-subtitle {
        font-size: 12px;
    }

    .mt-primelink-wizard-logo img {
        max-width: 100px;
    }

    .mt-primelink-wizard-step .step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .mt-primelink-wizard-step .step-label {
        font-size: 9px;
    }

    .mt-primelink-wizard-content {
        padding: 20px 12px;
    }

    .mt-primelink-wizard-step-inner h2 {
        font-size: 18px;
    }

    .mt-primelink-wizard-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

