/* Modern Operator Control Styles */

/* Modern Header */
.modern-header {
    background: linear-gradient(135deg, rgba(16, 22, 39, 0.95), rgba(27, 37, 66, 0.95));
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(91, 140, 255, 0.2);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #5b8cff, #3c73ff);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 8px 32px rgba(91, 140, 255, 0.3);
}

.logo-text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #e8eefc;
    margin: 0;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 0.875rem;
    color: #b7c3e0;
    font-weight: 500;
}

.modern-nav {
    display: flex;
    gap: 0.5rem;
}

.modern-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    text-decoration: none;
    color: #b7c3e0;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.modern-nav .nav-item:hover {
    color: #e8eefc;
    background: rgba(91, 140, 255, 0.1);
    border-color: rgba(91, 140, 255, 0.2);
}

.modern-nav .nav-item.active {
    color: #e8eefc;
    background: linear-gradient(135deg, rgba(91, 140, 255, 0.2), rgba(60, 115, 255, 0.1));
    border-color: rgba(91, 140, 255, 0.3);
}

.modern-nav .nav-item i {
    font-size: 1rem;
}

.external-link-icon {
    font-size: 0.75rem !important;
    opacity: 0.7;
    margin-left: 0.25rem;
}

/* Modern Container */
.modern-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Session Selector */
.session-selector {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(91, 140, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.session-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #e8eefc;
    margin: 0;
}

.btn-new-session {
    background: linear-gradient(135deg, #5b8cff, #3c73ff);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(91, 140, 255, 0.3);
}

.btn-new-session:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(91, 140, 255, 0.4);
}

.session-controls {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.modern-select {
    flex: 1;
    background: rgba(16, 22, 39, 0.8);
    border: 1px solid rgba(91, 140, 255, 0.3);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    color: #e8eefc;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.modern-select:focus {
    outline: none;
    border-color: #5b8cff;
    box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.1);
}

.session-info {
    flex: 1;
    background: rgba(16, 22, 39, 0.6);
    border: 1px solid rgba(91, 140, 255, 0.2);
    border-radius: 10px;
    padding: 1rem;
    min-height: 60px;
}

.no-session {
    color: #b7c3e0;
    font-style: italic;
    display: flex;
    align-items: center;
    height: 100%;
}

/* Control Panel */
.control-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(91, 140, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.primary-controls {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 2rem;
}

/* Pinned playback controls */
.primary-controls.pinned {
    position: fixed;
    inset: auto 16px 16px auto; /* default pin bottom-right */
    z-index: 9999;
    background: rgba(16, 22, 39, 0.8);
    border: 1px solid rgba(91, 140, 255, 0.3);
    border-radius: 12px;
    padding: 12px;
    grid-template-columns: auto;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.primary-controls.pinned.edge-top { inset: 90px 16px auto 16px; }
.primary-controls.pinned.edge-right { inset: 90px 16px auto auto; }
.primary-controls.pinned.edge-bottom { inset: auto 16px 16px 16px; }
.primary-controls.pinned.edge-left { inset: 90px auto auto 16px; }

/* Playback Controls */
.playback-controls {
    display: flex;
    gap: 1rem;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(91, 140, 255, 0.3);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    color: #e8eefc;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(91, 140, 255, 0.2);
    border-color: rgba(91, 140, 255, 0.5);
}

.control-btn.playing {
    background: linear-gradient(135deg, #16bd6f, #0ea55e);
    border-color: #16bd6f;
    color: white;
}

.btn-icon {
    width: 40px;
    height: 40px;
    background: rgba(91, 140, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.control-btn.playing .btn-icon {
    background: rgba(255, 255, 255, 0.2);
}

.btn-text {
    font-weight: 600;
    font-size: 0.875rem;
}

/* Speed Control */
.speed-control {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e8eefc;
    font-weight: 600;
    font-size: 0.875rem;
}

.control-label i {
    color: #5b8cff;
}

.speed-slider-container {
    position: relative;
}

.modern-slider {
    width: 100%;
    height: 8px;
    background: rgba(16, 22, 39, 0.8);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.modern-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #5b8cff, #3c73ff);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(91, 140, 255, 0.4);
    transition: all 0.2s ease;
}

.modern-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(91, 140, 255, 0.6);
}

.modern-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #5b8cff, #3c73ff);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 12px rgba(91, 140, 255, 0.4);
}

.speed-display {
    position: absolute;
    top: -30px;
    right: 0;
    background: rgba(16, 22, 39, 0.9);
    color: #5b8cff;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(91, 140, 255, 0.3);
}

/* Speed presets removed */

/* Position Control */
.position-control {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.position-slider-container {
    position: relative;
}

.position-display {
    position: absolute;
    top: -30px;
    right: 0;
    background: rgba(16, 22, 39, 0.9);
    color: #5b8cff;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(91, 140, 255, 0.3);
}

/* Script Section */
.script-section {
    border-top: 1px solid rgba(91, 140, 255, 0.2);
    padding-top: 2rem;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #e8eefc;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.section-header i {
    color: #5b8cff;
}

.script-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(91, 140, 255, 0.3);
    color: #e8eefc;
}

.btn-secondary:hover {
    background: rgba(91, 140, 255, 0.1);
    border-color: rgba(91, 140, 255, 0.5);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(91, 140, 255, 0.4);
    color: #5b8cff;
}

.btn-outline:hover {
    background: rgba(91, 140, 255, 0.1);
    border-color: #5b8cff;
    color: #e8eefc;
    transform: translateY(-1px);
}

.script-info {
    background: rgba(16, 22, 39, 0.6);
    border: 1px solid rgba(91, 140, 255, 0.2);
    border-radius: 10px;
    padding: 1rem;
    min-height: 60px;
}

.no-script {
    color: #b7c3e0;
    font-style: italic;
    display: flex;
    align-items: center;
    height: 100%;
}

/* Settings Panel */
.settings-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(91, 140, 255, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(91, 140, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.panel-header:hover {
    background: rgba(91, 140, 255, 0.05);
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #e8eefc;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.panel-header i {
    color: #5b8cff;
}

.panel-toggle {
    background: none;
    border: none;
    color: #b7c3e0;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.5rem;
    border-radius: 6px;
}

.panel-toggle:hover {
    color: #e8eefc;
    background: rgba(91, 140, 255, 0.1);
}

.panel-content {
    padding: 2rem;
    transition: all 0.3s ease;
}

.panel-content.collapsed {
    display: none;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.setting-group.full-width {
    grid-column: 1 / -1;
}

.setting-group label {
    color: #e8eefc;
    font-weight: 600;
    font-size: 0.875rem;
}

.slider-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider-value {
    background: rgba(16, 22, 39, 0.8);
    color: #5b8cff;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(91, 140, 255, 0.3);
    min-width: 60px;
    text-align: center;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.color-input {
    width: 50px;
    height: 40px;
    border: 1px solid rgba(91, 140, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.color-value {
    background: rgba(16, 22, 39, 0.8);
    color: #e8eefc;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(91, 140, 255, 0.3);
    font-family: monospace;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    background: rgba(16, 22, 39, 0.8);
    border: 1px solid rgba(91, 140, 255, 0.3);
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #5b8cff, #3c73ff);
    border-color: #5b8cff;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.display-scales {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.display-scale-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(16, 22, 39, 0.6);
    border: 1px solid rgba(91, 140, 255, 0.2);
    border-radius: 10px;
}

.display-scale-label {
    min-width: 100px;
    color: #e8eefc;
    font-weight: 500;
}

.display-scale-slider {
    flex: 1;
}

.display-scale-value {
    min-width: 60px;
    text-align: center;
    color: #5b8cff;
    font-weight: 600;
    font-size: 0.875rem;
}

.display-scale-presets {
    display: flex;
    gap: 0.5rem;
}

.display-scale-presets button {
    padding: 0.25rem 0.5rem;
    background: rgba(91, 140, 255, 0.1);
    border: 1px solid rgba(91, 140, 255, 0.3);
    border-radius: 4px;
    color: #b7c3e0;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.display-scale-presets button:hover {
    background: rgba(91, 140, 255, 0.2);
    color: #e8eefc;
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(16, 22, 39, 0.8), rgba(27, 37, 66, 0.8));
    border: 1px solid rgba(91, 140, 255, 0.2);
    border-radius: 12px;
    padding: 1rem 2rem;
    backdrop-filter: blur(10px);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #b7c3e0;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef476f;
    transition: all 0.2s ease;
}

.status-indicator.online {
    background: #16bd6f;
    box-shadow: 0 0 8px rgba(22, 189, 111, 0.4);
}

.status-indicator.offline {
    background: #ef476f;
    box-shadow: 0 0 8px rgba(239, 71, 111, 0.4);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .primary-controls {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .playback-controls {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
        height: 70px;
    }
    
    .logo-text h1 {
        font-size: 1.5rem;
    }
    
    .modern-nav {
        gap: 0.25rem;
    }
    
    .modern-nav .nav-item {
        padding: 0.5rem 0.75rem;
    }
    
    .modern-nav .nav-item span {
        display: none;
    }
    
    .modern-container {
        padding: 1rem;
        gap: 1.5rem;
    }
    
    .session-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .playback-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .control-btn {
        min-width: auto;
        width: 100%;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .logo-section {
        gap: 0.75rem;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .logo-text h1 {
        font-size: 1.25rem;
    }
    
    .logo-subtitle {
        font-size: 0.75rem;
    }
    
    .session-selector,
    .control-panel,
    .settings-panel {
        padding: 1.5rem;
    }
    
    .panel-content {
        padding: 1.5rem;
    }
}

/* Animation Classes */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modern-container > * {
    animation: slideInUp 0.6s ease-out;
}

.modern-container > *:nth-child(2) {
    animation-delay: 0.1s;
}

.modern-container > *:nth-child(3) {
    animation-delay: 0.2s;
}

.modern-container > *:nth-child(4) {
    animation-delay: 0.3s;
}

/* Focus States */
.modern-select:focus,
.modern-slider:focus,
.color-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.1);
}

/* Hover Effects */
.control-btn:hover .btn-icon {
    transform: scale(1.1);
}

.preset-btn:hover {
    transform: translateY(-1px);
}

.btn:hover {
    transform: translateY(-1px);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(91, 140, 255, 0.3);
    border-top: 2px solid #5b8cff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
