/**
 * PWA UI Components Styles
 * Enhanced Gold Dark Theme
 */

/* Toast Notifications */
.pwa-toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 24px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: 12px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 99999;
    transition: bottom 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    max-width: 90%;
    min-width: 280px;
    text-align: center;
}

.pwa-toast.show {
    bottom: 30px;
    opacity: 1;
}

.pwa-toast-success {
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(26, 46, 26, 0.95);
}

.pwa-toast-warning {
    border-color: rgba(251, 146, 60, 0.5);
    background: rgba(46, 36, 26, 0.95);
}

.pwa-toast-error {
    border-color: rgba(248, 113, 113, 0.5);
    background: rgba(46, 26, 26, 0.95);
}

.pwa-toast-info {
    border-color: rgba(96, 165, 250, 0.5);
    background: rgba(26, 36, 46, 0.95);
}

/* Update Banner */
.pwa-update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.update-notification {
    background: linear-gradient(135deg, #C9A227 0%, #E8D48A 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    box-shadow: 0 4px 20px rgba(201, 162, 39, 0.4);
}

.update-notification p {
    margin: 0;
    color: #1A1A2E;
    font-weight: 600;
    font-size: 0.95rem;
}

.update-notification button {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.update-notification button:first-of-type {
    background: #1A1A2E;
    color: #C9A227;
}

.update-notification button:first-of-type:hover {
    background: #0F0F1A;
    transform: scale(1.05);
}

.update-notification button:last-of-type {
    background: rgba(26, 26, 46, 0.2);
    color: #1A1A2E;
}

.update-notification button:last-of-type:hover {
    background: rgba(26, 26, 46, 0.3);
}

/* Install Prompt Banner */
.install-prompt-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(20px);
    border-top: 2px solid rgba(201, 162, 39, 0.3);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    z-index: 99998;
    animation: slideUp 0.4s ease-out;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.install-prompt-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.install-prompt-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.install-prompt-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.install-prompt-text h3 {
    margin: 0 0 5px 0;
    color: #C9A227;
    font-size: 1rem;
    font-weight: 600;
}

.install-prompt-text p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.install-prompt-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.install-prompt-actions button {
    padding: 10px 24px;
    border: none;
    border-radius: 25px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.install-prompt-actions button:first-child {
    background: linear-gradient(135deg, #C9A227 0%, #E8D48A 100%);
    color: #1A1A2E;
    box-shadow: 0 4px 15px rgba(201, 162, 39, 0.3);
}

.install-prompt-actions button:first-child:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 162, 39, 0.4);
}

.install-prompt-actions button:last-child {
    background: rgba(201, 162, 39, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(201, 162, 39, 0.3);
}

.install-prompt-actions button:last-child:hover {
    background: rgba(201, 162, 39, 0.2);
    border-color: rgba(201, 162, 39, 0.5);
}

/* Connection Status Indicator */
.connection-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 99997;
    animation: fadeInRight 0.3s ease-out;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.connection-indicator.online {
    border-color: rgba(74, 222, 128, 0.5);
}

.connection-indicator.offline {
    border-color: rgba(248, 113, 113, 0.5);
}

.connection-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #C9A227;
}

.connection-indicator.online .connection-indicator-dot {
    background: #4ade80;
    animation: pulse 2s ease-in-out infinite;
}

.connection-indicator.offline .connection-indicator-dot {
    background: #f87171;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.connection-indicator-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Loading Overlay for PWA */
.pwa-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pwa-loading-content {
    text-align: center;
}

.pwa-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(201, 162, 39, 0.2);
    border-top-color: #C9A227;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.pwa-loading-text {
    color: #C9A227;
    font-size: 1rem;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .install-prompt-banner {
        flex-direction: column;
        text-align: center;
    }
    
    .install-prompt-content {
        flex-direction: column;
        text-align: center;
    }
    
    .install-prompt-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .install-prompt-actions button {
        width: 100%;
    }
    
    .connection-indicator {
        top: 10px;
        right: 10px;
        padding: 8px 15px;
        font-size: 0.8rem;
    }
    
    .pwa-toast {
        min-width: auto;
        max-width: calc(100% - 40px);
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .pwa-toast,
    .pwa-update-banner,
    .install-prompt-banner,
    .connection-indicator,
    .pwa-loading-overlay {
        animation: none !important;
        transition: none !important;
    }
    
    .connection-indicator.online .connection-indicator-dot {
        animation: none;
    }
}
