/* Enhanced Runometer Styles with Centered Eye Icon and Audio/Video Recording */

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Motion Eye Container - Centered */
.motion-eye-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.motion-eye {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, #4fc3f7 0%, #2196f3 100%);
    position: relative;
    animation: eyePulse 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.5);
}

.eye-lid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    border-radius: 50% 50% 0 0;
    transition: height 0.3s ease;
}

.eye-iris {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffd700 0%, #ff6b6b 100%);
    animation: diamondRotate 3s linear infinite;
}

.iris-diamond {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 20px;
    height: 20px;
    background: #ffffff;
    border: 2px solid #ffd700;
    animation: diamondRotate 2s linear infinite reverse;
}

.pupil {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #000;
    border-radius: 50%;
}

.lightning-bolts {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    pointer-events: none;
}

.bolt {
    position: absolute;
    width: 2px;
    height: 20px;
    background: linear-gradient(180deg, #ffff00 0%, #ff6b6b 100%);
    animation: lightningFlash 0.5s ease-in-out infinite;
}

.bolt-1 { top: 10px; left: 50%; transform: translateX(-50%) rotate(0deg); }
.bolt-2 { top: 50%; right: 10px; transform: translateY(-50%) rotate(90deg); }
.bolt-3 { bottom: 10px; left: 50%; transform: translateX(-50%) rotate(180deg); }
.bolt-4 { top: 50%; left: 10px; transform: translateY(-50%) rotate(270deg); }

.light-rays {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    pointer-events: none;
}

.ray {
    position: absolute;
    width: 3px;
    height: 30px;
    background: linear-gradient(180deg, #ffffff 0%, transparent 100%);
    animation: rayPulse 1s ease-in-out infinite;
}

.ray-1 { top: 0; left: 50%; transform: translateX(-50%); }
.ray-2 { top: 50%; right: 0; transform: translateY(-50%) rotate(45deg); }
.ray-3 { top: 50%; right: 0; transform: translateY(-50%) rotate(90deg); }
.ray-4 { bottom: 0; left: 50%; transform: translateX(-50%) rotate(180deg); }
.ray-5 { top: 50%; left: 0; transform: translateY(-50%) rotate(225deg); }
.ray-6 { top: 50%; left: 0; transform: translateY(-50%) rotate(270deg); }
.ray-7 { top: 25%; left: 25%; transform: rotate(45deg); }
.ray-8 { top: 25%; right: 25%; transform: rotate(135deg); }

.golden-halo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 3px solid #ffd700;
    border-radius: 50%;
    animation: haloRotate 4s linear infinite;
    opacity: 0.8;
}

.motion-status {
    margin-top: 10px;
    font-size: 12px;
    color: #4fc3f7;
    text-align: center;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
}

/* Language Selector - Enhanced */
.language-selector {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.language-selector select {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
}

.language-selector select option {
    background: #1e3c72;
    color: white;
    padding: 0.5rem;
}

/* English Toggle Button */
.english-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999;
    background: rgba(79, 195, 247, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(79, 195, 247, 0.4);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.english-toggle:hover {
    background: rgba(79, 195, 247, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 195, 247, 0.3);
}

/* Navigation */
.navbar {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-link {
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 1.5rem;
}

.brand-icon {
    font-size: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-link:hover {
    color: #4fc3f7;
    background: rgba(79, 195, 247, 0.1);
}

/* Essential Controls Panel */
.essential-controls {
    background: rgba(79, 195, 247, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(79, 195, 247, 0.3);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.control-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.control-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.control-btn.primary {
    background: linear-gradient(135deg, #4fc3f7 0%, #2196f3 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.3);
}

.control-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 195, 247, 0.4);
}

.control-btn:not(.primary) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-btn:not(.primary):hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.auto-tracking-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(76, 175, 80, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.auto-tracking-status .status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4caf50;
    animation: pulse 2s infinite;
}

.auto-tracking-status .status-indicator.inactive {
    background: #f44336;
    animation: none;
}

.auto-tracking-status .status-text {
    color: #4caf50;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Dashboard */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.metric-card.primary {
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.2) 0%, rgba(33, 150, 243, 0.2) 100%);
    border: 1px solid rgba(79, 195, 247, 0.4);
}

.metric-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4fc3f7;
    margin-bottom: 0.5rem;
    font-family: 'Orbitron', monospace;
}

.metric-unit {
    font-size: 1rem;
    color: #b0bec5;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 1.1rem;
    color: #e0e0e0;
    font-weight: 500;
}

/* Live Route Container */
.live-route-container {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
}

.live-route-container h3 {
    color: #4fc3f7;
    margin-bottom: 1rem;
    text-align: center;
    font-family: 'Orbitron', monospace;
}

.route-map-container {
    width: 100%;
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

.map-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #4fc3f7;
    border: 2px dashed rgba(79, 195, 247, 0.3);
}

.map-loading {
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(79, 195, 247, 0.3);
    border-top: 4px solid #4fc3f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

/* Audio/Video Recording Controls */
.recording-controls {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
    text-align: center;
}

.recording-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.recording-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #f44336;
    animation: pulse 1s infinite;
}

.recording-indicator.recording {
    background: #f44336;
    animation: pulse 1s infinite;
}

.recording-indicator.stopped {
    background: #4caf50;
    animation: none;
}

.recording-info {
    color: #4fc3f7;
    font-weight: 600;
}

.spectrograph-container {
    width: 100%;
    height: 200px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
}

.spectrograph {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #000428 0%, #004e92 100%);
    position: relative;
}

.spectrograph-line {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, #00ff00 0%, #ffff00 50%, #ff0000 100%);
    animation: spectrographMove 0.1s linear infinite;
}

/* Animations */
@keyframes eyePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes diamondRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes lightningFlash {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

@keyframes rayPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes haloRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spectrographMove {
    0% { left: 0; }
    100% { left: 100%; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .motion-eye-container {
        top: 10px;
    }
    
    .language-selector {
        bottom: 10px;
        right: 10px;
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .english-toggle {
        bottom: 10px;
        left: 10px;
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .essential-controls {
        flex-direction: column;
        text-align: center;
    }
    
    .control-group {
        justify-content: center;
    }
}

/* Additional responsive adjustments for very small screens */
@media (max-width: 480px) {
    .language-selector {
        bottom: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
    
    .english-toggle {
        bottom: 60px;
        left: 10px;
        right: 10px;
        text-align: center;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
button:focus,
select:focus,
input:focus {
    outline: 2px solid #4fc3f7;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .motion-eye {
        border: 2px solid #ffffff;
    }
    
    .metric-card {
        border: 2px solid #ffffff;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .motion-eye,
    .eye-iris,
    .iris-diamond,
    .bolt,
    .ray,
    .golden-halo,
    .loading-spinner {
        animation: none;
    }
}
