/**
 * PWA Installation UI Styles
 * Version: 1.0.0
 */

/* ===========================
   Install Banner (Bottom)
   =========================== */

.pwa-install-banner {
    position: fixed;
    bottom: -150px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.pwa-install-banner.show {
    bottom: 0;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.pwa-install-icon img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pwa-install-text {
    flex: 1;
    min-width: 0;
}

.pwa-install-text strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: white;
}

.pwa-install-text p {
    margin: 0;
    font-size: 14px;
    opacity: 0.95;
    color: rgba(255, 255, 255, 0.95);
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-btn-install {
    background: white;
    color: #667eea;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}

.pwa-btn-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

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

.pwa-btn-dismiss {
    background: none;
    border: none;
    color: white;
    padding: 8px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.pwa-btn-dismiss:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* iOS-specific banner styling */
.pwa-install-banner-ios {
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
}

/* ===========================
   iOS Install Instructions Modal
   =========================== */

.ios-install-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.3s;
}

.ios-install-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 440px;
    width: 100%;
    position: relative;
    animation: slideUp 0.3s;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ios-install-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.ios-install-close:hover {
    background: #f0f0f0;
    color: #333;
}

.ios-install-header {
    text-align: center;
    margin-bottom: 24px;
}

.ios-install-header img {
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ios-install-header h3 {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: 700;
}

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

.ios-install-steps li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    counter-increment: step-counter;
    position: relative;
    transition: all 0.2s;
}

.ios-install-steps li:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.ios-install-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.step-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-text {
    flex: 1;
    color: #333;
    line-height: 1.6;
    font-size: 15px;
}

.step-text strong {
    color: #007AFF;
    font-weight: 600;
}

.ios-install-footer {
    margin-top: 24px;
    padding: 16px;
    background: #e3f2fd;
    border-radius: 12px;
    text-align: center;
}

.ios-install-footer p {
    margin: 0;
    color: #1976d2;
    font-weight: 500;
    font-size: 15px;
}

/* ===========================
   Install Success Notification
   =========================== */

.pwa-install-success {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #34C759 0%, #30B950 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(52, 199, 89, 0.4);
    z-index: 10001;
    transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-install-success.show {
    top: 24px;
}

.pwa-success-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
}

.pwa-success-content i {
    font-size: 20px;
}

/* ===========================
   Install Button (for settings page, etc.)
   =========================== */

.pwa-install-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pwa-install-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

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

.pwa-install-button i {
    font-size: 18px;
}

/* ===========================
   Animations
   =========================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* ===========================
   Mobile Responsiveness
   =========================== */

@media (max-width: 768px) {
    .pwa-install-content {
        flex-wrap: wrap;
        gap: 12px;
    }

    .pwa-install-icon {
        order: 1;
    }

    .pwa-install-text {
        order: 2;
        flex: 1 1 100%;
    }

    .pwa-install-actions {
        order: 3;
        width: 100%;
        justify-content: space-between;
    }

    .pwa-btn-install {
        flex: 1;
        justify-content: center;
    }

    .ios-install-content {
        padding: 24px;
        max-width: 100%;
    }

    .ios-install-header h3 {
        font-size: 20px;
    }

    .ios-install-steps li {
        padding: 12px;
    }

    .step-text {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .pwa-install-banner {
        padding: 12px 16px;
    }

    .pwa-install-text strong {
        font-size: 15px;
    }

    .pwa-install-text p {
        font-size: 13px;
    }

    .pwa-btn-install {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ===========================
   Dark Mode Support (Optional)
   =========================== */

@media (prefers-color-scheme: dark) {
    .ios-install-content {
        background: #1c1c1e;
    }

    .ios-install-header h3 {
        color: #ffffff;
    }

    .ios-install-steps li {
        background: #2c2c2e;
    }

    .ios-install-steps li:hover {
        background: #3a3a3c;
    }

    .step-text {
        color: #e5e5e7;
    }

    .ios-install-close {
        color: #8e8e93;
    }

    .ios-install-close:hover {
        background: #3a3a3c;
        color: #ffffff;
    }
}
