/* Motion Dashboard & Editor Styles */
/* Extracted from motion-dashboard.html and motion-editor.html inline styles */
/* Uses CSS custom properties from style.css for theme support */

/* ===== Shared Styles (both dashboard and editor) ===== */

body.motion-page {
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

.motion-page .navbar {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--bg-card);
}

.motion-page .canvas-wrapper {
    position: relative;
    display: inline-block;
    border: 2px solid var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.motion-page .sidebar {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
}

.motion-page .sensor-name {
    font-weight: bold;
    margin-bottom: 4px;
}

.motion-page .sensor-status {
    font-size: 13px;
    color: var(--text-secondary);
}

.motion-page .sensor-status.active {
    color: var(--accent-green);
}

.motion-page .floor-select {
    background: var(--bg-card);
    border: 1px solid var(--bg-card);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 4px;
}

/* ===== Motion Dashboard Specific ===== */

.motion-page .floor-plan-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

.motion-page #motion-canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.motion-page .sidebar {
    height: fit-content;
}

.motion-page .sensor-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.motion-page .sensor-card.active {
    background: #1a5c3a;
    border-left: 4px solid var(--accent-green);
}

.motion-page .btn-editor {
    background: var(--accent);
    border: none;
    color: white;
}

.motion-page .btn-editor:hover {
    background: #c73e54;
    color: white;
}

.motion-page .activity-item {
    background: var(--bg-card);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 13px;
    border-left: 3px solid var(--accent-green);
}

.motion-page .activity-time {
    color: var(--text-secondary);
    font-size: 11px;
}

.motion-page .sidebar hr {
    border-color: var(--bg-card);
}

/* ===== Motion Editor Specific ===== */

.motion-page .editor-container {
    display: flex;
    height: calc(100vh - 60px);
}

.motion-page .canvas-area {
    flex: 1;
    padding: 20px;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.motion-page .sidebar.editor-sidebar {
    width: 320px;
    overflow-y: auto;
    border-left: 1px solid var(--bg-card);
    border-radius: 0;
}

.motion-page .toolbar {
    background: var(--bg-secondary);
    padding: 10px 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid var(--bg-card);
}

.motion-page #editor-canvas {
    display: block;
    cursor: crosshair;
}

.motion-page .btn-tool {
    background: var(--bg-card);
    border: none;
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
}

.motion-page .btn-tool:hover {
    background: var(--accent);
}

.motion-page .btn-tool.active {
    background: var(--accent);
}

.motion-page .sensor-item {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.motion-page .sensor-item:hover {
    border-color: var(--accent);
}

.motion-page .sensor-item.selected {
    border-color: var(--accent-green);
    background: #1a3a5c;
}

.motion-page .sensor-item.has-box {
    border-left: 4px solid var(--accent-green);
}

.motion-page .sensor-item .sensor-status {
    font-size: 12px;
}

.motion-page .box-preview {
    position: absolute;
    border: 2px dashed var(--accent);
    background: rgba(233, 69, 96, 0.2);
    pointer-events: none;
}

.motion-page .drawn-box {
    position: absolute;
    border: 2px solid var(--accent-green);
    background: rgba(76, 175, 80, 0.3);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: white;
    text-shadow: 1px 1px 2px black;
}

.motion-page .drawn-box.selected {
    border-color: var(--accent);
    border-width: 3px;
}

.motion-page .instructions {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 13px;
}

.motion-page .instructions h6 {
    color: var(--accent);
    margin-bottom: 10px;
}

.motion-page .instructions ol {
    margin: 0;
    padding-left: 20px;
}

.motion-page .instructions li {
    margin-bottom: 5px;
}

.motion-page .delete-btn {
    background: var(--accent);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    margin-top: 8px;
}

/* ===== Light Theme Overrides ===== */

[data-theme="light"] .motion-page .sensor-card.active {
    background: #d4edda;
    border-left-color: var(--accent-green);
}

[data-theme="light"] .motion-page .sensor-item.selected {
    border-color: var(--accent-green);
    background: #e8f0fe;
}

[data-theme="light"] .motion-page .canvas-wrapper {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .motion-page .btn-editor:hover {
    background: #c73e54;
}
