/* PWA Installation and Update Styles */

.pwa-install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2c5530 0%, #3e6b3e 100%);
    color: white;
    z-index: 10000;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease-out;
}

.install-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 15px;
}

.install-icon img {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.install-text h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
}

.install-text p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.install-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-install {
    background: white;
    color: #2c5530;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-install:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-dismiss {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-dismiss:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.pwa-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    animation: slideInRight 0.3s ease-out;
}

.success-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.pwa-update-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    animation: fadeIn 0.3s ease-out;
}

.update-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease-out;
}

.update-icon {
    background: linear-gradient(135deg, #2c5530 0%, #3e6b3e 100%);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
}

.update-content h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 22px;
}

.update-content p {
    margin: 0 0 25px 0;
    color: #666;
    line-height: 1.5;
}

.btn-update {
    background: linear-gradient(135deg, #2c5530 0%, #3e6b3e 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.btn-update:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 85, 48, 0.3);
}

/* Desktop PWA Enhancements */
@media (display-mode: standalone) {
    /* Hide browser-specific elements when installed */
    .browser-only {
        display: none !important;
    }
    
    /* Add app-specific styling */
    body {
        padding-top: 0 !important; /* Remove any browser padding */
    }
    
    /* Desktop window controls overlay support */
    .title-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 32px;
        background: #2c5530;
        z-index: 9999;
        -webkit-app-region: drag;
    }
    
    .title-bar .controls {
        -webkit-app-region: no-drag;
    }
}

/* Desktop-specific features */
@media (min-width: 768px) and (display-mode: standalone) {
    .pwa-install-banner {
        padding: 20px;
    }
    
    .install-content {
        padding: 0 20px;
    }
    
    .install-text h4 {
        font-size: 18px;
    }
    
    .install-text p {
        font-size: 16px;
    }
}

/* Mobile responsiveness */
@media (max-width: 767px) {
    .install-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .install-buttons {
        justify-content: center;
        width: 100%;
    }
    
    .btn-install {
        flex: 1;
        max-width: 200px;
    }
    
    .update-content {
        margin: 20px;
        padding: 25px 20px;
    }
}

/* Animations */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

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

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* PWA Quick Actions Bar (Widget-like) */
.pwa-quick-actions {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: none; /* Show only for standalone PWA */
}

@media (display-mode: standalone) {
    .pwa-quick-actions {
        display: block;
    }
}

.quick-actions-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #2c5530 0%, #3e6b3e 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(44, 85, 48, 0.3);
}

.quick-action i {
    font-size: 14px;
}

.quick-action span {
    font-size: 11px;
}

/* Horizontal layout for larger screens */
@media (min-width: 768px) {
    .quick-actions-container {
        flex-direction: row;
    }
    
    .quick-action {
        flex-direction: column;
        padding: 12px 8px;
        min-width: 60px;
    }
    
    .quick-action i {
        font-size: 16px;
        margin-bottom: 4px;
    }
}

/* Loading indicators for sync */
.sync-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #2c5530;
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 10000;
    animation: slideInLeft 0.3s ease-out;
}

.sync-indicator.syncing::before {
    content: "⟳ ";
    animation: spin 1s linear infinite;
    display: inline-block;
}

.sync-indicator.success {
    background: #28a745;
}

.sync-indicator.success::before {
    content: "✓ ";
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* PWA Aggressive Install Modal */
.pwa-aggressive-install {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.install-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.install-modal {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.4s ease-out;
}

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

.install-header img {
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.install-steps h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    text-align: center;
    font-size: 24px;
}

.install-subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 25px;
    font-size: 16px;
}

.install-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
    color: #333;
    font-size: 14px;
    text-align: center;
}

.steps-container {
    margin: 25px 0;
}

.step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #4CAF50;
}

.step-number {
    background: #4CAF50;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-right: 15px;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
    line-height: 1.5;
    color: #2c3e50;
}

.install-benefits {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.install-benefits h4 {
    color: #1976d2;
    margin-bottom: 15px;
    font-size: 18px;
}

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

.install-benefits li {
    padding: 8px 0;
    color: #1565c0;
    font-weight: 500;
}

.install-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 25px 0;
}

.btn-auto-install {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-auto-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-manual-install {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.btn-manual-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.btn-remind-later {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #ddd;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-remind-later:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.install-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.install-footer small {
    color: #7f8c8d;
    font-style: italic;
}

/* Install Guide Bar */
.pwa-install-guide {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: slideDown 0.3s ease-out;
}

.guide-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.guide-text {
    flex: 1;
    font-size: 16px;
    line-height: 1.4;
}

.guide-close {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 20px;
    transition: all 0.3s ease;
}

.guide-close:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .install-modal {
        padding: 20px;
        margin: 20px;
        max-width: calc(100% - 40px);
    }
    
    .install-steps h3 {
        font-size: 20px;
    }
    
    .install-subtitle {
        font-size: 14px;
    }
    
    .step {
        padding: 12px;
    }
    
    .step-text {
        font-size: 14px;
    }
    
    .guide-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .guide-close {
        margin-left: 0;
    }
}