/* Control CSS - Main application specific styles */ /* Base styles are in shared.css */ body { padding: 12px; } .container { max-width: 900px; margin: 0 auto; } /* Header */ .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; } .form-group { margin-bottom: 12px; } /* Schema Editor */ .schema-controls { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; } .schema-controls .form-group { margin-bottom: 0; flex: 1; min-width: 150px; } .schema-controls .btn { flex: 0 0 auto; } .time-grid { display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; -webkit-overflow-scrolling: touch; } .time-row { display: grid; grid-template-columns: 55px 40px repeat(6, 1fr); gap: 6px; align-items: center; padding: 8px; background: var(--bg-color); border-radius: 8px; border: 1px solid var(--border); } .time-label { font-weight: 600; color: var(--text); font-size: 0.85rem; } .color-preview { width: 100%; height: 32px; border-radius: 6px; border: 2px solid var(--border); cursor: pointer; transition: transform 0.1s; min-width: 32px; } .color-preview:hover { transform: scale(1.05); } .value-input { width: 100%; padding: 8px 4px; text-align: center; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--text); font-size: 14px; min-width: 0; } .value-input:focus { outline: none; border-color: var(--success); } /* Hide number input spinners on mobile for cleaner look */ .value-input::-webkit-outer-spin-button, .value-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } .value-input[type=number] { -moz-appearance: textfield; appearance: textfield; } .value-header { display: grid; grid-template-columns: 55px 40px repeat(6, 1fr); gap: 6px; padding: 8px; font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; } .value-header span { text-align: center; } .value-header span:first-child { text-align: left; } /* Color Picker Modal */ .modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.7); z-index: 100; align-items: center; justify-content: center; padding: 16px; } .modal-overlay.active { display: flex; } .modal { background: var(--card-bg); border-radius: 16px; padding: 20px; width: 100%; max-width: 350px; border: 1px solid var(--border); max-height: 90vh; overflow-y: auto; } .modal h3 { margin-bottom: 20px; text-align: center; font-size: 1.1rem; } .color-picker-container { display: flex; flex-direction: column; gap: 16px; } .color-slider { display: flex; align-items: center; gap: 12px; } .color-slider label { width: 24px; margin: 0; font-weight: bold; font-size: 1rem; } .color-slider input[type="range"] { flex: 1; height: 28px; -webkit-appearance: none; appearance: none; border-radius: 14px; padding: 10px 0; background: transparent; } .color-slider input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; } .color-slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--text); cursor: pointer; margin-top: -10px; box-shadow: 0 2px 6px var(--shadow); } #rangeR::-webkit-slider-runnable-track { background: linear-gradient(to right, #000, #f00); } #rangeG::-webkit-slider-runnable-track { background: linear-gradient(to right, #000, #0f0); } #rangeB::-webkit-slider-runnable-track { background: linear-gradient(to right, #000, #00f); } .color-slider .value { width: 40px; text-align: right; font-family: monospace; font-size: 0.95rem; } .preview-large { width: 100%; height: 60px; border-radius: 12px; border: 2px solid var(--border); margin: 8px 0; } .modal-buttons { display: flex; gap: 10px; margin-top: 16px; } .modal-buttons .btn { flex: 1; } /* Scrollbar Styling */ .time-grid::-webkit-scrollbar { width: 6px; } .time-grid::-webkit-scrollbar-track { background: transparent; } .time-grid::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; } /* Loading Spinner */ .loading { display: none; text-align: center; padding: 30px; color: var(--text-muted); } .loading.active { display: block; } .spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--success); border-radius: 50%; margin: 0 auto 12px; animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } /* Tabs */ .tabs { display: flex; gap: 4px; margin-bottom: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--bg-color); padding: 4px; border-radius: 10px; border: 1px solid var(--border); } .tab { flex: 1; padding: 12px 20px; background: transparent; border: none; border-radius: 8px; color: var(--text-muted); cursor: pointer; font-size: 0.95rem; font-weight: 500; transition: background 0.2s, color 0.2s; white-space: nowrap; min-height: 44px; touch-action: manipulation; } .tab:hover { background: var(--accent); } .tab.active { background: var(--card-bg); color: var(--text); box-shadow: 0 2px 4px var(--shadow); } [data-theme="light"] .tab.active { background: var(--primary); color: #fff; } .tab-content { display: none; } .tab-content.active { display: block; } /* Sub-Tabs */ .sub-tabs { display: flex; gap: 4px; margin-bottom: 16px; background: var(--bg-color); padding: 4px; border-radius: 10px; border: 1px solid var(--border); } .sub-tab { flex: 1; padding: 10px 16px; background: transparent; border: none; border-radius: 8px; color: var(--text-muted); cursor: pointer; font-size: 0.9rem; transition: background 0.2s, color 0.2s; white-space: nowrap; min-height: 40px; touch-action: manipulation; } .sub-tab:hover { background: var(--accent); } .sub-tab.active { background: var(--card-bg); color: var(--text); box-shadow: 0 2px 4px var(--shadow); } [data-theme="light"] .sub-tab.active { background: var(--primary); color: #fff; } .sub-tab-content { display: none; } .sub-tab-content.active { display: block; } /* Connection Info */ #connection-info p { margin: 8px 0; font-size: 0.95rem; } /* Control Sections */ .control-section { padding: 16px 0; border-bottom: 1px solid var(--border); } .control-section:first-child { padding-top: 0; } .control-section:last-child { border-bottom: none; padding-bottom: 0; } .control-section h3 { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; } /* Control Panel - Light Toggle */ .control-group { margin-bottom: 0; } .toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; } .toggle-label { font-size: 1.1rem; font-weight: 600; color: var(--text); } .toggle-switch { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-radius: 30px; border: 2px solid var(--border); background: var(--bg-color); cursor: pointer; transition: all 0.3s ease; min-width: 120px; justify-content: center; } .toggle-switch:hover { border-color: var(--success); } .toggle-switch.active { background: var(--success); border-color: var(--success); } .toggle-switch.active .toggle-state { color: #fff; } .toggle-switch.active .toggle-icon { filter: brightness(1.2); } .toggle-state { font-weight: 700; font-size: 0.95rem; color: var(--text-muted); transition: color 0.3s; } .toggle-icon { font-size: 1.4rem; transition: filter 0.3s; } /* Mode Selector */ .mode-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; } .mode-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 12px; border-radius: 12px; border: 2px solid var(--border); background: var(--bg-color); cursor: pointer; transition: all 0.2s ease; } .mode-btn:hover { border-color: var(--success); transform: translateY(-2px); } .mode-btn.active { background: var(--success); border-color: var(--success); } .mode-btn.active .mode-name { color: #fff; } .mode-icon { font-size: 1.8rem; } .mode-name { font-size: 0.9rem; font-weight: 600; color: var(--text); transition: color 0.2s; } /* Simulation Options */ .simulation-options { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease; margin-top: 0; } .simulation-options.visible { max-height: 100px; opacity: 1; margin-top: 16px; } /* Status Display */ .status-display { display: grid; gap: 12px; } .status-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); display: none; } .status-item.visible { display: flex; } .status-item:last-child { border-bottom: none; } .status-label { color: var(--text-muted); font-size: 0.9rem; } .status-value { font-weight: 600; color: var(--text); } .current-color-preview { width: 60px; height: 30px; border-radius: 6px; border: 2px solid var(--border); background: rgb(255, 240, 220); } /* Card Description */ .card-description { color: var(--text-muted); font-size: 0.9rem; margin-top: -10px; margin-bottom: 16px; } /* Device List */ .device-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; } .device-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: var(--bg-color); border: 1px solid var(--border); border-radius: 10px; gap: 12px; } .device-item.unpaired { border-left: 3px solid var(--success); } .device-item.paired { border-left: 3px solid var(--accent); } .device-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; } .device-icon { font-size: 1.5rem; flex-shrink: 0; } .device-details { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; } .device-name { font-weight: 600; color: var(--text); font-size: 0.95rem; } .device-name-input { font-weight: 600; color: var(--text); font-size: 0.95rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; width: 100%; min-width: 0; } .device-name-input:focus { outline: none; border-color: var(--success); } .device-id { font-size: 0.75rem; color: var(--text-muted); font-family: monospace; } /* Small Button */ .btn-small { padding: 8px 12px; font-size: 0.85rem; min-height: 36px; } .btn-danger:hover { background: var(--error); color: #fff; } /* Empty State */ .empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 20px; text-align: center; color: var(--text-muted); } .empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.6; } .empty-state p { margin: 0; font-size: 0.95rem; } .empty-hint { font-size: 0.85rem !important; margin-top: 8px !important; opacity: 0.7; } /* Mobile Responsive */ @media (max-width: 600px) { body { padding: 8px; } .header { flex-direction: column; align-items: stretch; text-align: center; } .header h1 { order: 1; } .theme-toggle { order: 2; justify-content: center; } .card { padding: 14px; border-radius: 10px; } h2 { font-size: 1rem; } .tabs { justify-content: stretch; } .tab { flex: 1; text-align: center; padding: 12px 10px; font-size: 0.9rem; } /* Sub-tabs mobile */ .sub-tabs { padding: 3px; } .sub-tab { padding: 8px 12px; font-size: 0.85rem; min-height: 36px; } /* Device list mobile */ .device-item { flex-wrap: wrap; gap: 10px; } .device-info { width: 100%; } .device-item .btn { width: 100%; } .device-name-input { font-size: 16px; /* Prevents zoom on iOS */ } /* Mode selector mobile */ .mode-selector { grid-template-columns: repeat(3, 1fr); gap: 8px; } .mode-btn { padding: 12px 8px; } .mode-icon { font-size: 1.5rem; } .mode-name { font-size: 0.8rem; } .toggle-switch { min-width: 100px; padding: 10px 16px; } .btn-group { flex-direction: column; } .btn-group .btn { width: 100%; } .schema-controls { flex-direction: column; align-items: stretch; } .schema-controls .form-group { min-width: 100%; } .schema-controls .btn { width: 100%; } /* Simplified grid for mobile */ .time-row { grid-template-columns: 50px 36px repeat(3, 1fr); gap: 4px; padding: 6px; } .value-header { grid-template-columns: 50px 36px repeat(3, 1fr); gap: 4px; font-size: 0.65rem; } /* Hide V1, V2, V3 on mobile for simplicity */ .time-row input:nth-child(n+6), .value-header span:nth-child(n+6) { display: none; } .value-input { padding: 6px 2px; font-size: 13px; } .time-label { font-size: 0.8rem; } .color-preview { height: 28px; } } /* Extra small screens */ @media (max-width: 380px) { .header h1 { font-size: 1.2rem; } .tab { padding: 10px 8px; font-size: 0.85rem; } } /* Landscape mobile */ @media (max-height: 500px) and (orientation: landscape) { .time-grid { max-height: 50vh; } .modal { max-height: 95vh; padding: 16px; } } /* Safe area for notched phones */ @supports (padding: max(0px)) { body { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); padding-bottom: max(12px, env(safe-area-inset-bottom)); } } /* Scene Styles */ .scenes-config-list { display: flex; flex-direction: column; gap: 10px; margin-top: 15px; } .scene-config-item { display: flex; justify-content: space-between; align-items: center; background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; transition: border-color 0.2s; } .scene-config-item:hover { border-color: var(--success); } .scene-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; } .scene-icon { font-size: 1.5rem; flex-shrink: 0; } .scene-details { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .scene-name { font-weight: 500; color: var(--text); } .scene-actions-text { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .scene-buttons { display: flex; gap: 6px; flex-shrink: 0; } /* Scenes on control page */ .scenes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; } .scene-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px 12px; background: var(--input-bg); border: 2px solid var(--border); border-radius: 12px; cursor: pointer; transition: all 0.2s; min-height: 80px; } .scene-btn:hover { border-color: var(--success); background: var(--accent); } .scene-btn:active { transform: scale(0.95); } .scene-btn-icon { font-size: 1.8rem; } .scene-btn-name { font-size: 0.85rem; color: var(--text); text-align: center; } /* Devices on control page */ .devices-control-grid { display: flex; flex-direction: column; gap: 10px; } .device-control-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px; } .device-control-icon { font-size: 1.3rem; flex-shrink: 0; } .device-control-name { flex: 1; color: var(--text); } .toggle-switch.small { min-width: auto; padding: 8px 12px; } /* Icon selector for scene modal */ .icon-selector { display: flex; flex-wrap: wrap; gap: 8px; } .icon-btn { width: 44px; height: 44px; font-size: 1.3rem; background: var(--input-bg); border: 2px solid var(--border); border-radius: 8px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; } .icon-btn:hover { border-color: var(--text-muted); } .icon-btn.active { border-color: var(--success); background: var(--accent); } /* Scene actions editor */ .scene-actions-editor { display: flex; flex-direction: column; gap: 12px; } .scene-action-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .scene-action-row label { display: flex; align-items: center; gap: 8px; min-width: 140px; cursor: pointer; } .scene-action-row select { flex: 1; min-width: 120px; padding: 8px 12px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 0.9rem; } .scene-action-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--success); } /* Scene device list */ .scene-devices-list { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; padding: 4px; } .scene-device-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px; transition: border-color 0.2s; } .scene-device-item:hover { border-color: var(--success); } .scene-device-checkbox { display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 1; min-width: 0; } .scene-device-checkbox input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--success); flex-shrink: 0; } .scene-device-checkbox .device-icon { font-size: 1.2rem; flex-shrink: 0; } .scene-device-checkbox .device-name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .scene-device-state { padding: 6px 10px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 0.85rem; flex-shrink: 0; } .scene-device-state:disabled { opacity: 0.5; cursor: not-allowed; } .empty-state.small { padding: 16px; font-size: 0.9rem; } .empty-state.small .empty-icon { font-size: 1.5rem; } /* Responsive for scenes */ @media (max-width: 600px) { .scenes-grid { grid-template-columns: repeat(2, 1fr); } .scene-config-item { flex-direction: column; gap: 12px; align-items: flex-start; } .scene-buttons { width: 100%; justify-content: flex-end; } .scene-action-row { flex-direction: column; align-items: flex-start; } .scene-action-row select { width: 100%; } } /* LED Configuration */ .segment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; } .segment-header h3 { margin: 0; font-size: 1rem; color: var(--text); } .btn-small { padding: 6px 12px; font-size: 0.85rem; } .wled-segments-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; } .wled-segment-item { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: flex-end; padding: 16px; background: var(--bg-color); border-radius: 10px; border: 1px solid var(--border); } .segment-name-field { display: flex; flex-direction: column; gap: 4px; } .segment-number { font-weight: 600; font-size: 0.75rem; color: var(--primary); } .segment-name-input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--text); font-size: 0.9rem; height: 38px; box-sizing: border-box; } .segment-field { display: flex; flex-direction: column; gap: 4px; } .segment-field label { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; } .segment-field input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--text); font-size: 0.9rem; text-align: center; width: 70px; height: 38px; box-sizing: border-box; } .segment-remove-btn { padding: 8px; background: transparent; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; color: var(--text-secondary); transition: all 0.2s; height: 38px; width: 38px; box-sizing: border-box; align-self: flex-end; } .segment-remove-btn:hover { background: #ff4444; border-color: #ff4444; color: white; } /* Responsive for LED */ @media (max-width: 600px) { .segment-header { flex-direction: column; align-items: flex-start; gap: 10px; } .wled-segment-item { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto; } .segment-number { grid-column: 1 / -1; } .segment-name-input { grid-column: 1 / -1; } .segment-remove-btn { grid-column: 1 / -1; justify-self: end; } }