/**
 * PWA Install Styles
 * Estilos para banner e modal de instalação PWA
 */

/* ========================================
   PWA Install Banner (Chrome/Android/Desktop)
   ======================================== */

.pwa-install-banner {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    padding: 16px;
    z-index: 9999;
    transition: bottom 0.3s ease;
}

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

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

.pwa-banner-icon {
    flex-shrink: 0;
}

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

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

.pwa-banner-text strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.pwa-banner-text p {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
}

.pwa-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Responsivo - Mobile */
@media (max-width: 640px) {
    .pwa-banner-content {
        flex-wrap: wrap;
    }

    .pwa-banner-icon img {
        width: 48px;
        height: 48px;
    }

    .pwa-banner-actions {
        width: 100%;
        margin-top: 8px;
    }

    .pwa-banner-actions .btn {
        flex: 1;
    }
}

/* ========================================
   PWA iOS Instructions Modal
   ======================================== */

.pwa-ios-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    z-index: 99999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pwa-ios-modal.show {
    opacity: 1;
    visibility: visible !important;
}

.pwa-ios-modal .modal-dialog {
    max-width: 480px;
    max-height: 75vh;
    overflow-y: auto;
    margin: 20px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border-radius: 12px;
}

.pwa-ios-modal.show .modal-dialog {
    transform: scale(1);
}

.pwa-ios-modal .modal-body {
    padding: 20px;
    padding-bottom: 24px;
}

.pwa-ios-instructions {
    text-align: center;
}

.pwa-ios-icon {
    margin: 0 auto 24px;
}

.pwa-ios-icon img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pwa-ios-intro {
    font-size: 15px;
    color: var(--color-text-secondary);
    margin-bottom: 24px;
}

/* Steps */
.pwa-ios-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
    text-align: left;
}

.pwa-ios-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.pwa-step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.pwa-step-content {
    flex: 1;
}

.pwa-step-content strong {
    display: block;
    font-size: 15px;
    color: var(--color-text);
    margin-bottom: 8px;
}

.pwa-step-content small {
    display: block;
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* Share Icon */
.pwa-share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--color-bg-tertiary);
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    color: var(--color-primary);
    font-size: 20px;
    margin: 8px 0;
}

/* Action Box */
.pwa-action-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--color-bg-tertiary);
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    color: var(--color-primary);
    font-weight: 500;
    margin: 8px 0;
}

.pwa-action-box i {
    font-size: 18px;
}

/* Benefits */
.pwa-ios-benefits {
    background: var(--color-bg-tertiary);
    border-radius: 8px;
    padding: 16px;
    text-align: left;
}

.pwa-ios-benefits strong {
    display: block;
    font-size: 14px;
    color: var(--color-text);
    margin-bottom: 12px;
}

.pwa-ios-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pwa-ios-benefits li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.pwa-ios-benefits li:last-child {
    margin-bottom: 0;
}

.pwa-ios-benefits li i {
    color: var(--color-success);
    font-size: 16px;
}

/* ========================================
   Light Mode Specific (Default)
   ======================================== */

body:not(.dark-mode) .pwa-install-banner {
    background: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}

body:not(.dark-mode) .pwa-banner-text strong {
    color: #1f2937;
}

body:not(.dark-mode) .pwa-banner-text p {
    color: #6b7280;
}

body:not(.dark-mode) .pwa-share-icon {
    background: #f3f4f6;
    border-color: #002947;
    color: #002947;
}

body:not(.dark-mode) .pwa-action-box {
    background: #f3f4f6;
    border-color: #002947;
    color: #002947;
}

body:not(.dark-mode) .pwa-ios-benefits {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

body:not(.dark-mode) .pwa-ios-benefits strong {
    color: #1f2937;
}

body:not(.dark-mode) .pwa-ios-benefits li {
    color: #6b7280;
}

body:not(.dark-mode) .pwa-step-content strong {
    color: #1f2937;
}

body:not(.dark-mode) .pwa-step-content small {
    color: #6b7280;
}

body:not(.dark-mode) .pwa-ios-intro {
    color: #6b7280;
}

body:not(.dark-mode) .modal-overlay.pwa-ios-modal {
    background: rgba(0, 0, 0, 0.5);
}

body:not(.dark-mode) .pwa-ios-modal .modal-content {
    background: white;
}

body:not(.dark-mode) .pwa-ios-modal .modal-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

body:not(.dark-mode) .pwa-ios-modal .modal-header h3 {
    color: #1f2937;
}

body:not(.dark-mode) .pwa-ios-modal .modal-footer {
    background: white;
    border-top: 1px solid #e5e7eb;
}

/* ========================================
   Dark Mode Specific Adjustments
   ======================================== */

body.dark-mode .pwa-install-banner {
    background: #1e1e1e;
    border-top-color: #3d3d3d;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .pwa-banner-text strong {
    color: #e4e4e7;
}

body.dark-mode .pwa-banner-text p {
    color: #e4e4e7;
}

body.dark-mode .pwa-banner-icon img {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark-mode .pwa-ios-icon img {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .pwa-share-icon {
    background: #1e1e1e;
    border-color: #3d3d3d;
    color: #e4e4e7;
}

body.dark-mode .pwa-action-box {
    background: #1e1e1e;
    border-color: #3d3d3d;
    color: #e4e4e7;
}

body.dark-mode .pwa-ios-benefits {
    background: #121212;
    border: 1px solid #3d3d3d;
}

body.dark-mode .pwa-ios-benefits strong {
    color: #e4e4e7;
}

body.dark-mode .pwa-ios-benefits li {
    color: #e4e4e7;
}

body.dark-mode .pwa-step-content strong {
    color: #e4e4e7 !important;
}

body.dark-mode .pwa-step-content small {
    color: #e4e4e7 !important;
}

body.dark-mode .pwa-ios-intro {
    color: #e4e4e7 !important;
}

body.dark-mode .modal-overlay.pwa-ios-modal {
    background: rgba(0, 0, 0, 0.8);
}

body.dark-mode .pwa-ios-modal .modal-content {
    background: #121212;
    border: 1px solid #3d3d3d;
}

body.dark-mode .pwa-ios-modal .modal-header {
    background: #121212;
    border-bottom: 1px solid #3d3d3d;
}

body.dark-mode .pwa-ios-modal .modal-header h3 {
    color: #e4e4e7 !important;
}

body.dark-mode .pwa-ios-modal .modal-header .modal-close {
    color: #e4e4e7;
}

body.dark-mode .pwa-ios-modal .modal-body {
    background: #121212;
}

body.dark-mode .pwa-ios-modal .modal-footer {
    background: #121212;
    border-top: 1px solid #3d3d3d;
}

body.dark-mode .pwa-ios-modal .modal-footer .btn {
    color: #e4e4e7;
}

body.dark-mode .pwa-step-number {
    background: #002947;
    color: white;
}

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

@media (max-width: 640px) {
    .pwa-ios-modal .modal-dialog {
        max-width: calc(100% - 32px) !important;
        max-height: 85vh !important;
        margin: 16px;
    }

    .pwa-ios-modal .modal-body {
        padding: 20px;
        padding-bottom: 24px;
    }

    .pwa-ios-icon img {
        width: 64px;
        height: 64px;
    }

    .pwa-ios-intro {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .pwa-ios-steps {
        gap: 16px;
        margin-bottom: 20px;
    }

    .pwa-step-number {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .pwa-step-content strong {
        font-size: 14px;
    }

    .pwa-step-content small {
        font-size: 12px;
    }

    .pwa-share-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .pwa-action-box {
        font-size: 14px;
        padding: 8px 12px;
    }

    .pwa-ios-benefits {
        padding: 12px;
    }

    .pwa-ios-benefits strong,
    .pwa-ios-benefits li {
        font-size: 13px;
    }

    .pwa-ios-modal .modal-footer {
        flex-direction: column;
        gap: 8px;
        padding: 16px 20px;
    }

    .pwa-ios-modal .modal-footer .btn {
        width: 100%;
    }
}

/* Tablet (iPad) */
@media (min-width: 641px) and (max-width: 1024px) {
    .pwa-ios-modal .modal-dialog {
        max-width: 540px;
        max-height: 80vh;
    }

    .pwa-ios-modal .modal-body {
        padding: 24px;
        padding-bottom: 28px;
    }
}

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

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

@keyframes fadeInScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.pwa-install-banner.show {
    animation: slideUp 0.3s ease;
}

.pwa-ios-modal.show .modal-dialog {
    animation: fadeInScale 0.3s ease;
}
