/* Offline State Styles */

/* Offline Banner */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 0.75rem 0;
    z-index: 1001;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
}

.offline-banner .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
}

.offline-banner i {
    font-size: 1.1rem;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Sync Status Button */
#sync-status {
    position: relative;
    transition: all 0.3s ease;
}

#sync-status.online {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

#sync-status.offline {
    background-color: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.3);
    color: #fecaca;
}

#sync-status.syncing {
    background-color: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
    color: #bfdbfe;
}

#sync-status.syncing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Offline Indicators */
.offline-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.offline-indicator.online {
    background-color: #dcfce7;
    color: #166534;
}

.offline-indicator.offline {
    background-color: #fef2f2;
    color: #dc2626;
}

.offline-indicator.syncing {
    background-color: #dbeafe;
    color: #1d4ed8;
}

/* Sync Queue Badge */
.sync-queue-badge {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background-color: #dc2626;
    color: white;
    border-radius: 50%;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Offline Form States */
.form-offline {
    position: relative;
}

.form-offline::before {
    content: 'Offline Mode';
    position: absolute;
    top: -0.5rem;
    right: 0;
    background-color: #f59e0b;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 10;
}

.form-offline .form-control {
    border-color: #f59e0b;
    background-color: #fef3c7;
}

.form-offline .form-control:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 0.2rem rgba(217, 119, 6, 0.25);
}

/* Sync Progress */
.sync-progress {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    min-width: 250px;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

.sync-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sync-progress-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
}

.sync-progress-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.sync-progress-close:hover {
    background-color: #f3f4f6;
}

.sync-progress-bar {
    width: 100%;
    height: 0.25rem;
    background-color: #e5e7eb;
    border-radius: 0.125rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.sync-progress-fill {
    height: 100%;
    background-color: #3b82f6;
    transition: width 0.3s ease;
}

.sync-progress-text {
    font-size: 0.75rem;
    color: #6b7280;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Offline Toast Notifications */
.offline-toast {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    max-width: 300px;
    z-index: 1000;
    animation: slideInUp 0.3s ease-out;
}

.offline-toast.success {
    border-left: 4px solid #10b981;
}

.offline-toast.warning {
    border-left: 4px solid #f59e0b;
}

.offline-toast.error {
    border-left: 4px solid #ef4444;
}

.offline-toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.offline-toast-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.offline-toast-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.offline-toast-close:hover {
    background-color: #f3f4f6;
}

.offline-toast-message {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.4;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Offline Data Status */
.offline-data-status {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.offline-data-status-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.offline-data-status-icon {
    color: #d97706;
    font-size: 1.1rem;
}

.offline-data-status-title {
    font-weight: 600;
    color: #92400e;
    font-size: 0.875rem;
}

.offline-data-status-message {
    color: #92400e;
    font-size: 0.875rem;
    line-height: 1.4;
}

.offline-data-status-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

/* Responsive Offline Styles */
@media (max-width: 768px) {
    .sync-progress {
        bottom: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        min-width: auto;
    }
    
    .offline-toast {
        bottom: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
        max-width: none;
    }
    
    .offline-banner {
        padding: 0.5rem 0;
    }
    
    .offline-banner .container {
        font-size: 0.875rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .offline-banner {
        background: #dc2626;
        border-bottom: 2px solid #000;
    }
    
    .offline-indicator {
        border: 1px solid currentColor;
    }
    
    .sync-progress,
    .offline-toast {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .offline-banner,
    .sync-progress,
    .offline-toast {
        animation: none;
    }
    
    #sync-status.syncing::after {
        animation: none;
    }
    
    .sync-queue-badge {
        animation: none;
    }
} 