/**
 * Install Prompt Banner Styles
 * Styles for Android and iOS PWA installation prompts
 */

/* ===== Install Prompt Container ===== */
.install-prompt-banner,
.install-prompt-ios {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 970;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-bottom: 3px solid #0d6efd;
}

.install-prompt-banner.visible,
.install-prompt-ios.visible {
    opacity: 1;
    visibility: visible;
}

/* Adjust for navbar */
.install-prompt-banner {
    top: 70px;
}

@media (max-width: 768px) {
    .install-prompt-banner {
        top: 60px;
        padding: 0.75rem;
    }
}

/* ===== Banner Content ===== */
.install-prompt-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 576px) {
    .install-prompt-content {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== Banner Text ===== */
.install-prompt-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.install-prompt-title {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.install-prompt-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0;
}

@media (max-width: 576px) {
    .install-prompt-title {
        font-size: 0.95rem;
    }

    .install-prompt-description {
        font-size: 0.85rem;
    }
}

/* ===== Banner Actions ===== */
.install-prompt-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

@media (max-width: 576px) {
    .install-prompt-actions {
        width: 100%;
        gap: 0.5rem;
    }

    .install-prompt-actions .btn {
        flex: 1;
        min-width: 120px;
        font-size: 0.85rem;
    }
}

/* ===== Install Button ===== */
.btn-install {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 0.95rem;
}

.btn-install:hover {
    background-color: #0b5ed7;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
}

.btn-install:active {
    transform: scale(0.98);
}

.btn-install i {
    font-size: 1rem;
}

@media (max-width: 576px) {
    .btn-install {
        flex: 1;
        justify-content: center;
        padding: 0.5rem 1rem;
    }
}

/* ===== Dismiss Button ===== */
.btn-dismiss-install {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #e9ecef;
    color: #6c757d;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 0.95rem;
}

.btn-dismiss-install:hover {
    background-color: #dee2e6;
    color: #495057;
}

.btn-dismiss-install:active {
    transform: scale(0.98);
}

@media (max-width: 576px) {
    .btn-dismiss-install {
        flex: 1;
        padding: 0.5rem;
        font-size: 0.85rem;
    }
}

/* ===== iOS Specific Prompt ===== */
.install-prompt-ios {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    border-bottom-color: #0b5ed7;
    top: 70px;
}

.install-prompt-ios .install-prompt-text {
    color: white;
}

.install-prompt-ios .install-prompt-title {
    color: white;
    font-size: 1.05rem;
}

.install-prompt-ios .install-prompt-description {
    color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 768px) {
    .install-prompt-ios {
        top: 60px;
    }
}

/* ===== iOS Instructions Steps ===== */
.ios-install-steps {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 0.375rem;
    color: white;
    font-size: 0.9rem;
    line-height: 1.5;
}

.ios-install-steps ol {
    margin: 0;
    padding-left: 1.25rem;
}

.ios-install-steps li {
    margin-bottom: 0.25rem;
}

.ios-install-steps strong {
    color: #fff;
}

/* ===== iOS Dismiss Button ===== */
.install-prompt-ios .btn-dismiss-install {
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.install-prompt-ios .btn-dismiss-install:hover {
    background-color: rgba(255, 255, 255, 0.35);
}

/* ===== Animation ===== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.install-prompt-banner.visible,
.install-prompt-ios.visible {
    animation: slideDown 0.3s ease;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 992px) {
    .install-prompt-content {
        gap: 0.75rem;
    }

    .install-prompt-actions {
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    .install-prompt-banner,
    .install-prompt-ios {
        padding: 0.5rem;
    }

    .install-prompt-content {
        gap: 0.5rem;
    }

    .ios-install-steps {
        margin-top: 0.5rem;
        padding: 0.5rem;
        font-size: 0.85rem;
    }
}

/* ===== RTL Support ===== */
[dir="rtl"] .install-prompt-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .install-prompt-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .ios-install-steps ol {
    padding-left: 0;
    padding-right: 1.25rem;
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    .install-prompt-banner,
    .install-prompt-ios {
        transition: none;
    }

    .install-prompt-banner.visible,
    .install-prompt-ios.visible {
        animation: none;
    }
}

/* Focus states for keyboard navigation */
.btn-install:focus,
.btn-dismiss-install:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.install-prompt-ios .btn-dismiss-install:focus {
    outline-color: white;
}

/* ===== Print Styles ===== */
@media print {
    .install-prompt-banner,
    .install-prompt-ios {
        display: none !important;
    }
}

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark) {
    .install-prompt-banner {
        background: #343a40;
        border-bottom-color: #0d6efd;
    }

    .install-prompt-title {
        color: #f8f9fa;
    }

    .install-prompt-description {
        color: #adb5bd;
    }

    .btn-dismiss-install {
        background-color: #495057;
        color: #f8f9fa;
        border-color: #495057;
    }

    .btn-dismiss-install:hover {
        background-color: #5a6268;
        color: #f8f9fa;
    }

    .ios-install-steps {
        background-color: rgba(0, 0, 0, 0.3);
        color: #f8f9fa;
    }
}
