/* WP QuickPWA Frontend Styles */

/* Install Prompt */
.wpqp-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 400px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 999999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.wpqp-install-prompt.wpqp-show {
    transform: translateY(0);
    opacity: 1;
}

.wpqp-prompt-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.wpqp-prompt-icon {
    flex-shrink: 0;
}

.wpqp-prompt-icon img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.wpqp-prompt-text {
    flex: 1;
    min-width: 0;
}

.wpqp-prompt-text h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.wpqp-prompt-text p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.wpqp-prompt-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.wpqp-install-button,
.wpqp-dismiss-button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    text-align: center;
}

.wpqp-install-button {
    background: #007cba;
    color: #fff;
}

.wpqp-install-button:hover {
    background: #005a87;
}

.wpqp-dismiss-button {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
}

.wpqp-dismiss-button:hover {
    background: #f5f5f5;
    color: #333;
}

/* iOS Instructions */
.wpqp-ios-instructions {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.wpqp-ios-instructions.wpqp-show {
    opacity: 1;
    visibility: visible;
}

.wpqp-instructions-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wpqp-instructions-content {
    background: #fff;
    border-radius: 12px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.wpqp-instructions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.wpqp-instructions-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.wpqp-close-instructions {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.wpqp-close-instructions:hover {
    background: #f5f5f5;
    color: #333;
}

.wpqp-instructions-body {
    padding: 0 20px 20px 20px;
}

.wpqp-instructions-body p {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.wpqp-instructions-body ol {
    margin: 0;
    padding-left: 20px;
    color: #333;
}

.wpqp-instructions-body li {
    margin: 12px 0;
    font-size: 16px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpqp-share-icon,
.wpqp-add-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #007cba;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Offline Indicator */
.wpqp-offline-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    z-index: 999999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: wpqp-slide-down 0.3s ease;
}

.wpqp-offline-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpqp-offline-icon {
    font-size: 16px;
}

@keyframes wpqp-slide-down {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* PWA Specific Styles */
@media (display-mode: standalone) {
    /* Styles when app is installed and running in standalone mode */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    /* Hide install prompt when in standalone mode */
    .wpqp-install-prompt {
        display: none !important;
    }
}

/* iOS Safari specific styles */
@supports (-webkit-touch-callout: none) {
    .wpqp-install-prompt {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .wpqp-offline-indicator {
        top: calc(20px + env(safe-area-inset-top));
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .wpqp-install-prompt {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
    
    .wpqp-prompt-content {
        padding: 12px;
        gap: 10px;
    }
    
    .wpqp-prompt-icon img {
        width: 40px;
        height: 40px;
    }
    
    .wpqp-prompt-text h3 {
        font-size: 15px;
    }
    
    .wpqp-prompt-text p {
        font-size: 13px;
    }
    
    .wpqp-prompt-actions {
        gap: 6px;
    }
    
    .wpqp-install-button,
    .wpqp-dismiss-button {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 70px;
    }
    
    .wpqp-instructions-overlay {
        padding: 10px;
    }
    
    .wpqp-instructions-content {
        border-radius: 8px;
    }
    
    .wpqp-instructions-header {
        padding: 15px 15px 0 15px;
        margin-bottom: 15px;
    }
    
    .wpqp-instructions-header h3 {
        font-size: 16px;
    }
    
    .wpqp-instructions-body {
        padding: 0 15px 15px 15px;
    }
    
    .wpqp-instructions-body p,
    .wpqp-instructions-body li {
        font-size: 14px;
    }
    
    .wpqp-offline-indicator {
        left: 10px;
        right: 10px;
        transform: none;
        text-align: center;
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wpqp-install-prompt {
        border: 2px solid #000;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }
    
    .wpqp-install-button {
        border: 2px solid #000;
    }
    
    .wpqp-dismiss-button {
        border: 2px solid #666;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .wpqp-install-prompt,
    .wpqp-ios-instructions,
    .wpqp-install-button,
    .wpqp-dismiss-button,
    .wpqp-close-instructions {
        transition: none;
    }
    
    .wpqp-offline-indicator {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wpqp-install-prompt {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .wpqp-prompt-text h3 {
        color: #e0e0e0;
    }
    
    .wpqp-prompt-text p {
        color: #b0b0b0;
    }
    
    .wpqp-dismiss-button {
        color: #b0b0b0;
        border-color: #555;
    }
    
    .wpqp-dismiss-button:hover {
        background: #3a3a3a;
        color: #e0e0e0;
    }
    
    .wpqp-instructions-content {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    .wpqp-instructions-header {
        border-bottom-color: #444;
    }
    
    .wpqp-instructions-header h3 {
        color: #e0e0e0;
    }
    
    .wpqp-close-instructions {
        color: #b0b0b0;
    }
    
    .wpqp-close-instructions:hover {
        background: #3a3a3a;
        color: #e0e0e0;
    }
    
    .wpqp-instructions-body p,
    .wpqp-instructions-body li {
        color: #e0e0e0;
    }
}

/* Print styles */
@media print {
    .wpqp-install-prompt,
    .wpqp-ios-instructions,
    .wpqp-offline-indicator {
        display: none !important;
    }
}

