/* ===== GLOBAL APP INDICATORS ===== */
.global-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-text {
    font-size: 1.1rem;
    font-weight: 500;
}

.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 9998;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    max-width: 300px;
}

.connection-status.online {
    background: var(--emerald);
    color: white;
    display: none; /* Hide when online */
}

.connection-status.offline {
    background: var(--alizarin);
    color: white;
}

.connection-status.syncing {
    background: var(--sunflower);
    color: var(--midnight-blue);
}

.connection-icon {
    font-size: 1.2rem;
}

.connection-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.sync-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    background: var(--peter-river);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 9997;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.sync-status:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.sync-status.syncing {
    background: var(--sunflower);
    color: var(--midnight-blue);
    animation: pulse 2s infinite;
}

.sync-status.error {
    background: var(--alizarin);
}

.sync-details-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: inherit;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sync-details-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Sync Details Styles */
.sync-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sync-queue-item {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 0.75rem;
    background: var(--card);
    border: 1px solid var(--silver);
    border-radius: var(--radius);
}

.sync-operation {
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.sync-operation.create { background: var(--emerald); color: white; }
.sync-operation.update { background: var(--sunflower); color: var(--midnight-blue); }
.sync-operation.delete { background: var(--alizarin); color: white; }

.sync-document-info {
    flex: 1;
    margin: 0 1rem;
}

.sync-document-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.sync-document-meta {
    font-size: 0.75rem;
    color: var(--text-light);
}

.sync-status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sync-status-pending { background: var(--sunflower); color: var(--midnight-blue); }
.sync-status-syncing { background: var(--peter-river); color: white; }
.sync-status-completed { background: var(--emerald); color: white; }
.sync-status-failed { background: var(--alizarin); color: white; }

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}