/**
 * Install to Home Screen Prompt Styles
 *
 * Styles for the mobile PWA installation banner and iOS instructions modal.
 */

/* ============================================
   Install Prompt Banner
   ============================================ */

.install-prompt {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999; /* Above everything */
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Ensure it appears above iOS Safari UI */
    padding-top: max(12px, env(safe-area-inset-top));
}

.install-prompt.active {
    transform: translateY(0);
}

.install-prompt-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.install-prompt-close {
    position: absolute;
    top: -8px;
    right: -8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: background 0.2s;
    flex-shrink: 0;
}

.install-prompt-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.install-prompt-close:active {
    transform: scale(0.95);
}

.install-prompt-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

.install-prompt-text {
    flex: 1;
    min-width: 0; /* Allow text to shrink */
}

.install-prompt-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 2px 0;
    line-height: 1.3;
}

.install-prompt-description {
    font-size: 12px;
    margin: 0;
    opacity: 0.9;
    line-height: 1.4;
}

.install-prompt-button {
    flex-shrink: 0;
    background: white;
    color: #6366f1;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.install-prompt-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.install-prompt-button:active {
    transform: scale(0.95);
}

/* ============================================
   iOS Installation Instructions Modal
   ============================================ */

.install-instructions-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000; /* Above install prompt */
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.install-instructions-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.install-instructions-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.install-instructions-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.install-instructions-modal.active .install-instructions-content {
    transform: translateY(0);
}

.install-instructions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.install-instructions-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.install-instructions-close {
    background: #f3f4f6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: background 0.2s;
}

.install-instructions-close:hover {
    background: #e5e7eb;
}

.install-instructions-close:active {
    transform: scale(0.95);
}

.install-instructions-body {
    color: #374151;
}

.install-instructions-intro {
    font-size: 15px;
    margin-bottom: 16px;
    color: #4b5563;
}

.install-instructions-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.install-instructions-steps li {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: #6366f1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.step-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.inline-icon {
    color: #6366f1;
    vertical-align: middle;
}

.install-instructions-footer {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    padding: 16px;
    background: #f0fdf4;
    border-radius: 8px;
    margin: 0;
    border: 1px solid #bbf7d0;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 375px) {
    .install-prompt-title {
        font-size: 13px;
    }

    .install-prompt-description {
        font-size: 11px;
    }

    .install-prompt-button {
        padding: 6px 16px;
        font-size: 13px;
    }
}

/* Hide on desktop */
@media (min-width: 769px) {
    .install-prompt {
        display: none !important;
    }
}
