* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
}

.status.online {
    background: #10b981;
    color: white;
}

.status.offline {
    background: #ef4444;
    color: white;
}

nav {
    display: flex;
    gap: 10px;
    padding: 20px 30px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.nav-btn {
    padding: 12px 24px;
    border: none;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.nav-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.nav-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

main {
    padding: 30px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 24px;
    color: #1f2937;
}

.btn-primary, .btn-success, .btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-primary:disabled, .btn-success:disabled, .btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.select-input {
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.device-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.device-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.device-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.device-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #1f2937;
}

.device-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.device-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 10px;
}

.device-status.online {
    background: #d1fae5;
    color: #065f46;
}

.device-status.offline {
    background: #fee2e2;
    color: #991b1b;
}

.stream-container {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
    aspect-ratio: 16/9;
}

#video-stream {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stream-container {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.stream-container video {
    max-width: 100%;
    border-radius: 4px;
}

.audio-container {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.audio-container audio {
    width: 100%;
    margin-bottom: 20px;
}

.audio-visualizer {
    width: 100%;
    margin-top: 20px;
}

.audio-visualizer canvas {
    width: 100%;
    height: 200px;
    background: #0a0a0a;
    border-radius: 4px;
}

.audio-status {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    margin-left: 10px;
    font-size: 14px;
}

.audio-status.connected {
    background: #28a745;
    color: white;
}

.audio-status.disconnected {
    background: #6c757d;
    color: white;
}

.audio-status.error {
    background: #dc3545;
    color: white;
}

.screenshots-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    min-height: 400px;
}

.screenshot-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.screenshot-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.screenshot-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    background: #1a1a1a;
    overflow: hidden;
}

.screenshot-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.screenshot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.screenshot-item:hover .screenshot-overlay {
    opacity: 1;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    transform: scale(1.1);
    background: white;
}

.screenshot-info {
    padding: 12px;
}

.screenshot-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.screenshot-device {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.screenshot-date {
    font-size: 12px;
    color: #6b7280;
}

.screenshot-details {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #9ca3af;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-secondary.active {
    background: #10b981;
}

.btn-secondary.active:hover {
    background: #059669;
}

.file-browser {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    min-height: 400px;
}

.file-item {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.file-item:hover {
    background: #f3f4f6;
}

.file-item:last-child {
    border-bottom: none;
}

.log-container {
    background: #1f2937;
    color: #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    max-height: 600px;
    overflow-y: auto;
}

.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid #374151;
}

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

.log-time {
    color: #9ca3af;
    margin-right: 10px;
}

.log-level {
    font-weight: bold;
    margin-right: 10px;
}

.log-level.info {
    color: #60a5fa;
}

.log-level.error {
    color: #f87171;
}

.log-level.warn {
    color: #fbbf24;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-size: 16px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #374151;
}

