/* ==========================================
   ONBOARDING OVERLAY STYLES
   ========================================== */

/* Overlay container */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000000;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.onboarding-overlay.visible {
    opacity: 1;
}

/* Main container */
.onboarding-container {
    width: 100%;
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* Skip button */
.onboarding-skip {
    position: absolute;
    top: max(env(safe-area-inset-top, 16px), 16px);
    right: 16px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.onboarding-skip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.onboarding-skip:active {
    transform: scale(0.95);
}

/* Screens container */
.onboarding-screens {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Individual screen */
.onboarding-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 24px 100px;
    box-sizing: border-box;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.onboarding-screen.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.onboarding-screen.prev {
    transform: translateX(-100%);
}

/* Content wrapper */
.onboarding-content {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Icon container */
.onboarding-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
    animation: floatIcon 3s ease-in-out infinite;
}

.onboarding-icon svg {
    width: 100%;
    height: 100%;
}

.onboarding-icon .onboarding-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 24px;
}

.onboarding-icon.icon-gift {
    animation: floatGift 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes floatGift {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.02);
    }
}

/* Title */
.onboarding-title {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.onboarding-title.credits-title {
    font-size: 32px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Subtitle */
.onboarding-subtitle {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 32px 0;
    font-weight: 400;
}

/* Feature list */
.onboarding-features {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.onboarding-feature {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-align: left;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.onboarding-feature:nth-child(1) {
    animation-delay: 0.1s;
}

.onboarding-feature:nth-child(2) {
    animation-delay: 0.2s;
}

.onboarding-feature:nth-child(3) {
    animation-delay: 0.3s;
}

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

.feature-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 102, 255, 0.15);
    border-radius: 10px;
    color: #0066FF;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feature-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.feature-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* CTA Button */
.onboarding-cta-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    background: #0066FF;
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.onboarding-cta-btn:hover:not(:disabled) {
    background: #0052CC;
    transform: translateY(-1px);
}

.onboarding-cta-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.onboarding-cta-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.onboarding-cta-btn svg {
    flex-shrink: 0;
}

/* Button spinner */
.btn-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Pagination dots */
.onboarding-pagination {
    position: absolute;
    bottom: max(env(safe-area-inset-bottom, 40px), 40px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.pagination-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-dot.active {
    width: 24px;
    background: #0066FF;
}

/* Screen 2: CTA text */
.onboarding-cta-text {
    margin-bottom: 28px;
}

.onboarding-cta-text p {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.6;
}

/* Input section */
.onboarding-input-section {
    width: 100%;
    margin-bottom: 20px;
}

.onboarding-input-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    text-align: left;
}

.onboarding-input-wrapper {
    position: relative;
    width: 100%;
}

.onboarding-input {
    width: 100%;
    padding: 16px 48px 16px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #ffffff;
    font-size: 17px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.onboarding-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: #0066FF;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.2);
}

.onboarding-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.onboarding-input-wrapper .input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

/* Input shake animation */
.onboarding-input.shake {
    animation: shake 0.5s ease;
    border-color: #ff4444;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-8px);
    }
    40%, 80% {
        transform: translateX(8px);
    }
}

/* No signup text */
.onboarding-no-signup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.onboarding-no-signup svg {
    color: #22c55e;
}

/* Generate button specific */
.onboarding-cta-btn.generate-btn {
    background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
}

.onboarding-cta-btn.generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0052CC 0%, #003d99 100%);
}

/* Responsive adjustments */
@media (max-height: 700px) {
    .onboarding-screen {
        padding-top: 50px;
        padding-bottom: 80px;
    }

    .onboarding-icon {
        width: 100px;
        height: 100px;
        margin-bottom: 16px;
    }

    .onboarding-title {
        font-size: 24px;
    }

    .onboarding-subtitle {
        font-size: 15px;
        margin-bottom: 24px;
    }

    .onboarding-features {
        gap: 8px;
        margin-bottom: 24px;
    }

    .onboarding-feature {
        padding: 12px;
    }

    .feature-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .feature-icon svg {
        width: 18px;
        height: 18px;
    }

    .feature-title {
        font-size: 14px;
    }

    .feature-desc {
        font-size: 12px;
    }

    .onboarding-cta-btn {
        padding: 14px 20px;
        font-size: 16px;
    }

    .onboarding-cta-text p {
        font-size: 15px;
    }

    .onboarding-input {
        padding: 14px 44px 14px 14px;
        font-size: 16px;
    }
}

/* iPhone SE and very small screens */
@media (max-height: 580px) {
    .onboarding-screen {
        padding-top: 40px;
        padding-bottom: 60px;
    }

    .onboarding-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 12px;
    }

    .onboarding-title {
        font-size: 22px;
    }

    .onboarding-features {
        gap: 6px;
        margin-bottom: 16px;
    }

    .onboarding-feature {
        padding: 10px;
    }

    .onboarding-pagination {
        bottom: 20px;
    }
}

/* Safe area support for notched devices */
@supports (padding-top: env(safe-area-inset-top)) {
    .onboarding-screen {
        padding-top: calc(60px + env(safe-area-inset-top, 0));
        padding-bottom: calc(100px + env(safe-area-inset-bottom, 0));
    }

    .onboarding-skip {
        top: calc(16px + env(safe-area-inset-top, 0));
    }
}
