/* Custom styles for Polar Data Collector */

body {
    font-family: 'Inter', sans-serif;
}

/* Status Dot Animations */
.status-dot {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

.status-dot.disconnected {
    background-color: #ef4444;
    animation: none;
}

.status-dot.connecting {
    background-color: #f59e0b;
}

.status-dot.connected {
    background-color: #22c55e;
}

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

/* Data Reception Indicators */
.data-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.data-indicator.active {
    opacity: 1;
}

/* Recording Animation */
.recording-pulse {
    animation: recordingPulse 1.5s ease-in-out infinite;
}

@keyframes recordingPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Keyboard Shortcut Styling */
kbd {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
}

/* Scrollbar Styling for Event Log */
#event-log::-webkit-scrollbar {
    width: 6px;
}

#event-log::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

#event-log::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 3px;
}

#event-log::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Modal Backdrop Animation */
#modal {
    animation: fadeIn 0.2s ease-out;
}

#modal.hidden {
    animation: fadeOut 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Storage Indicator Styling */
#storage-indicator {
    transition: all 0.3s ease-in-out;
}

#storage-indicator.warning {
    background-color: #fef3c7;
    color: #92400e;
}

#storage-indicator.critical {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .data-indicator {
        width: 6px;
        height: 6px;
        top: 4px;
        right: 4px;
    }
}

/* Quality Warning Animation */
#data-quality {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button Focus States */
button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Checkbox Custom Styling */
input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}

/* Loading States */
.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Event Log Entry Styles */
.event-entry {
    padding: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.event-entry:hover {
    background-color: #f9fafb;
}

.event-entry:last-child {
    border-bottom: none;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .no-print {
        display: none !important;
    }
    
    #event-log {
        height: auto;
        max-height: none;
    }
}