/* Offline Storage Status Styles */

.offline-status-container {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.offline-status {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.offline-status.online {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.offline-status.offline {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.offline-status.online .status-dot {
    background: #28a745;
    animation: pulse-green 2s infinite;
}

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

@keyframes pulse-green {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes pulse-red {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.sync-pending-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sync-pending-btn:hover {
    background: #0056b3;
}

.sync-pending-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Sync Notification */
.sync-notification {
    position: fixed;
    top: 60px;
    right: 10px;
    z-index: 1001;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease;
    max-width: 300px;
}

.sync-notification-content {
    padding: 16px;
}

.sync-notification-content span {
    display: block;
    margin-bottom: 12px;
    color: #495057;
    line-height: 1.4;
}

.sync-notification-content button {
    margin-right: 8px;
    padding: 4px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.sync-notification-content button:first-of-type {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.sync-notification-content button:first-of-type:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.sync-notification-content button:last-of-type:hover {
    background: #f8f9fa;
}

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

/* Offline Mode Indicator in Forms */
.form-offline-indicator {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-offline-indicator .icon {
    font-size: 18px;
}

.form-offline-indicator .text {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

/* Storage Info */
.storage-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    font-size: 12px;
    color: #6c757d;
}

.storage-info .storage-bar {
    background: #e9ecef;
    height: 4px;
    border-radius: 2px;
    margin: 6px 0;
    overflow: hidden;
}

.storage-info .storage-fill {
    background: #007bff;
    height: 100%;
    transition: width 0.3s ease;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .offline-status-container {
        top: 5px;
        right: 5px;
    }
    
    .offline-status {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .sync-notification {
        top: 50px;
        right: 5px;
        left: 5px;
        max-width: none;
    }
    
    .sync-notification-content {
        padding: 12px;
    }
}

/* Integration with existing form styles */
.inspection-form.offline-mode {
    border-left: 4px solid #ffc107;
}

.inspection-form.offline-mode .card-header {
    background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%);
}

/* Offline submit button styling */
.submit-offline {
    background: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #212529 !important;
}

.submit-offline:hover {
    background: #e0a800 !important;
    border-color: #d39e00 !important;
}
