/* ============================================
   PDF Tools - UX Enhancement Styles
   User journeys, tooltips, trust badges, ads
   ============================================ */

/* ============================================
   ONBOARDING & TOOLTIPS
   ============================================ */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-2) var(--space-3);
    background: var(--text-primary);
    color: var(--bg-primary);
    font-size: var(--text-xs);
    border-radius: var(--radius-md);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--text-primary);
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* First-time user guide overlay */
.guide-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    max-width: 500px;
    text-align: center;
    animation: fadeInUp 0.4s ease;
}

.guide-step-indicator {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.guide-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
}

.guide-dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 4px;
}

.guide-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-4);
    background: var(--primary-glow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.guide-title {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.guide-description {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
    line-height: 1.6;
}

.guide-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}

/* ============================================
   3-STEP FLOW INDICATOR
   ============================================ */
.step-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.step-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.3s;
}

.step-item.active {
    background: var(--primary);
    color: white;
}

.step-item.completed {
    color: var(--success);
}

.step-item.completed .step-icon {
    background: var(--success);
    color: white;
}

.step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 700;
}

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--border-color);
}

.step-connector.active {
    background: var(--primary);
}

/* ============================================
   SUCCESS SCREEN
   ============================================ */
.success-screen {
    text-align: center;
    padding: var(--space-12);
    animation: fadeInUp 0.5s ease;
}

.success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto var(--space-6);
    background: linear-gradient(135deg, var(--success), #34d399);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 50px;
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.success-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
    color: var(--success);
}

.success-message {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

.success-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-8);
    margin-bottom: var(--space-6);
    padding: var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.success-stat {
    text-align: center;
}

.success-stat-value {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.success-stat-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.success-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 300px;
    margin: 0 auto;
}

/* ============================================
   TRUST BADGES
   ============================================ */
.trust-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    padding: var(--space-4);
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.trust-badge-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success-glow, rgba(34, 197, 94, 0.1));
    color: var(--success);
    border-radius: 50%;
    font-size: 12px;
}

/* ============================================
   VALUE PROPOSITION BANNER
   ============================================ */
.value-banner {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    padding: var(--space-4) var(--space-6);
    text-align: center;
    font-size: var(--text-sm);
}

.value-banner strong {
    font-weight: 600;
}

.value-banner a {
    color: white;
    text-decoration: underline;
}

/* ============================================
   AD ZONES (Non-intrusive)
   ============================================ */
.ad-zone {
    padding: var(--space-3);
    background: var(--bg-secondary);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-zone-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ad-zone-sidebar {
    width: 160px;
    min-height: 600px;
    position: sticky;
    top: 100px;
}

.ad-zone-banner {
    width: 100%;
    max-width: 728px;
    height: 90px;
    margin: var(--space-6) auto;
}

.ad-zone-footer {
    margin-top: var(--space-8);
}

.ad-disclaimer {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-align: center;
    margin-top: var(--space-2);
}

/* Hide sidebar ads on mobile */
@media (max-width: 1200px) {
    .ad-zone-sidebar {
        display: none;
    }
}

/* ============================================
   FRIENDLY ERROR MESSAGES
   ============================================ */
.error-message {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
}

.error-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--error);
}

.error-content h4 {
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.error-content p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.error-suggestion {
    font-size: var(--text-xs);
    color: var(--text-muted);
    padding: var(--space-2);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */
/* Focus states */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    padding: var(--space-2) var(--space-4);
    background: var(--primary);
    color: white;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid currentColor;
    }

    .btn {
        border: 2px solid currentColor;
    }
}

/* ============================================
   KEYBOARD SHORTCUTS HINT
   ============================================ */
.kbd {
    display: inline-block;
    padding: 2px 6px;
    font-family: var(--font-mono, monospace);
    font-size: var(--text-xs);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 0 var(--border-color);
}

.shortcuts-hint {
    position: fixed;
    bottom: var(--space-4);
    left: var(--space-4);
    padding: var(--space-2) var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    color: var(--text-muted);
    box-shadow: var(--shadow-md);
    opacity: 0.8;
    transition: opacity 0.3s;
}

.shortcuts-hint:hover {
    opacity: 1;
}

/* ============================================
   FRIENDLY ILLUSTRATIONS
   ============================================ */
.illustration-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.empty-illustration {
    text-align: center;
    padding: var(--space-8);
}

.empty-illustration svg {
    width: 120px;
    height: 120px;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-illustration h3 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-2);
}

.empty-illustration p {
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

/* ============================================
   LOADING STATES
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: var(--space-2);
}

.skeleton-card {
    height: 200px;
}

/* ============================================
   CONTEXTUAL HELP
   ============================================ */
.help-text {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-3);
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: var(--space-2);
}

.help-text svg {
    flex-shrink: 0;
    color: var(--info);
}

.help-link {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
}

.help-link:hover {
    color: var(--primary-hover);
}