/* ==================== PWA INSTALL PROMPT STYLES ==================== */

/* Floating Install Button */
.pwa-install-floating-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    z-index: 999;
    transition: all 0.3s ease;
    animation: slideInRight 0.5s ease;
}

.pwa-install-floating-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: var(--primary-dark);
}

.pwa-install-floating-btn svg {
    width: 20px;
    height: 20px;
}

@keyframes slideInRight {
    from {
        transform: translateX(200px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Onboarding Modal */
.pwa-onboarding-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.pwa-onboarding-modal.active {
    opacity: 1;
    pointer-events: all;
}

.pwa-onboarding-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.pwa-onboarding-content {
    position: relative;
    background: var(--surface);
    color: var(--text-primary);
    border-radius: 20px;
    max-width: 500px;
    width: calc(100% - 40px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.pwa-onboarding-modal.active .pwa-onboarding-content {
    transform: scale(1);
}

/* Header */
.pwa-onboarding-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px; /* Reduced from 24px */
    border-bottom: 1px solid var(--divider);
}

.pwa-onboarding-header h2 {
    margin: 0;
    font-size: 1.25rem; /* Reduced from 1.5rem */
    color: var(--text-primary);
}

.pwa-onboarding-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-tertiary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.pwa-onboarding-close:hover {
    background: var(--surface-secondary);
    color: var(--text-primary);
}

/* Steps Container */
.pwa-onboarding-steps {
    position: relative;
    padding: 16px; /* Further reduced for mobile */
    min-height: 300px; /* Allow more compact display */
    max-height: none;
}

.pwa-onboarding-step {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px; /* Further reduced */
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.4s ease;
    pointer-events: none;
    overflow-y: auto;
    max-height: calc(100vh - 240px); /* More space for progress + actions */
}

.pwa-onboarding-step.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

/* Step Icon */
.pwa-step-icon {
    font-size: 40px; /* Further reduced for mobile */
    text-align: center;
    margin-bottom: 8px; /* Further reduced */
}

.pwa-onboarding-step h3 {
    margin: 0 0 6px 0; /* Further reduced */
    font-size: 1.15rem; /* Further reduced */
    text-align: center;
    color: var(--text-primary);
}

.pwa-onboarding-step p {
    text-align: center;
    color: var(--text-secondary);
    margin: 0 0 12px 0; /* Further reduced */
    font-size: 0.9rem; /* Further reduced */
}

/* Benefits */
.pwa-step-benefits {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Reduced from 12px */
    margin-bottom: 20px; /* Reduced from 32px */
}

.benefit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px; /* Reduced from 12px 16px */
    background: var(--surface-secondary);
    border-radius: 10px; /* Reduced from 12px */
    font-weight: 500;
    font-size: 0.9rem; /* Added for smaller text */
    color: var(--text-primary);
}

/* Notification Options */
.pwa-notification-options {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Reduced from 16px */
    margin-bottom: 20px; /* Reduced from 32px */
}

.pwa-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px; /* Reduced from 12px */
    padding: 12px; /* Reduced from 16px */
    background: var(--surface-secondary);
    border-radius: 10px; /* Reduced from 12px */
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.pwa-checkbox:hover {
    background: var(--background);
    border-color: var(--primary);
}

.pwa-checkbox input[type="checkbox"] {
    margin-top: 2px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.pwa-checkbox span {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pwa-checkbox strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.pwa-checkbox small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Stats (Step 3) */
.pwa-step-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 32px 0;
}

.stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--surface-secondary);
    border-radius: 12px;
}

.stat-icon {
    font-size: 24px;
}

.stat-text {
    font-weight: 500;
    color: var(--text-primary);
}

/* Actions */
.pwa-step-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px; /* Reduced from 24px */
    margin-bottom: 8px; /* Add space before progress dots */
}

.pwa-step-actions button {
    flex: 1;
}

/* Progress Dots */
.pwa-onboarding-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px; /* Reduced from 20px */
    border-top: 1px solid var(--divider);
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.3s ease;
}

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

/* Responsive */
@media (min-width: 769px) {
    .pwa-onboarding-content {
        max-width: 640px;
        max-height: 90vh;
        min-height: 680px;
        display: flex;
        flex-direction: column;
    }

    .pwa-onboarding-header {
        padding: 28px 36px;
        flex-shrink: 0;
    }

    .pwa-onboarding-header h2 {
        font-size: 1.75rem;
    }

    .pwa-onboarding-steps {
        flex: 1;
        min-height: 520px;
        padding: 0;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        position: relative;
    }

    .pwa-onboarding-step {
        padding: 32px 36px;
        position: static !important;
        max-height: none;
        height: 100%;
        flex: 1;
        display: none;
        flex-direction: column;
        justify-content: flex-start;
        opacity: 1;
        transform: none;
        overflow-y: auto;
    }

    .pwa-onboarding-step.active {
        display: flex !important;
        pointer-events: all;
    }

    /* Step content wrapper to allow proper spacing */
    .pwa-onboarding-step > * {
        width: 100%;
    }

    .pwa-step-icon {
        font-size: 64px;
        margin-bottom: 20px;
    }

    .pwa-onboarding-step h3 {
        font-size: 1.625rem;
        margin-bottom: 14px;
    }

    .pwa-onboarding-step p {
        font-size: 1.0625rem;
        margin-bottom: 28px;
        line-height: 1.6;
    }

    .pwa-step-benefits {
        gap: 18px;
        margin: 28px 0;
    }

    .benefit {
        font-size: 1rem;
        padding: 14px 18px;
    }

    .pwa-step-actions {
        margin-top: auto;
        padding-top: 32px;
        gap: 16px;
    }

    .pwa-step-actions .btn-primary,
    .pwa-step-actions .btn-secondary {
        padding: 16px 32px;
        font-size: 1.0625rem;
        min-height: 52px;
    }

    .pwa-onboarding-progress {
        padding: 28px 36px;
        gap: 16px;
        flex-shrink: 0;
        border-top: 2px solid var(--divider);
    }

    .progress-dot {
        width: 12px;
        height: 12px;
    }

    .pwa-checkbox {
        padding: 16px;
        gap: 12px;
    }

    .pwa-checkbox input[type="checkbox"] {
        width: 22px;
        height: 22px;
    }

    .pwa-checkbox span strong {
        font-size: 1rem;
    }

    .pwa-checkbox span small {
        font-size: 0.875rem;
    }

    .pwa-notification-options {
        gap: 14px;
    }

    .pwa-install-instructions {
        gap: 24px;
    }

    .instruction-steps {
        gap: 16px;
    }

    .instruction-steps li {
        font-size: 1rem;
        padding: 14px 16px;
    }

    .pwa-step-stats {
        gap: 18px;
        margin: 28px 0;
    }

    .stat {
        padding: 18px 20px;
    }

    .stat-icon {
        font-size: 32px;
    }

    .stat-text {
        font-size: 1rem;
    }

    .instruction-visual {
        margin-bottom: 24px;
    }

    /* Ensure content doesn't overlap with actions */
    .pwa-onboarding-step > div:first-child {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .pwa-onboarding-content {
        max-width: none;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .pwa-onboarding-header {
        flex-shrink: 0;
        padding: 16px 20px;
        min-height: 60px;
    }

    .pwa-onboarding-header h2 {
        font-size: 1.25rem;
        line-height: 1.3;
    }

    .pwa-onboarding-steps {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        position: relative;
    }

    .pwa-onboarding-step {
        padding: 16px 20px;
        position: static !important;
        width: 100%;
        height: 100%;
        min-height: 100%;
        flex: 1 1 auto;
        display: none;
        flex-direction: column;
        opacity: 1;
        transform: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pwa-onboarding-step.active {
        display: flex !important;
    }

    /* Ensure step content grows properly */
    .pwa-onboarding-step > * {
        flex-shrink: 0;
    }

    .pwa-step-icon {
        font-size: 40px;
        margin-bottom: 12px;
    }

    .pwa-onboarding-step h3 {
        font-size: 1.25rem;
        margin-bottom: 8px;
    }

    .pwa-onboarding-step p {
        font-size: 0.9375rem;
        margin-bottom: 16px;
    }

    .pwa-step-benefits {
        gap: 10px;
        margin: 16px 0;
    }

    .benefit {
        font-size: 0.875rem;
        padding: 10px 12px;
    }

    .pwa-step-actions {
        margin-top: auto;
        padding-top: 20px;
        padding-bottom: 8px;
        gap: 12px;
        flex-shrink: 0;
    }

    .pwa-step-actions .btn-primary,
    .pwa-step-actions .btn-secondary {
        padding: 12px 20px;
        font-size: 0.9375rem;
        min-height: 44px;
    }

    .pwa-onboarding-progress {
        flex-shrink: 0;
        padding: 16px 20px;
        min-height: 56px;
        border-top: 1px solid var(--divider);
    }

    .progress-dot {
        width: 8px;
        height: 8px;
    }

    .pwa-install-floating-btn {
        bottom: 70px;
        right: 16px;
        padding: 10px 20px;
        font-size: 13px;
    }

    .pwa-install-floating-btn svg {
        width: 18px;
        height: 18px;
    }

    /* Install instructions on mobile */
    .instruction-visual {
        height: 160px;
        font-size: 3rem;
        margin-bottom: 16px;
    }

    .instruction-steps {
        gap: 10px;
    }

    .instruction-steps li {
        font-size: 0.875rem;
        padding: 10px 12px;
    }

    /* Notification checkboxes on mobile */
    .pwa-checkbox {
        padding: 10px 12px;
        gap: 10px;
    }

    .pwa-checkbox input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .pwa-checkbox span strong {
        font-size: 0.875rem;
    }

    .pwa-checkbox span small {
        font-size: 0.75rem;
    }

    /* Stats on mobile */
    .pwa-step-stats {
        gap: 12px;
        margin: 16px 0;
    }

    .stat {
        padding: 12px 14px;
    }

    .stat-icon {
        font-size: 24px;
    }

    .stat-text {
        font-size: 0.875rem;
    }
}

/* Dark mode handled by CSS variables - no media query needed */

/* ==================== INSTALL INSTRUCTIONS ==================== */

.pwa-install-instructions {
    margin: 24px 0;
}

.instruction-visual {
    width: 100%;
    height: 200px;
    background: var(--surface-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--border);
}

/* Platform-specific visuals */
.instruction-visual.ios-safari {
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-secondary) 100%);
}

.instruction-visual.ios-safari::before {
    content: '📱';
    position: absolute;
    font-size: 3rem;
    top: 50%;
    transform: translateY(-50%);
}

.instruction-visual.ios-safari::after {
    content: '⬆️ Share';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.875rem;
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 24px;
    animation: pulseAndBounce 2s infinite;
    box-shadow: 0 4px 12px rgba(0, 174, 239, 0.4);
}

.instruction-visual.ios-chrome::before {
    content: '📱';
    position: absolute;
    font-size: 3rem;
}

.instruction-visual.ios-chrome::after {
    content: '⬆️';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    background: var(--primary);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    animation: pulse 2s infinite;
}

.instruction-visual.android-chrome::before {
    content: '📱';
    position: absolute;
    font-size: 3rem;
}

.instruction-visual.android-chrome::after {
    content: '⋮';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 8px;
    animation: pulse 2s infinite;
}

.instruction-visual.android-samsung::before {
    content: '📱';
    position: absolute;
    font-size: 3rem;
}

.instruction-visual.android-samsung::after {
    content: '⭐';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    animation: pulse 2s infinite;
}

.instruction-visual.macos-safari::before {
    content: '💻';
    position: absolute;
    font-size: 3rem;
}

.instruction-visual.macos-safari::after {
    content: 'Ablage → Zum Dock';
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 0.75rem;
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    animation: pulse 2s infinite;
}

.instruction-visual.macos-chrome::before,
.instruction-visual.desktop-chrome::before {
    content: '💻';
    position: absolute;
    font-size: 3rem;
}

.instruction-visual.macos-chrome::after,
.instruction-visual.desktop-chrome::after {
    content: '⬇️';
    position: absolute;
    top: 20px;
    right: 60px;
    font-size: 2rem;
    background: var(--primary);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes pulseAndBounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0) scale(1);
        opacity: 1;
    }
    25% {
        transform: translateX(-50%) translateY(-5px) scale(1.05);
    }
    50% {
        transform: translateX(-50%) translateY(0) scale(1.1);
        opacity: 0.9;
    }
    75% {
        transform: translateX(-50%) translateY(-5px) scale(1.05);
    }
}

.instruction-steps {
    list-style: none;
    counter-reset: step-counter;
    padding: 0;
    margin: 0;
}

.instruction-steps li {
    counter-increment: step-counter;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: var(--surface-secondary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary);
    position: relative;
    padding-left: 50px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.instruction-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .instruction-visual {
        height: 160px;
        font-size: 3rem;
    }

    .instruction-steps li {
        padding: 10px 12px;
        padding-left: 44px;
        font-size: 0.85rem;
    }

    .instruction-steps li::before {
        width: 22px;
        height: 22px;
        font-size: 0.8rem;
        left: 12px;
    }
}
