/**
 * Offline Indicator Styles
 */

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    opacity: 0.5;
    color: #cd1212;
    padding: 8px 24px;
    z-index: 9998;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 6px 6px;
    max-width: 300px;
    width: auto;
}

.offline-indicator.show {
    transform: translateX(-50%) translateY(0);
}

.offline-indicator.hidden {
    display: none;
}

.offline-indicator-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    direction: rtl;
    white-space: nowrap;
}

.offline-indicator-content svg {
    width: 18px;
    height: 18px;
    animation: pulse-offline 2s infinite;
    flex-shrink: 0;
}

.offline-indicator-content span {
    font-size: 13px;
    font-weight: 600;
}

/* Online Notification */
.online-notification {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    opacity: 0.5;
    color: rgb(42, 159, 96);
    padding: 8px 24px;
    z-index: 9998;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 6px 6px;
    max-width: 300px;
    width: auto;
}

.online-notification.show {
    transform: translateX(-50%) translateY(0);
}

.online-notification-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    direction: rtl;
    white-space: nowrap;
}

.online-notification-content svg {
    width: 18px;
    height: 18px;
    animation: pulse-offline 2s infinite;
    flex-shrink: 0;
}

.online-notification-content span {
    font-size: 13px;
    font-weight: 800;
}

@keyframes pulse-offline {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Offline Mode Body Class */
body.offline-mode {
    /* Add any global styles for offline mode */
}

body.offline-mode::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        #fc8181 0px,
        #fc8181 10px,
        #f56565 10px,
        #f56565 20px
    );
    z-index: 100001;
    animation: offline-stripe 1s linear infinite;
}

@keyframes offline-stripe {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 0;
    }
}

/* Disable buttons and forms in offline mode */
body.offline-mode button:not(.pwa-btn-install):not(.pwa-btn-dismiss):not(.retry-button),
body.offline-mode input[type="submit"],
body.offline-mode .btn-submit {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .offline-indicator {
        padding: 6px 20px;
    }

    .offline-indicator-content {
        font-size: 12px;
    }

    .offline-indicator-content svg {
        width: 16px;
        height: 16px;
    }

    .online-notification {
        padding: 6px 20px;
    }

    .online-notification-content {
        font-size: 12px;
    }

    .online-notification-content svg {
        width: 16px;
        height: 16px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .offline-indicator {
        background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    }
}

/* Print mode - hide indicators */
@media print {
    .offline-indicator,
    .online-notification {
        display: none !important;
    }
}