/* ─── Originsun Media Guard Pro ─── */
/* Extracted from index.html <style> blocks */

/* ─── Grouped navigation (top group bar + left sidebar, 官網-style) ─── */
.group-top-btn {
    padding: 12px 20px; font-size: 14px; font-weight: 600;
    border-top-left-radius: 8px; border-top-right-radius: 8px;
    background: #1e1e1e; color: #fff; border: 1px solid transparent;
    margin-right: 4px; cursor: pointer; transition: background .15s, color .15s;
}
.group-top-btn:hover { background: #252525; }
.group-top-btn.active {
    background: #2a2a2a; color: #60a5fa;
    border: 1px solid #3a3a3a; border-bottom-color: transparent;
}
.group-sidebar {
    width: 200px; flex-shrink: 0; padding: 12px 0;
    background: #1f1f1f; border: 1px solid #3a3a3a; border-right: none;
    border-bottom-left-radius: 8px; align-self: stretch;
}
/* Left-sidebar item — shared by the grouped nav、官網管理與財務管理 sidebar
   (.website-nav-btn / .finance-nav-btn) so they look identical from one source of truth. */
.group-side-btn, .website-nav-btn, .finance-nav-btn {
    display: block; width: 100%; text-align: left;
    padding: 10px 16px; background: transparent; color: #ccc;
    border: none; border-left: 3px solid transparent;
    cursor: pointer; font-size: 13px; transition: all .15s;
}
.group-side-btn:hover, .website-nav-btn:hover, .finance-nav-btn:hover { background: #252525; color: #fff; }
.group-side-btn.active, .website-nav-btn.active, .finance-nav-btn.active {
    background: #2a2a2a; color: #fff;
    border-left-color: #3b82f6; font-weight: 600;
}

/* Mobile (≤768px): stack content under a horizontal-scrolling sidebar strip;
   active marker moves from left-border to bottom-border. */
@media (max-width: 768px) {
    #top-group-nav { flex-wrap: wrap; }
    .group-top-btn { padding: 10px 12px; font-size: 13px; }
    #app-body { flex-direction: column; }
    .group-sidebar {
        width: 100%; display: flex; overflow-x: auto; padding: 0;
        border: 1px solid #3a3a3a; border-radius: 8px 8px 0 0;
    }
    .group-side-btn {
        width: auto; white-space: nowrap;
        border-left: none; border-bottom: 3px solid transparent;
    }
    .group-side-btn.active { border-left-color: transparent; border-bottom-color: #3b82f6; }
}

        /* Global: dark calendar/month picker icons */
        input[type="date"],
        input[type="month"] { color-scheme: dark; }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        .log-box {
            font-family: 'Consolas', 'Courier New', monospace;
            white-space: pre-wrap;
        }

        /* ─── Settings Modal ─────────────────────────────────────────── */
        .originsun-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.75);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9999;
        }

        .originsun-modal-content {
            background-color: #2b2b2b;
            width: 550px;
            border-radius: 8px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
            border: 1px solid #444;
            overflow: hidden;
            color: #e5e7eb;
            font-family: inherit;
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            background-color: #1f1f1f;
            border-bottom: 1px solid #333;
        }

        .modal-header h3 {
            margin: 0;
            font-size: 16px;
            color: #fff;
        }

        .close-btn {
            font-size: 24px;
            cursor: pointer;
            color: #888;
        }

        .close-btn:hover {
            color: #fff;
        }

        .modal-tabs {
            display: flex;
            background-color: #1f1f1f;
            border-bottom: 1px solid #444;
        }

        .tab-btn {
            flex: 1;
            padding: 12px 0;
            background: none;
            border: none;
            color: #aaa;
            cursor: pointer;
            font-size: 14px;
            border-bottom: 2px solid transparent;
        }

        .tab-btn:hover {
            color: #fff;
            background-color: #252525;
        }

        .tab-btn.active {
            color: #fff;
            border-bottom: 2px solid #8b5cf6;
        }

        .tab-content {
            padding: 20px;
        }

        .form-group {
            margin-bottom: 16px;
        }

        .form-group label {
            display: block;
            margin-bottom: 6px;
            font-size: 13px;
            color: #aaa;
        }

        .form-group input,
        .form-group textarea {
            width: 100%;
            box-sizing: border-box;
            background-color: #1a1a1a;
            border: 1px solid #444;
            color: #fff;
            padding: 10px;
            border-radius: 4px;
            font-family: inherit;
        }

        .form-group input:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: #8b5cf6;
        }

        .template-hint {
            font-size: 12px;
            color: #fbbf24;
            margin-bottom: 12px;
        }

        .modal-footer {
            padding: 16px 20px;
            border-top: 1px solid #333;
            display: flex;
            justify-content: flex-end;
            gap: 12px;
        }

        .btn-cancel {
            background-color: transparent;
            color: #aaa;
            border: 1px solid #555;
            padding: 8px 16px;
            border-radius: 4px;
            cursor: pointer;
        }

        .btn-cancel:hover {
            background-color: #333;
            color: #fff;
        }

        .btn-save {
            background-color: #6d28d9;
            color: #fff;
            border: none;
            padding: 8px 20px;
            border-radius: 4px;
            cursor: pointer;
            font-weight: bold;
        }

        .btn-save:hover {
            background-color: #5b21b6;
        }

/* ─── Settings Modal: Channel Toggle Pills ─── */

                    .ch-toggles {
                        display: inline-flex;
                        gap: 5px;
                        margin-left: 8px;
                        vertical-align: middle;
                    }

                    .ch-toggle {
                        display: inline-block;
                        padding: 2px 9px;
                        border-radius: 99px;
                        font-size: 11px;
                        font-weight: 600;
                        cursor: pointer;
                        border: 1.5px solid;
                        transition: background .15s, color .15s;
                        user-select: none;
                    }

                    .ch-toggle.gchat.on {
                        background: #7C3AED;
                        border-color: #7C3AED;
                        color: #fff;
                    }

                    .ch-toggle.gchat.off {
                        background: transparent;
                        border-color: #4B5563;
                        color: #6B7280;
                    }

                    .ch-toggle.line.on {
                        background: #06C755;
                        border-color: #06C755;
                        color: #fff;
                    }

                    .ch-toggle.line.off {
                        background: transparent;
                        border-color: #4B5563;
                        color: #6B7280;
                    }

/* ── Schedule Modal ──────────────────────────── */
.schedule-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.schedule-modal {
    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 24px;
    min-width: 360px;
    max-width: 440px;
}
.schedule-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0 0 16px;
}
.schedule-modal-field {
    margin-bottom: 12px;
}
.schedule-modal-field label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}
.schedule-modal-field input {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 8px 10px;
    color: #e0e0e0;
    font-size: 14px;
    box-sizing: border-box;
    color-scheme: dark;
    font-family: inherit;
}
.schedule-modal-field input:focus {
    outline: none;
    border-color: #3b82f6;
}
.schedule-modal-row {
    display: flex;
    gap: 12px;
}
.schedule-modal-row .schedule-modal-field {
    flex: 1;
}
.schedule-modal-time-row {
    display: flex;
    align-items: center;
    gap: 4px;
}
.schedule-modal-time-sep {
    color: #888;
    font-size: 16px;
    line-height: 1;
}
.schedule-modal-select {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 8px 10px;
    color: #e0e0e0;
    font-size: 14px;
    font-family: inherit;
    color-scheme: dark;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
}
.schedule-modal-select:focus {
    border-color: #3b82f6;
}
.schedule-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}
.schedule-modal-btn {
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    border: none;
}
.schedule-modal-cancel {
    background: #333;
    color: #ccc;
}
.schedule-modal-cancel:hover {
    background: #444;
}
.schedule-modal-confirm {
    background: #3b82f6;
    color: #fff;
}
.schedule-modal-confirm:hover {
    background: #2563eb;
}

/* ── Drone Meta: Dual Range Slider ── */
.dm-range-wrap { position: relative; height: 24px; }
.dm-range {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: transparent;
    margin: 0;
}
.dm-range::-webkit-slider-runnable-track {
    height: 4px;
    background: #444;
    border-radius: 2px;
}
.dm-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: all;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid #1e1e1e;
    cursor: pointer;
    margin-top: -5px;
}
.dm-range-hi::-webkit-slider-runnable-track { background: transparent; }
.dm-file-card.drag-over { border-color: #3b82f6; background: #1a2a3a; }

/* ── Drone Meta: Arrange Panel ── */
.dm-arrange-card {
    width: 140px;
    position: relative;
    cursor: pointer;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.dm-arrange-card:hover { border-color: #3b82f6; }
.dm-arrange-card.dragging { opacity: 0.5; }
.dm-arrange-card-drop-target { border-color: #3b82f6; border-left-width: 3px; }
.dm-arrange-drop-active { border-color: #3b82f6 !important; background: #1a2a3a; }
