/* PWA Styles dla Portalu Kierowców */

/* PWA Install Button - Orange gradient PWA button */
.app-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: var(--btn-padding-md) /* 12px 24px - Shape & Sizing System v5.0 */;
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    color: white;
    text-decoration: none;
    border-radius: 4px; /* Custom - extra large pill shape */
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.app-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    color: white;
    text-decoration: none;
}

.app-btn i {
    font-size: 1.2rem;
}

/* Secondary button style for uninstall */
.app-btn-secondary {
    background: linear-gradient(45deg, #666666, #888888);
    box-shadow: 0 4px 15px rgba(102, 102, 102, 0.3);
}

.app-btn-secondary:hover {
    box-shadow: 0 8px 25px rgba(102, 102, 102, 0.4);
}

/* PWA Features - Info badges */
.pwa-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 0 1rem;
}

.pwa-feature {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px; /* Custom - large pill shape */
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
}

/* Light mode - ciemny tekst dla lepszej widoczności */
html:not([data-theme="dark"]) .pwa-feature {
    color: #333333;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.pwa-feature i {
    font-size: 1rem;
    color: #ff6b35;
}

.pwa-feature:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3);
}

.pwa-feature:active {
    transform: translateY(-1px);
}

/* PWA Info Modal */
.pwa-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pwa-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    animation: fadeIn 0.3s ease;
}

.pwa-modal-content {
    background: var(--bg-page, #ffffff);
    color: var(--text-primary, #333333);
    margin: 20px;
    padding: 2.5rem;
    border-radius: 20px; /* Custom - pill shape */
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.3s ease;
    text-align: center;
}

.pwa-modal-large {
    max-width: 650px;
    max-height: 80vh;
    overflow-y: auto;
}

.pwa-modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: #999999;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.pwa-modal-close:hover {
    color: #ff6b35;
}

.pwa-modal-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.pwa-modal-content h3 {
    color: var(--text-primary, #333333);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.pwa-modal-content p {
    color: var(--text-secondary, #666666);
    line-height: 1.6;
    font-size: 1rem;
}

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

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

/* Uninstall Guide Styles */
.uninstall-warning {
    text-align: center;
    margin: 0 0 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(255, 193, 7, 0.15));
    border: 2px solid #ff9800;
    border-radius: var(--radius-card); /* 12px - Shape & Sizing System v4.0 */
    font-size: 1rem;
    line-height: 1.8;
}

.uninstall-warning strong {
    font-size: 1.2rem;
    color: #e65100;
}

.uninstall-section {
    text-align: left;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(255, 107, 53, 0.05);
    border-left: 4px solid #ff6b35;
    border-radius: var(--radius-button); /* 8px - Shape & Sizing System v4.0 */
}

.uninstall-section code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: var(--radius-sm); /* 4px - Shape & Sizing System v4.0 */
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.uninstall-section h4 {
    color: var(--text-primary, #333333);
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
}

.uninstall-section ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.uninstall-section li {
    margin: 0.75rem 0;
    line-height: 1.6;
}

.uninstall-tip {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 6px; /* Custom - pomiędzy sm (4px) a button (8px) */
    font-size: 0.9rem;
    color: var(--text-secondary, #666666);
}

.uninstall-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(33, 150, 243, 0.1);
    border-radius: var(--radius-button); /* 8px - Shape & Sizing System v4.0 */
    font-size: 0.95rem;
    text-align: center;
    color: var(--text-secondary, #666666);
}

.uninstall-other {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.uninstall-other summary {
    cursor: pointer;
    padding: 0.75rem;
    color: #ff6b35;
    text-align: center;
}

.uninstall-other summary:hover {
    opacity: 0.8;
}

.pwa-feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ff6b35;
}

.pwa-feature h3 {
    color: #ffffff;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.pwa-feature p {
    color: #cccccc;
    line-height: 1.6;
}

/* PWA Status Indicator */
.pwa-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: var(--input-padding) /* 10px 15px - Shape & Sizing System v5.0 */;
    border-radius: 25px; /* Custom - large pill shape */
    font-size: 0.9rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pwa-status.online {
    background: rgba(76, 175, 80, 0.9);
}

.pwa-status.offline {
    background: rgba(244, 67, 54, 0.9);
}

.pwa-status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full); /* 50% - Shape & Sizing System v4.0 */
    margin-right: 8px;
    animation: pulse 2s infinite;
}

.pwa-status.online .pwa-status-indicator {
    background: #4CAF50;
}

.pwa-status.offline .pwa-status-indicator {
    background: #f44336;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* PWA Install Prompt */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    color: white;
    padding: 1rem;
    border-radius: 15px; /* Custom - soft rounded */
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
    z-index: 1000;
    display: none;
    animation: slideUp 0.3s ease;
}

.pwa-install-prompt.show {
    display: block;
}

.pwa-install-prompt-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pwa-install-prompt-icon {
    font-size: 2rem;
}

.pwa-install-prompt-text {
    flex: 1;
}

.pwa-install-prompt-text h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.pwa-install-prompt-text p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.pwa-install-prompt-actions {
    display: flex;
    gap: 0.5rem;
}

.pwa-install-prompt-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: var(--btn-padding-sm) /* 8px 16px - Shape & Sizing System v5.0 */;
    border-radius: 20px; /* Custom - pill shape */
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

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

.pwa-install-prompt-btn.primary {
    background: rgba(255, 255, 255, 0.9);
    color: #ff6b35;
    font-weight: 600;
}

.pwa-install-prompt-btn.primary:hover {
    background: white;
}

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

/* PWA Standalone Mode */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .custom-navbar {
        padding-top: env(safe-area-inset-top);
    }
    
    /* Ukryj elementy niepotrzebne w PWA */
    .pwa-install-prompt {
        display: none;
    }
    
    .app-btn[onclick="installPWA()"] {
        display: none;
    }
}

/* PWA Loading States */
.pwa-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full); /* 50% - Shape & Sizing System v4.0 */
    border-top-color: #ff6b35;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* PWA Offline Indicator */
.pwa-offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #f44336;
    color: white;
    text-align: center;
    padding: var(--input-padding-y); /* 10px - Shape & Sizing System v4.0 */
    z-index: 1001;
    font-weight: 600;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.pwa-offline-indicator.show {
    transform: translateY(0);
}

/* PWA Update Available */
.pwa-update-available {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: #2196F3;
    color: white;
    padding: 1rem;
    border-radius: 10px; /* Custom - pomiędzy button (8px) a card (12px) */
    z-index: 1000;
    display: none;
    animation: slideUp 0.3s ease;
}

.pwa-update-available.show {
    display: block;
}

.pwa-update-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pwa-update-text {
    flex: 1;
}

.pwa-update-actions {
    display: flex;
    gap: 0.5rem;
}

.pwa-update-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: var(--btn-padding-sm) /* 8px 16px - Shape & Sizing System v5.0 */;
    border-radius: 20px; /* Custom - pill shape */
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.pwa-update-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive PWA */
@media (max-width: 768px) {
    .cta-title {
        font-size: 2rem;
    }
    
    .cta-text {
        font-size: 1rem;
    }
    
    .app-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .app-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .pwa-features {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 2rem 0;
        padding: 0 1rem;
    }
    
    .pwa-feature {
        padding: 1.5rem;
    }
    
    .pwa-install-prompt {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
    
    .pwa-install-prompt-content {
        flex-direction: column;
        text-align: center;
    }
    
    .pwa-install-prompt-actions {
        width: 100%;
        justify-content: center;
    }
}

/* PWA Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .pwa-feature {
        background: rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* PWA High Contrast Mode */
@media (prefers-contrast: high) {
    .app-btn {
        border: 2px solid white;
    }
    
    .pwa-feature {
        border: 2px solid #ff6b35;
    }
}

/* PWA Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .app-btn,
    .pwa-feature,
    .pwa-status-indicator {
        animation: none;
        transition: none;
    }
}



