/* Telemetry Dashboard Styles */

.telemetry-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #fff;
}

.telemetry-container h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
}

/* Sessions List */
.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.session-card {
    background: rgba(30, 30, 30, 0.9);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #333;
    transition: border-color 0.3s;
}

.session-card:hover {
    border-color: #555;
}

.session-card.active {
    border-color: #44ff44;
    box-shadow: 0 0 10px rgba(68, 255, 68, 0.2);
}

.session-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.3rem;
}

.session-time {
    color: #888;
    font-size: 0.9rem;
    margin: 3px 0;
}

.session-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 5px;
}

.session-status.live {
    background: #44ff44;
    color: #000;
    animation: pulse 2s infinite;
}

.session-status.ended {
    background: #555;
    color: #fff;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.session-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-live {
    background: #44ff44;
    color: #000;
}

.btn-review {
    background: #4488ff;
    color: #fff;
}

.btn-back {
    background: #555;
    color: #fff;
}

.no-sessions {
    text-align: center;
    padding: 60px 20px;
    background: rgba(30, 30, 30, 0.9);
    border-radius: 10px;
}

.no-sessions .hint {
    color: #888;
    font-size: 0.9rem;
}

/* PIN Modal */
.pin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.pin-modal-content {
    background: #1e1e1e;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
}

.pin-modal-content h2 {
    margin-top: 0;
}

.pin-modal-content p {
    color: #888;
    margin-bottom: 20px;
}

#pin-input {
    width: 200px;
    padding: 15px;
    font-size: 24px;
    text-align: center;
    border: 2px solid #333;
    border-radius: 5px;
    background: #2a2a2a;
    color: #fff;
    letter-spacing: 8px;
    margin-bottom: 20px;
}

#pin-input:focus {
    outline: none;
    border-color: #44ff44;
}

.error-msg {
    color: #ff4444;
    margin-top: 10px;
    min-height: 20px;
}

/* Live Dashboard */
.live-view .live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.connection-status {
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: bold;
}

.connection-status.connecting {
    background: #ffaa44;
    color: #000;
}

.connection-status.connected {
    background: #44ff44;
    color: #000;
}

.connection-status.disconnected,
.connection-status.error {
    background: #ff4444;
    color: #fff;
}

.dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gauge-row {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.gauge-container {
    background: rgba(30, 30, 30, 0.9);
    border-radius: 10px;
    padding: 15px;
    min-width: 180px;
    text-align: center;
}

.gauge-container.wide {
    flex: 1;
    min-width: 300px;
}

.gauge-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* RPM Gauge */
.rpm-gauge {
    position: relative;
    width: 200px;
    height: 120px;
    margin: 0 auto;
}

.rpm-gauge svg {
    width: 100%;
    height: 100%;
}

.gauge-bg {
    fill: none;
    stroke: #333;
    stroke-width: 15;
    stroke-linecap: round;
}

.gauge-fill {
    fill: none;
    stroke: #44ff44;
    stroke-width: 15;
    stroke-linecap: round;
    transition: d 0.1s, stroke 0.3s;
}

.gauge-value {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    font-weight: bold;
}

/* Speed Display */
.speed-container {
    min-width: 200px;
}

.speed-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
}

.speed-value {
    font-size: 4rem;
    font-weight: bold;
    line-height: 1;
}

.speed-unit {
    font-size: 1.2rem;
    color: #888;
}

/* Temperature Bar */
.temp-bar {
    width: 60px;
    height: 100px;
    background: #333;
    border-radius: 5px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.temp-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #44ff44;
    transition: height 0.3s, background-color 0.3s;
}

.temp-value {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Throttle Bar */
.throttle-bar {
    height: 40px;
    background: #333;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.throttle-fill {
    height: 100%;
    background: linear-gradient(90deg, #44ff44, #ffaa44, #ff4444);
    transition: width 0.1s;
}

.throttle-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 0 5px #000;
}

/* G-Force Display */
.gforce-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.gforce-grid {
    width: 120px;
    height: 120px;
    background: #333;
    border-radius: 50%;
    position: relative;
}

.gforce-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
}

.gforce-crosshair::before,
.gforce-crosshair::after {
    content: '';
    position: absolute;
    background: #555;
}

.gforce-crosshair::before {
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
}

.gforce-crosshair::after {
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
}

.gforce-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ff4444;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: top 0.1s, left 0.1s;
    box-shadow: 0 0 10px #ff4444;
}

.gforce-values {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #888;
}

/* GPS Map */
.gps-map {
    position: relative;
    background: #222;
    border-radius: 5px;
    overflow: hidden;
}

#gps-canvas {
    display: block;
    width: 100%;
    height: 150px;
}

.gps-coords {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #888;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 8px;
    border-radius: 3px;
}

/* Review Page */
.review-view .review-header {
    margin-bottom: 30px;
}

.review-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-card {
    background: rgba(30, 30, 30, 0.9);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.stat-label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-wrapper {
    background: rgba(30, 30, 30, 0.9);
    border-radius: 10px;
    padding: 20px;
}

.chart-wrapper h3 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: #888;
}

.chart-wrapper canvas {
    height: 200px !important;
}

.track-map-container {
    background: rgba(30, 30, 30, 0.9);
    border-radius: 10px;
    padding: 20px;
}

.track-map-container h3 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: #888;
}

#track-canvas {
    width: 100%;
    height: 400px;
    background: #1a1a1a;
    border-radius: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .gauge-row {
        flex-direction: column;
        align-items: center;
    }

    .gauge-container.wide {
        width: 100%;
        min-width: auto;
    }

    .session-card {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .charts-container {
        grid-template-columns: 1fr;
    }
}
