/* Motion Analyzer Styles */

/* Chart Canvases */
#accelerationChart,
#gyroscopeChart {
    width: 100%;
    height: 100%;
    display: block;
}

/* Chart Legend */
.chart-legend {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
}

.legend-color {
    width: 16px;
    height: 3px;
    border-radius: 2px;
    display: inline-block;
}

/* Sensor Info */
.sensor-info-text {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
    padding: 0.5rem;
}

/* Statistics Cards */
.card-body .fs-5 {
    font-family: 'Courier New', monospace;
}

/* Live Data Table */
.table-responsive {
    max-height: 300px;
    overflow-y: auto;
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: var(--bs-tertiary-bg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table td,
.table th {
    font-size: 0.9rem;
    padding: 0.5rem;
    font-family: 'Courier New', monospace;
}

.table td:first-child {
    font-weight: 600;
}

/* Badges */
#statusBadge {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

#dataPointsBadge {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    font-family: 'Courier New', monospace;
}

/* Button Icons */
.toolBtn .fsvg {
    width: 14px;
    height: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chart-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .legend-item {
        font-size: 0.8rem;
    }

    .table td,
    .table th {
        font-size: 0.8rem;
        padding: 0.4rem;
    }

    #dataPointsBadge {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}

@media (max-width: 576px) {
    .d-flex.flex-wrap.gap-2 {
        gap: 0.5rem !important;
    }

    .toolBtn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }

    .chart-legend {
        font-size: 0.75rem;
    }
}

/* Animation for recording state */
@keyframes pulse-recording {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

#statusBadge.bg-success {
    animation: pulse-recording 2s ease-in-out infinite;
}

/* Loading state for charts */
canvas.loading {
    opacity: 0.5;
}

/* Smooth transitions */
canvas {
    transition: opacity 0.3s ease;
}

.badge {
    transition: all 0.3s ease;
}

/* Table hover effect */
.table-hover tbody tr:hover {
    background-color: var(--bs-tertiary-bg);
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .table th {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.075);
}

/* Export button special styling */
#exportButton:not(:disabled) {
    position: relative;
    overflow: hidden;
}

#exportButton:not(:disabled)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#exportButton:not(:disabled):active::after {
    width: 300px;
    height: 300px;
}

/* Clear button warning color */
#clearButton:hover {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
    color: #dc3545;
}

[data-bs-theme="dark"] #clearButton:hover {
    background-color: rgba(220, 53, 69, 0.2);
}
