/* ==========================================================================
   iOS PWA Installation & Add to Home Screen Modal Styles
   ========================================================================== */

/* Floating Install Pill (for mobile browsers) */
.ios-install-float-btn {
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 99990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #ff5fa8 0%, #8b5cf6 100%);
    color: #ffffff !important;
    font-family: 'Mitr', 'Sarabun', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 235, 180, 0.6);
    box-shadow: 0 6px 20px rgba(255, 95, 168, 0.5), 0 0 15px rgba(139, 92, 246, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: iosFloatPulse 3s ease-in-out infinite;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

@keyframes iosFloatPulse {
    0%, 100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 6px 20px rgba(255, 95, 168, 0.5);
    }
    50% {
        transform: translateY(-4px) scale(1.03);
        box-shadow: 0 10px 28px rgba(255, 95, 168, 0.7);
    }
}

.ios-install-float-btn:hover {
    transform: translateY(-2px) scale(1.04);
}

.ios-install-float-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Modal Overlay */
.ios-install-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 6, 18, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 100000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

@media (min-width: 600px) {
    .ios-install-overlay {
        align-items: center;
        padding: 20px;
    }
}

.ios-install-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Bottom Sheet / Modal Dialog */
.ios-install-sheet {
    width: 100%;
    max-width: 500px;
    background: linear-gradient(180deg, #260e29 0%, #17071a 100%);
    border: 1.5px solid rgba(255, 143, 192, 0.35);
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 95, 168, 0.2);
    padding: 28px 24px 32px 24px;
    color: #ffe4f0;
    font-family: 'Sarabun', sans-serif;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
}

@media (min-width: 600px) {
    .ios-install-sheet {
        border-radius: 28px;
        transform: translateY(20px) scale(0.95);
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .ios-install-overlay.show .ios-install-sheet {
        transform: translateY(0) scale(1);
    }
}

.ios-install-overlay.show .ios-install-sheet {
    transform: translateY(0);
}

/* Grab handle for bottom sheet on iOS */
.ios-sheet-handle {
    width: 44px;
    height: 5px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    margin: 0 auto 18px auto;
}

/* App Header in Modal */
.ios-app-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.ios-app-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: radial-gradient(circle, #ff5fa8 0%, #3d1428 100%);
    border: 2px solid #f6d27a;
    box-shadow: 0 4px 18px rgba(246, 210, 122, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.ios-app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ios-app-info h3 {
    font-family: 'Mitr', sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 4px 0;
}

.ios-app-info p {
    font-size: 13.5px;
    color: #e4b8cc;
    margin: 0;
}

/* Steps List */
.ios-steps-container {
    background: rgba(45, 17, 45, 0.65);
    border: 1px solid rgba(255, 143, 192, 0.25);
    border-radius: 20px;
    padding: 16px 18px;
    margin-bottom: 22px;
}

.ios-step-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 10px 0;
}

.ios-step-item:not(:last-child) {
    border-bottom: 1px dashed rgba(255, 143, 192, 0.18);
}

.ios-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff5fa8, #8b5cf6);
    color: #ffffff;
    font-family: 'Mitr', sans-serif;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 95, 168, 0.4);
}

.ios-step-content {
    font-size: 14.5px;
    line-height: 1.6;
    color: #fce7f3;
}

.ios-step-content strong {
    color: #ffffff;
}

.ios-step-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 1px 7px;
    font-size: 14px;
    margin: 0 3px;
    vertical-align: middle;
}

/* Modal Action Buttons */
.ios-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ios-btn-share-trigger {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ff5fa8 0%, #d63384 100%);
    color: #ffffff;
    border: 1.5px solid rgba(255, 235, 180, 0.5);
    border-radius: 16px;
    font-family: 'Mitr', sans-serif;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(255, 95, 168, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.ios-btn-share-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 95, 168, 0.65);
}

.ios-btn-close {
    width: 100%;
    padding: 11px;
    background: transparent;
    color: #c490aa;
    border: none;
    font-family: 'Sarabun', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.ios-btn-close:hover {
    color: #ffffff;
}
