/* PWA Offline Styles for Finding Sports */

/* Connection Status Indicator */
.connection-status {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.connection-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    background: #43b581;
    transition: background 0.3s ease;
}

.connection-status.offline .status-dot {
    background: #ed4245;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: scale(0.95);
    }
}

/* Offline Banner */
.offline-banner {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-weight: 500;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.offline-banner strong {
    font-weight: 600;
}

/* Pending Messages */
.pending-message {
    position: relative;
    opacity: 0.8;
}

.pending-message::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(243, 156, 18, 0.1) 100%);
    pointer-events: none;
}

.pending-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #f39c12;
    margin-top: 4px;
    padding: 4px 8px;
    background: rgba(243, 156, 18, 0.1);
    border-radius: 4px;
    width: fit-content;
}

.pending-indicator svg {
    animation: spin 2s linear infinite;
    width: 14px;
    height: 14px;
}

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

/* Message successfully sent animation */
.discord-message.sent {
    animation: messageSent 0.5s ease;
}

@keyframes messageSent {
    0% {
        background: rgba(67, 181, 129, 0.2);
    }
    100% {
        background: transparent;
    }
}

/* PWA Notifications */
.pwa-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2f3136;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    max-width: 350px;
    border-left: 4px solid #f39c12;
}

.pwa-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.pwa-notification strong {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
}

.pwa-notification p {
    margin: 0;
    color: #b9bbbe;
    font-size: 14px;
}

/* Install Banner */
.install-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 20px;
    max-width: 400px;
    width: 90%;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.install-banner.show {
    transform: translateX(-50%) translateY(0);
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.install-banner-icon {
    width: 60px;
    height: 60px;
    background: #f39c12;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    flex-shrink: 0;
}

.install-banner-text {
    flex: 1;
}

.install-banner-text h3 {
    margin: 0 0 4px 0;
    color: #333;
    font-size: 18px;
}

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

.install-banner-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.install-btn, .dismiss-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    flex: 1;
}

.install-btn {
    background: #f39c12;
    color: white;
}

.install-btn:hover {
    background: #e67e22;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.dismiss-btn {
    background: #e5e5e5;
    color: #666;
}

.dismiss-btn:hover {
    background: #d5d5d5;
}

/* Floating Install Button */
#installButton {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
    display: none;
    z-index: 999;
    transition: all 0.3s ease;
    font-size: 16px;
}

#installButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

#installButton:active {
    transform: translateY(-1px);
}

/* Update Notification */
.update-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 500px;
    margin: 0 auto;
    background: #5865f2;
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

.update-notification .update-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.update-notification p {
    margin: 0;
    flex: 1;
}

.update-notification button {
    background: white;
    color: #5865f2;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.update-notification button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

/* Offline Mode Adjustments */
body.offline .message-input-container {
    position: relative;
}

body.offline .message-input-container::before {
    content: '📡 Offline Mode - Messages will be sent when connection is restored';
    position: absolute;
    top: -25px;
    left: 0;
    font-size: 12px;
    color: #f39c12;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Cached Content Indicator */
.cached-content-indicator {
    background: #40444b;
    color: #b9bbbe;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    margin: 10px 0;
}

.cached-content-indicator::before {
    content: '💾 ';
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .install-banner {
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        transform: translateX(0) translateY(120%);
    }
    
    .install-banner.show {
        transform: translateX(0) translateY(0);
    }
    
    .install-banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    .pwa-notification {
        left: 10px;
        right: 10px;
        top: 10px;
    }
    
    #installButton {
        bottom: 70px;
        right: 15px;
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .install-banner {
        background: #2f3136;
        color: white;
    }
    
    .install-banner-text h3 {
        color: white;
    }
    
    .install-banner-text p {
        color: #b9bbbe;
    }
    
    .dismiss-btn {
        background: #40444b;
        color: #b9bbbe;
    }
    
    .dismiss-btn:hover {
        background: #4a4d55;
    }
}