/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores principais */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #06b6d4;
    
    /* Cores de fundo */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --bg-dark: #1e293b;
    --bg-darker: #0f172a;
    
    /* Cores de texto */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Bordas */
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-color: #e2e8f0;
    
    /* Transições */
    --transition: all 0.2s ease-in-out;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #1e293b;
    --bg-secondary: #0f172a;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Layout Principal */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 24px;
    transition: var(--transition);
}

/* Header */
.header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Status Cards */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.status-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.status-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.status-card-header {
    display: flex;
    align-items: center;
    justify-content: between;
    margin-bottom: 16px;
}

.status-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background: var(--success-color);
}

.status-indicator.offline {
    background: var(--error-color);
}

.status-indicator.warning {
    background: var(--warning-color);
}

.status-indicator.unknown {
    background: var(--text-muted);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Permissões */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.permission-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.permission-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    margin-bottom: 6px;
    transition: var(--transition);
}

.permission-indicator.granted {
    background: var(--success-color);
    color: white;
}

.permission-indicator.denied {
    background: var(--error-color);
    color: white;
}

.permission-indicator.unknown {
    background: var(--text-muted);
    color: white;
}

.permission-indicator.active {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
    animation: pulse 2s infinite;
}

.permission-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Atividade */
.activity-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.activity-item span:last-child {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Activity Log */
.activity-log-container {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-top: 24px;
}

.activity-log-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.activity-log {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.activity-log-item {
    display: flex;
    margin-bottom: 8px;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-log-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.activity-time {
    color: var(--text-muted);
    font-weight: 600;
    min-width: 80px;
    margin-right: 12px;
}

.activity-text {
    color: var(--text-primary);
    flex: 1;
}

.activity-text.text-input {
    color: var(--primary-color);
}

.activity-text.app-changed {
    color: var(--success-color);
}

.activity-text.view-clicked {
    color: var(--warning-color);
}

.activity-text.notification {
    color: var(--info-color);
}

.activity-text.password {
    color: var(--error-color);
    font-weight: 600;
}

.activity-log-controls {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: flex-end;
}

.activity-log-controls .btn {
    padding: 8px 16px;
    font-size: 12px;
}

.status-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.status-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Video Container */
.video-container {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.video-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.video-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.view-toggle {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 4px;
    border: 1px solid var(--border-color);
}

.view-toggle button {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: calc(var(--border-radius) - 4px);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.view-toggle button.active {
    background: var(--primary-color);
    color: var(--text-white);
    box-shadow: var(--shadow-sm);
}

.video-display {
    position: relative;
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-canvas {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--border-radius);
}

.video-overlay {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
}

/* Controles de gravação */
.recording-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.recording-controls .btn {
    flex: 1;
    min-width: 120px;
    font-size: 12px;
    padding: 8px 12px;
}

.recording-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Indicador de gravação */
.recording-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(239, 68, 68, 0.95);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: pulse 2s infinite;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.recording-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Controls */
.controls-container {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.controls-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success-color);
    color: var(--text-white);
}

.btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--text-white);
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
    transform: translateY(-1px);
}

.btn-error {
    background: var(--error-color);
    color: var(--text-white);
}

.btn-error:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

/* Loading Animation */
.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Connection Status */
.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.connection-status.connected {
    background: var(--success-color);
    color: var(--text-white);
}

.connection-status.connecting {
    background: var(--warning-color);
    color: var(--text-white);
}

.connection-status.disconnected {
    background: var(--error-color);
    color: var(--text-white);
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--text-white);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

/* Login Form */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 400px;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
}

.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .video-container {
        padding: 16px;
    }
    
    .connection-status {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 16px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Device Selector */
.device-selector {
    margin-bottom: 24px;
}

.device-selector-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.device-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.device-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.device-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.device-card.selected {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: var(--shadow-md);
}

.device-card.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.device-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.device-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.device-status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.device-status-badge.online {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.device-status-badge.offline {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.device-status-badge.streaming {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    animation: pulse 2s infinite;
}

.device-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.device-detail {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.device-detail-label {
    font-weight: 500;
}

.device-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.device-action-btn {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.device-action-btn:hover {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

.device-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.no-devices-message {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.active-device-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

#active-device-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Streaming Indicators */
.streaming-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--primary-color);
    font-weight: 500;
}

.streaming-indicator::before {
    content: '●';
    animation: pulse 1.5s infinite;
}

.connection-quality {
    display: flex;
    align-items: center;
    gap: 4px;
}

.quality-bar {
    width: 3px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 1px;
}

.quality-bar.active {
    background: var(--success-color);
}

.quality-bar.medium {
    background: var(--warning-color);
}

.quality-bar.poor {
    background: var(--error-color);
}

/* Device Selection Animation */
@keyframes deviceSelect {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.device-card.selecting {
    animation: deviceSelect 0.3s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}/* 
Device Switch Notifications */
.device-switch-notification,
.device-disconnect-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 16px;
    z-index: 1000;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-in-out;
    max-width: 300px;
}

.device-switch-notification.show,
.device-disconnect-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.device-disconnect-notification {
    border-left: 4px solid var(--warning-color);
}

.device-switch-notification {
    border-left: 4px solid var(--success-color);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.notification-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Device Selector Styles */
.device-selector {
    margin-bottom: 24px;
}

.device-selector-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.device-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.no-devices-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 14px;
}

.device-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.device-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.device-card.selected {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: var(--shadow-md);
}

.device-card.selecting {
    transform: scale(0.98);
    transition: transform 0.15s ease-in-out;
}

.device-card-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 12px;
}

.device-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.device-status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.device-status-badge.online {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.device-status-badge.offline {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.device-status-badge.streaming {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.device-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.device-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.device-detail-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.connection-quality {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quality-bar {
    width: 3px;
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 2px;
}

.quality-bar.active {
    background: var(--success-color);
}

.quality-bar.medium {
    background: var(--warning-color);
}

.quality-bar.poor {
    background: var(--error-color);
}

.streaming-indicator {
    color: var(--primary-color);
    font-weight: 500;
}

.device-actions {
    display: flex;
    gap: 8px;
}

.device-action-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.device-action-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.device-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.active-device-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
}

#active-device-name {
    font-weight: 500;
    color: var(--text-primary);
}

/* Status Indicators */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-indicator.online {
    background: var(--success-color);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-indicator.offline {
    background: var(--error-color);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.status-indicator.streaming {
    background: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
    animation: pulse 2s infinite;
}

.status-indicator.warning {
    background: var(--warning-color);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.status-indicator.error {
    background: var(--error-color);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* Battery Indicators */
.battery-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875rem;
}

.battery-indicator.battery-critical {
    color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
}

.battery-indicator.battery-low {
    color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
}

.battery-indicator.battery-medium {
    color: var(--info-color);
    background: rgba(6, 182, 212, 0.1);
}

.battery-indicator.battery-high {
    color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .device-switch-notification,
    .device-disconnect-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .device-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .device-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .device-action-btn {
        flex: 1;
    }
}

/* ===== Controles de Brilho ===== */
.brightness-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brightness-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brightness-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    cursor: pointer;
}

.brightness-slider:hover {
    opacity: 1;
}

.brightness-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.brightness-slider::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.brightness-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.brightness-slider::-moz-range-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.brightness-slider:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.brightness-slider:disabled::-webkit-slider-thumb {
    background: var(--secondary-color);
    cursor: not-allowed;
}

.brightness-slider:disabled::-moz-range-thumb {
    background: var(--secondary-color);
    cursor: not-allowed;
}

.brightness-value {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

.brightness-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-small {
    padding: 6px 10px;
    font-size: 16px;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition);
}

.btn-small:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-small:active:not(:disabled) {
    transform: translateY(0);
}

.btn-small:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Responsividade para controles de brilho */
@media (max-width: 768px) {
    .brightness-controls {
        gap: 8px;
    }
    
    .brightness-slider-container {
        gap: 8px;
    }
    
    .brightness-buttons {
        gap: 4px;
    }
    
    .btn-small {
        padding: 4px 8px;
        font-size: 14px;
        min-width: 32px;
        height: 32px;
    }
    
    .brightness-value {
        min-width: 40px;
        font-size: 12px;
    }
}
/* Sc
reenshot Panel */
.screenshot-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 350px;
    max-height: calc(100vh - 40px);
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.screenshot-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.screenshot-panel-header h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.close-panel-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-panel-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.screenshot-panel-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex: 1;
}

.screenshot-image {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    object-fit: contain;
    margin-bottom: 12px;
}

.screenshot-info {
    margin-bottom: 16px;
}

.screenshot-info p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 4px 0;
    line-height: 1.4;
}

.screenshot-actions {
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.8rem;
    min-width: auto;
}

/* Responsive para telas menores */
@media (max-width: 768px) {
    .screenshot-panel {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        animation: slideInUp 0.3s ease-out;
    }
    
    @keyframes slideInUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    .screenshot-actions {
        flex-direction: column;
    }
    
    .screenshot-actions .btn {
        width: 100%;
    }
}

/* Ajuste para não sobrepor outros elementos */
.main-content {
    position: relative;
}

/* Quando o painel está aberto, adicionar margem no conteúdo principal em telas grandes */
@media (min-width: 769px) {
    .main-content.screenshot-panel-open {
        margin-right: 370px;
        transition: margin-right 0.3s ease-out;
    }
}