/* =========================================
   iOS Install Guide Modal
   ========================================= */

/* Hidden state - must be hidden by default */
.ios-guide-modal.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Visible state - explicitly show when not hidden */
.ios-guide-modal:not(.hidden) {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.ios-guide-modal {
    /* Override base .modal to ensure proper positioning */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    justify-content: flex-end !important;
    /* Align to bottom for better reachability */
    padding-bottom: env(safe-area-inset-bottom, 20px);
    z-index: 99999 !important;
    /* Higher than mode-selection-screen (9999) */
}

.ios-guide-content {
    background: rgba(255, 255, 255, 0.95);
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin-bottom: 80px;
    /* Space for the arrow */
    position: relative;
    animation: slideUpIOS 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpIOS {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header */
.ios-guide-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.ios-app-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-right: 16px;
}

.ios-header-text h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: #1c1c1e;
}

.ios-header-text p {
    margin: 0;
    font-size: 14px;
    color: #8e8e93;
}

.ios-close-btn {
    margin-left: auto;
    background: #e5e5ea;
    border: none;
    color: #8e8e93;
    font-weight: 600;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 14px;
    cursor: pointer;
}

/* Steps */
.ios-guide-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ios-step {
    display: flex;
    align-items: center;
}

.step-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #007aff;
    /* iOS Blue */
    margin-right: 16px;
    flex-shrink: 0;
}

/* Specific icon styles to match iOS */
.ios-step:nth-child(1) .step-icon {
    font-size: 22px;
}

.ios-step:nth-child(3) .step-icon {
    font-size: 24px;
}

.ios-step:nth-child(5) .step-icon {
    font-size: 16px;
    font-weight: 700;
    color: #007aff;
}

.step-text {
    font-size: 15px;
    color: #1c1c1e;
    line-height: 1.4;
}

.ios-step-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.05);
    margin-left: 56px;
    /* Align with text */
}

/* Animated Arrow */
.ios-guide-arrow {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: bounceIOS 2s infinite;
}

.ios-guide-arrow i {
    font-size: 24px;
    margin-bottom: 4px;
}

@keyframes bounceIOS {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}